Help, Remapping incoming Midi events

Discuss Lemur and share techniques.
Post Reply
karmafx
Newbie
Posts:5
Joined:20 Apr 2013 21:49
Help, Remapping incoming Midi events

Post by karmafx » 19 May 2013 20:41

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

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Help, Remapping incoming Midi events

Post by Softcore » 20 May 2013 07:38

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.

mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25

Re: Help, Remapping incoming Midi events

Post by mbncp » 20 May 2013 10:58

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 ?

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Help, Remapping incoming Midi events

Post by Softcore » 20 May 2013 11:52

I dont have the slightest idea for setting things up in the iPad editor. I dont use it at all!

karmafx
Newbie
Posts:5
Joined:20 Apr 2013 21:49

Re: Help, Remapping incoming Midi events

Post by karmafx » 20 May 2013 12:31

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.
Last edited by karmafx on 21 May 2013 03:14, edited 1 time in total.

karmafx
Newbie
Posts:5
Joined:20 Apr 2013 21:49

Re: Help, Remapping incoming Midi events

Post by karmafx » 20 May 2013 12:40

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

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Help, Remapping incoming Midi events

Post by Softcore » 20 May 2013 13:05

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. ;)

karmafx
Newbie
Posts:5
Joined:20 Apr 2013 21:49

Re: Help, Remapping incoming Midi events

Post by karmafx » 20 May 2013 19:07

The last suggestion appeal more to me, at least as i become more familiar on scripting

Thanks a lot!

Post Reply