Ableton "sees" MIDI from Max, Ableton won't launch anything
Hello folks,
I've been working on something for awhile now, I figured I would throw a question out to the forum.
I have some serial data coming in from Arduino. For right now I'm working with two ultrasonic sensors. I'm trying to send a MIDI message to Ableton to trigger a sound, but only when the sensor sees movement (in other words, I'm trying to set it up so that if the current sensor value is different from the last sensor reading (I have it set to a difference of 5 right now), send a message to Ableton, otherwise do nothing. The sensor values appear to be coming into Max very quickly, when I compare outputs under "trigger" both numbers are instantaneously the same, when I believe one should be current value and the other previous value. Since this is true, further down the chain the value I send to midiformat is almost always 0. Ableton sees the MIDI messages, but won't launch anything. I'm wondering where the problem is:
1. Am I not comparing values correctly to get the difference?
2. Am I not sending the values to midiformat correctly?
3. Does everything appear to be fine, could the problem be on Ableton's end?
I would appreciate any and all suggestions. At this point I'm willing to try anything. I've been smacking my head against the keyboard for a long time over this.
Thank you!
NOTE: The stuff at the top is to get serial data before the unpack. The prepends at the bottom are so I can send different messages to different places in Ableton.
If you're working with midi and virtual midi connections (like the 'from Max 1') you'll have a lot of benefit from using a midi monitoring tool to check what is going on. For Mac the open source 'Midi Monitor' is great, for PC I used to use Midi-Ox but that is years ago, not sure if it is still the best.
It will tell you whether your Max patch is generating valid midi data just by looking at what comes out.
also, use [print] or message boxes to verify what goes on in your patch. The problem is that the [sel] object outputs a bang, which you then prepend with a '1' or a '2'. So you're sending '1 bang' or '2 bang' to the [midiformat], where it should be a list with 2 numbers.
hope that helps!
"...it should be a list with 2 numbers."
That's great! What I needed to do was swap out the [select] object for a [* 127] object, so instead of sending a bang I'm sending either a 0 or 127 to trigger notes in Ableton.
Thank you for the thoughtful, solid advice!
Something's happening, though. While the notes are being triggered, Max has a tendency to force itself to quit when I open the gates letting information through. I'm sending serial through it from Arduino at a constant rate, perhaps this is too fast for it to handle? I'm not sure what's going on, but Max doesn't seem to like it.
My Serial Monitor shows this:
15:13:38.881 From from Max 1 Note On 1 C#-2 127
15:13:38.889 From from Max 1 Note Off 1 C#-2 0
15:13:38.946 From from Max 1 Note On 1 C#-2 127
15:13:38.954 From from Max 1 Note Off 1 C#-2 0
15:13:40.123 From from Max 1 Note On 1 C#-2 127
15:13:40.123 From from Max 1 Note Off 1 C#-2 0
I get a handful of notes and then it crashes. Has anyone had this problem before? Any suggestions on how to diagnose the issue?
well yes - if you're sending many messages within the same millisecond (If I'm reading the figures right) it may be a bit much to handle :-)
use the [print] object to analyse the data coming in from your sensors. Then try using [speedlim] or [change] to reduce the data rate, do it as early as possible in the chain so you don't waste CPU power on calculations on data you're going to throw away anyway