Ableton "sees" MIDI from Max, Ableton won't launch anything
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.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1782.3oc6a1rbaaCD.9r7SAFcJoihGB.B.xdnyzGf9D3jICkDrDS3ekDJ0NY x6dwOTVRdDAQjIAUs6ASMjhFb4G1cwtKV8ialMeY4C7l4feGbGX1rebyrY5K otvr1ymMOO4gUYIM5aadA+eJW9k4KLekf+fPe4eC.Qr8WsbmHiKDOVwMi77z B4c8o1u89xBQQRt96l+m0oIY6++J1kmVH+O0OIT6EqRDq1lVr4y07UBy3wht MXAfPf2RV.vwpSPA2F7zSHcsdrkx4GP3iFbiboGc3QBSS520BCDcaf5p+7la TGV7xHRs7owAAcxj4Kj+MfPAiwJbfB0eDFYiJvffyiEzqNrPMpGtPk33QGJh xMax3tYmTUya3EhDQZYwQuPwwp2Dn7UgXdUd1KzIfA1MXPw5QfvvcLPG+7Od rNhXj.6VWUI0xIOAu9y7hjkY5WyATWZShnaVNn1VHllUwZVgCsoEQfSkGG4D VEuXM.MbLwh9CNDoYBkn9PdzFSPiOS1kujWa0xR5YYYRwlAEBFmtXrgEAVg. 1t6kyZrL5JMe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2sUdrw7ur .rtj2.JJ2eKu+rbNbL4b.8VltIrIGAZZGl4QQSFnuqceh+DvfXCyEkf7jhGA UYIq364t5KAk0qkpu5BHZlDj2pZx5rDFOpZxQlvHQlplXbFv5.vjQGvCQqxQ iFlNkqcelM+N.tr76PvWuMJmYiTcpO4fwuU5St1cWFQ5uoVfQuAZStVkDW5R NH60ZWx0x.GZRNH5MdSxYpsgS8HG70eOx0RCWZQt32dcHW69E6RCxc4tZ0il Ndrm86XTKPpqeJxZJ2UuZ+689ebJfCB0ZdiHs3oXFt6vupG.7oaZa5507hiM tWm1nr2W2cEfcVdXtHOmJzio7nVFrW4QEG0Uk7f8m7D6f77LgdT0entn+v7m 73j9LweyWPWluPWYxi+lubw7J1adCcx3B5U3.c.NdR0wESKn+jm3XGvipeL8 j7vbwzR8aWvSJyLnC7g5OScpK5OT+YcQCcw2Srekm9luz8CiuDHWhUU0Zc.j ejGWLvHdbByI4wewhQCbw.yewZ3Rng9SZHtDpwyBmcTkGWb+P7WlEO6Qcd4g 4O2yD30k2GRfqYt6I93RzXdSZBcQbB8m0dnSZO9aszPWzd72REXWb9D5O0Gr SkEyewxiupLtPtD4Lh5W4AcEIONEog+J5CxEmgH+4LDE5Zfg9IyTjKlWH+Ys ibw6C8JSdPQ9a95pxanIE3dK7iGqoZv0EebQ44RK6iYCvRpp9FutocL0Rx77 juTVqNktPeZZg4T8HNul+sz82ezMpQ6m27uP0o.Ei -----------end_max5_patcher-----------
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
Forums > MaxMSP