General

Help, Remapping incoming Midi events

Started by karmafx on .

Sign in or create an account to join the conversation.

8 posts

Topic starter
Hi Everybody!

I'm a noob in Lemur scripting.
I own a SoftStep Midi Controller and I used it with an iPad2.
The Sofstep come with a Editor for customize the messages transmitted but i need a setup on the fly without a computer.
My idea is to use Lemur with a mockup of the interface of the device and do the remapping translation in lemur.

For example receive on a PAD a Note 60 on midi ch 1 and remap to a note 62 or better a chord targeted to another synth app in the same ipad.
Or the same for Control Change messages, receive a CC1 on CH1 from the device to a fader and transmit a CC2 to a CC in a synth to control a parameter.

I know this is simple but i couldn't do it modifying templates from the library.

MIDI_ARGS, OnMIDI execution and Custom MIDI are not that well documented with examples as a guide for this

Any help?

Thanks,

Carlos
Create a OnMidi script, and set it to receive note, CC or whatever type of midi messages you wish to remap, and a Monitor.

Inside the OnMidi script type:

Monitor.value=MIDI_ARGS;

Now, use your connected software to send various messages and observe the monitor. Soon, you will be able to figure out for yourself, in each case what MIDI_ARGS[0] is,
MIDI_ARGS[1] is, and so on. This way, you will know how to re-construct and remap these incoming vector values.

Specifically for the case of CC though, I have worked with it and I can tell you that:

MIDI_ARGS={CCnumber, Value, MidiChannel-1}

SO if for example you want to re-map CC2 of midi channel 12, received in Target0 to CC21, the same midi channel to Target1

OnMidi, target0, CC message type, 1 to 127, 1 to 16
If (MIDI_ARGS[2]==11 && MIDI_ARGS[0]==2)
ctlout(1,21,MIDI_ARGS[1],12);
As a side note, and for other members - readers, if you only wish to catch a specific CC or Midi channel alone you can use the arguments of the script execution.
For example

OnMidi, target0 CC message type, 2 to 2, 12 to 12
would ONLY "catch" and create MIDI_ARGS for CC 2 on midi channel 12 - all the rest of messages will be ignored.
Thanks Softcore!

The practical examples are great.
With the Monitor visual feedback must be easier to figure out for the rest of the messages types.

Now the challenge for me will be to arrange a set of buttons, faders and menus to assign them dynamically for each button of the midi device.
Of course!

You will be needing the midiout - midiout(target, [data]) if I remember correctly - function and a bit of studying for the format of a typical aftertouch midi message. Its perfectly doable though!

if you don't want to bother with studying, hex and decimals, bytes and all that stuff, you can I guess do it indirectly.

First map the incoming MIDI_ARGS[1] value to a Lemur object for example a fader.....

Fader.x=MIDI_ARGS[1]/127;

And then map the fader to aftertouch using the plain, factory midi mappings. ;)