MIDI map - multiple assignments ?

Hey Touch Designers!

Just a short question have arisen from Matthew Ragan’s tut “Working with Midi”. I want to achieve multiple assignments but don’t have the option directly built on my controller. Can I create for example 5 different assignments and switch between them through buttons? Thank You!

So glad that tut is useful!

Can you say a little more about how you want to use multiple assignments? I think I understand, but I’ve learned the hard way that what I’m thinking is rarely exactly what another person has in mind. :smiley:

Thank you for getting in touch! So rapidly as usual.

I am thinking about using multiple assignments to control different scenes. First I want to switch between scenes and than to use different assignment for each scene.

Best

Hard to say what the “right” way to do this is exactly, as much of that depends on your set up.

My first thought was to use selects that were locked and unlocked depending on which “scene” you’re in. That works well, though it means your update as soon as you change scenes, which might not be what you want exactly.

Another approach is to change vals in a target constant CHOP. Big picture idea would be to use one set of buttons on your midi controller to select a scene, and then to derive your target scene based on that button. From there you can then specify which vals you want to update. In this simple example the little control panel is intended to mimic a midi controller - your python logic would have to be a little different, but the idea should be roughly the same.

Here you’ll see that you only update vals that correspond to the “scene” you’re in. Also useful here is that your scene will “remember” the last settings - so when you swap back to it you’ll be in the same condition you left it in.
base_midi_scenes_099.tox (6.62 KB)

That’s one way to think about it - though as a note, you’ll want to be careful here. Midi CHOPs usually cook all the time, so you’ll want a null that’s selective attached that routes to your CHOP Execute - otherwise you’ll be constantly updating values needlessly (which will also have some overhead attached to it).

Hey Matthew, huge bump up from the past but this is exactly the place I think.

First off, your tutorials are amazing, thank you so much for taking the time.

I was wondering if you could elaborate on mapping toggle midi pads to the buttons in this example?

I’ve had a look pretty deep (and am still very new) and I am having trouble finding the exact way to select the buttons via midi, while simultaneously turning off the midi pad that was previously on.

Right now I’m running my midiinmap chop into a select chop, but am having some issues with the Chop Execute syntax to handle the switching.

Any examples/links/references to ways to do this would be massively appreciated.

EDIT
I was able to figure this out.

First — As my controller (AKAI LPD8) has pads that can either be set through the supplied mapper to toggle or momentary, I selected momentary

Second — Back in Touch, I added the buttons to the table_lookup in the example in just the “midi_map” column, corresponding to my midi device mapping. I left target_panel, val, and invert blank as to not mess with the code in the select CHOP’s CHOPexec.

Third — I added a midi in DAT, and in the callbacks wrote a super basic python script:

[code]def onReceiveMIDI(dat, rowIndex, message, channel, index, value, input, bytes):
if message == ‘Note On’:

    if channel == 1 and index == 41:
        op('container1/container1/button1').click();
        print( "this is LPD pad 5" )        
        print( message, channel, index, value )
        
    if channel == 1 and index == 42:
        op('container1/container1/button2').click();
        print( "this is LPD pad 6" )
        print( message, channel, index, value )
        
    if channel == 1 and index == 43:
        op('container1/container1/button3').click();
        print( "this is LPD pad 7" )
        print( message, channel, index, value )
        
    if channel == 1 and index == 44:
        op('container1/container1/button4').click();
        print( "this is LPD pad 8" )
        print( message, channel, index, value )
        
    if channel == 1 and index == 37:
        op('container1/container1/button5').click();
        print( "this is LPD pad 1" )
        print( message, channel, index, value )
        
    if channel == 1 and index == 38:
        op('container1/container1/button6').click();
        print( "this is LPD pad 2" )
        print( message, channel, index, value )
        
    if channel == 1 and index == 39:
        op('container1/container1/button7').click();
        print( "this is LPD pad 3" )
        print( message, channel, index, value )
        
    if channel == 1 and index == 40:
        op('container1/container1/button8').click();
        print( "this is LPD pad 4" )
        print( message, channel, index, value )

return[/code]

Obviously this can be cleaned up and made more sophisticated, but it works simply to trigger the scene buttons in the container, circumventing the limited on/off mapping in the MIDI device mapper dialogue.

Hope this helps someone.

There is another way to do this, which is how I map my own midi devices.

I create a custom mapping via the Midi panel, Devices->Add device. You will then need to goto /local/midi/userdevices to create your own mapping.
If you are using the LPD, then that means you are sending midi notes, you just need to map the note on and note off.

Then when you add a midi device in, and select the correct device and mapping in the Midi panel, you will get a nice channel name in your midi device in chop, i.e. b1.

And then you can create any kind of logic you want via chops.