Max For Live Not Patch Not Updating Data on Arduino Display

169 Views Asked by At

I've been working on a project with an Arduino recently where I'm basically trying to get a small display hooked up to an Arduino to update with the name of a MIDI mapped knob in Ableton Live.

For example, let's say I map the knob to the reverb send on a track the display should read "A-Reverb". This works today, but only works when I first open the Ableton project and map the knob for the first time. It does not update when I select a new option.

Here's the setup I'm using right now:

  • Arduino - w/Rotary Encoder & OLED Display
  • Hairless MIDI - For converting the serial connection from the Arduino into MIDI CC# messages Live can read.
  • Ableton Live 11 w/ Max For Live 8 - This is where the patch actually runs.

For the Max Patch, I'm using a version of Yehezkel Raz's One which I purchased and later modified. The reason I mention this is that this patch already has the name updating part worked out, so in theory I should be able to send that data over serial to the Arduino.

Out of respect for Yehezkel's work, I won't attach a screenshot of the entire patch, but have attached the part that I modified to send data to the Arduino, you can see it here.

Here's what I've tried so far:

  1. Validated that the baud rate for Hairless MIDI, the Arduino, and the Max Patch is identical
  2. Attempted to start Hairless MIDI only after Ableton has been launched
  3. Attempted to power on Arduino without opening the Arduino IDE so that there are no Serial conflicts.

Here's what I think may be the issue, but I'm not sure how to fix it:

  • Part of the logic in my Arduino code relies on Serial.available() being true, in order to send the data to the screen. I'm thinking that maybe the Serial connection is only available in the beginning when the knob is mapped.

I know that was a lot of information, but if anyone has any ideas on how I may be able to get this to work, I'd greatly appreciate it!

1

There are 1 best solutions below

0
On BEST ANSWER

Okay I figured this out on my own; basically what was happening was my code was expecting a line feed in order to refresh the output on the display. I figured out that I could send a line feed over the serial connection by sending the value "10" which would basically terminate the string as it is sent to the Arduino.

Any time the knob value is updated, it triggers a button which sends the value "10" back to the Arduino.

I've attached a screenshot showing the changes I made in case this helps anyone else out:

max patch