handling MIDI Note On/Off from a sequencer

Discuss Lemur and share techniques.
Post Reply
Dark Arps
Newbie
Posts: 9
Joined: 07 Jun 2013 04:15

handling MIDI Note On/Off from a sequencer

Post by Dark Arps »

I am trying to send note on/off messages from Ableton to trigger a pad, or group of pads. The Note on would create a Pads.x=1, note off creates a Pads.x=0.

I can't do this easily because Lemur wants to hear Note On with a velocity of 0 in order to send a 0 value to the object's variable. Ableton Live sends Note Off messages, rather than Note On (velocity 0) when MIDI notes stop in the sequencer. How do I get around this?
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: handling MIDI Note On/Off from a sequencer

Post by Softcore »

I havent tried it, but MAYBE, creating an additional expression (lets name it o) and set it so that o=x, inside the pads object and mapping it to "Note off" instead of Note on might do the trick....not sure though!
Dark Arps
Newbie
Posts: 9
Joined: 07 Jun 2013 04:15

Re: handling MIDI Note On/Off from a sequencer

Post by Dark Arps »

Yup good idea! This worked:

1) Create a script local to the Pads object, called HandleNoteOff

2) Execution set to On MIDI - Note Off - 0-127 (all notes) - 1-16 (all channels)

3) Pads.x=0;

What I'd like to know is how would I make that script global to the project and make it so that any Note Off message received creates a 0 variable in any object which uses the corresponding Note On to trigger its x variable to be 1. Anyone?
Dark Arps
Newbie
Posts: 9
Joined: 07 Jun 2013 04:15

Re: handling MIDI Note On/Off from a sequencer

Post by Dark Arps »

OK actually there are still shortcomings. I'll explain my scenario. I am using Lemur to control a wearable lighting system. Lemur acts as an intermediary app between live or pre-sequenced inputs (specifically Leap Motion>GecoMIDI and Ableton Live) ultimately parsing MID CCs and Note On/Off info and routing OSC data out to an Arduino with a WiFi shield.

I want to use MIDI note sequencing/arpeggiating from Ableton to trigger Pads, which send OSC variable data out to the Arduino. But I also want to be able to use the physics and envelope capabilities of the Lemur environment in this setup. If I have a series of note on and note off data being sent to a Pads object, I want to be able to increase the release time or otherwise modify the envelope to vary the attack and decay time from 0 to 1 to 0 again, which ultimately results in a gentle fading up and down of the lights instead of harsh blinking. Engaging the envelope's release has no effect because the script is forcing the value of the Pads.x variable to drop to 0 when the note off is received, instead of treating it as if I'd released my finger from the iPad screen.
Dark Arps
Newbie
Posts: 9
Joined: 07 Jun 2013 04:15

Re: handling MIDI Note On/Off from a sequencer

Post by Dark Arps »

Actually my script sucks because it means any note off message from any note will turn all of the pads off, not just the one corresponding to the note in question.
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: handling MIDI Note On/Off from a sequencer

Post by Softcore »

I didnt have in mind any scripting at all! Anyways, give me some time so I can work this through - Im quite sure we 'll find a solution! ;)
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: handling MIDI Note On/Off from a sequencer

Post by Softcore »

Ok here's the correct script! In the example a 8x4 Pads object is midi mapped (natively) to pitches 0 - 31, Midi channel 1, target 0. We specify the same data to "catch" with a onMidi script, get the NoteOff pitch, and set the related x to 0.
Attachments
Pads-Note-responsive.jzml
(2.87 KiB) Downloaded 163 times
Dark Arps
Newbie
Posts: 9
Joined: 07 Jun 2013 04:15

Re: handling MIDI Note On/Off from a sequencer

Post by Dark Arps »

This is fantastic! I haven't had the time to check this out yet but it sounds very promising, thanks a lot!

So here's adding an extra layer to the challenge: it would be even better if I could use the AHDSR envelope functionality on the pads like normal, but triggered from the incoming note on/note off information instead of touch. I tried it but it appears the physics engine only responds to touch and not MIDI information.
Dark Arps
Newbie
Posts: 9
Joined: 07 Jun 2013 04:15

Re: handling MIDI Note On/Off from a sequencer

Post by Dark Arps »

OK so I've finally got round to checking this out properly. Pads turn on and off with incoming MIDI notes, as expected. There are two issues however:

1) I want each note on/off to have a corresponding, discrete OSC output, but the Pads object only allows one single OSC address. How would I get around that?

2) It seems that even though the pads light up when it receives the MIDI note on information, this does not result in the corresponding OSC message to be sent out to the address. The OSC message only gets sent if I touch the pads with my finger. How do I directly route incoming MIDI to the OSC output without actually touching the pads?
Post Reply