Page 1 of 1

Help, Remapping incoming Midi events

Posted: 19 May 2013 20:41
by karmafx
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

Re: Help, Remapping incoming Midi events

Posted: 20 May 2013 07:38
by Softcore
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

Code: Select all

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.

Re: Help, Remapping incoming Midi events

Posted: 20 May 2013 10:58
by mbncp
How do you setup an On Midi callback in the ipad editor ?
Can't see where to set the incomming message type, and my on midi func gets never called. Am I that blind ?

Re: Help, Remapping incoming Midi events

Posted: 20 May 2013 11:52
by Softcore
I dont have the slightest idea for setting things up in the iPad editor. I dont use it at all!

Re: Help, Remapping incoming Midi events

Posted: 20 May 2013 12:31
by karmafx
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.

Re: Help, Remapping incoming Midi events

Posted: 20 May 2013 12:40
by karmafx
Can the same method be used for transforming for example a cc value to poly aftertouch?
I'm thinking in poly after touch modulation for animoog

Re: Help, Remapping incoming Midi events

Posted: 20 May 2013 13:05
by Softcore
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. ;)

Re: Help, Remapping incoming Midi events

Posted: 20 May 2013 19:07
by karmafx
The last suggestion appeal more to me, at least as i become more familiar on scripting

Thanks a lot!