MIDI Mapping

tommaso piazza's icon

Hi everyone,
I'm trying to program a midi mapping. I've started with a ctlin object that sends out in the left outlet the "controller value" and in the central outlet the "controller number". The problem is that each master keyboard has got different controller numbers so, if I program a midi mapping for a particular midi controller, when I'll change it will change also the controller numbers and the algorithm that i've programmed should be changed every time. Someone knows some tutorials or has got some particular suggestions to program a midi mapping that doesn't need changes?
Thanks a lot for your recommendations!!!

yaniki's icon

You may to implement an architecture allowing separation between the MIDI input and the processing algorithm itself: [MIDI input]->{conversion MIDI data to an arbitrary representation}->[algorithm operating on the arbitrary data]->[output] - so when you change MIDI controller to another one you have only modify method for converting your MIDI data.

tommaso piazza's icon

Could you suggest me the main objects to do that? The only one I've thought was a select object with a number of arguments (i.e. sel 1 2 3 4 5 and so on...) so that each controller number is selected but I didn't understand how I can program an arbitrary representation. I mean how can I know wich will be the number that will output the ctlin object if each master keyboard has got a different number of potenziometers with different controller numbers? Select objet just recognises a controller number if it is written in the argument but if it isn't written?

yaniki's icon

Sure, try attached sketch. In this example you need to edit content of the coll object (and nothing more) when you change your MIDI controller.

Max Patch
Copy patch and select New From Clipboard in Max.

tommaso piazza's icon

Thanks a lot you were very gentle! I'll try to start with your example.