Pro Tools Rec Light

Grumpy_Mike: A CC message for controller 12?

Yes it's a CC message for controller 12 with value 0. Sorry! Sometimes my English and the knowledge of programming makes me unclear))

Grumpy_Mike: I think it is time to specify each group of messages, what you get and what you want to do when you get them.

Thing are the same!! Since ProTools uses HUI protocol to communicate with control surfaces it will take long enough to spy down all its messages. As I was interested in Rec button I "spied" on HUI with MIDI Monitor. I've just found the REC "pattern". As for other messages its unpredictable how many of them in HUI. Though it could be interesting to do that.

Still not sure about the problem but try changing

ccMessage12Value = 0;

To

ccMessage12Value = -1;

-1 didn't helped. The LED sometimes even doesn't respond. Sometimes it responds but never goes off.

Just in case I'll write about the messages concerning recording. Before rec process I have to "arm" the track (to prepare it for recording). When I press "arm track" HUI sends a lot of messages (since the arm button blinks they are on/off commands and I suspect the info about the track armed). First 10 are (1,12,0) (1,44,7) (1,12,14) (1,45,5) (1,12,15) (1,44,2) (1,12,13) (1,44,2) (1,12,12) (1,44,70)

When I press rec button HUI sends 10 CC messages. They are: (1,12,14) (1,45,5) (1,12,15) (1,44,2) (1,12,13) (1,44,2) (1,12,14) (1,45,5) (1,12,14) (1,44,69) My guess was these messages are responsible for REC LED

the button starts to blink and HUI sends:

(1,12,14) (1,45,5) (here it is possible to see stop and rec together in on place i.e. on/off/on/off) (1,12,14) (1,44,69) ( I can refuse rec and turn it off by pressing rec button again - behavior like I press stop button)

and so on until I press play button. From this point ProTools starts to record things. The LED is continuously on. It's almost impossible to track down "PLAY" notes (a lot of them) + sysex notes (info about cursor position and so on) but the most common command is: (1,44,68) - I think it is responsible for "PLAY LED"

I press stop and HUI sends: (1,12,14) (1,45,5) (1,12,15) (1,44,2) (1,12,13) (1,44,2)

May be that's unnecessary info, but just in case)))

OK there seems to be a lot going on here than first we thought. I looked at some proTools information and came up with the attached PDF.
In appendix A there is a list of what messages are sent for the LEDs and it seems to suggest that it is a SysEx message. It is the CC messages that seem to be concerned with the fader and switch data. This does not tie up with what you are reporting. Are we balking up the wrong tree, or does the attached document not describe what, the version of Pro Tools you have, actually sends.

MIDI_Controllers_Guide50.pdf (975 KB)

Yes, I saw these docs and also I read the results of "reversed engineering" . I don't know why but yes , what I see on my MIDI Monitor is different from the info in there. May be that's because of ProTools v5 (release1999)and now I've got v.12. (but why Cubase when using HUI protocol sends almost the data? - By the way the code works also in Cubase) May be the reason is in using MIDI translators (quoting: "you can a use a third-party controller (such as the JL Coo- per FaderMasterTM) and program its con- trols to function like a JL Cooper CS-10." ) Who knows. May be (and that should be #1) I missed something. There could be tons of reasons. But the first version of your precious code works! And all the data used is the data from MIDI Monitor. (Sorry for the bold:))

When I press Record no Sysex info is transmitted (on all of the channels). Sysex appears only if I press Play button. Info about the other buttons is also sent via CC messages.

I decided to get rid of midi shield and changed the firmware. Now it is Hiduino. The program still works. :)

Hello! Small update: After couple weeks of testing during the real recording sessions I found a small bug. During recording when I try to choose a track (click on any track, armed or not) the LED shuts down. Fixed it!!! removing any info concerning channel byte. Now it works as should (sorry for the quality).

Don't understand why channel byte was an obstacle but it was. I'm going to check the idea with adding:

ccMessage12Value = -1; // blank MSB of message to stop rapid on / off of LEDs

May be this time (without channel info ) it will work.

Thank you!

Fixed it!!! removing any info concerning channel byte. Now it works as should

Well done. :)

Thanks for the update.

Hello! Another small update:

Mixing sessions brought a new bug: suddenly it turned out that "Scrubber Tool" when used sends tones of CC messages including the ones concerning record. The LED "rapidly turns on/off"... So, I was forced to deal with

 ccMessage12Value = 0; // blank MSB of message to stop rapid on / off of LEDs

and I found what was wrong with it! I realised what it was for)) If it is correct I'd call it like: "MIDI debouncing". :) Dear Grumpy_Mike, your are GREAT! All I had to to do is to change it to:

ccMessage44Value = 0;

since the message "ccMessage12Value" arrives first. And voila: it works even better! I think from now I'm protected from new "surprises".

Thank you! :)

and I found what was wrong with it!

Fantastic. Mrs Grumpy says "that was the result you were aiming for but rarely get". To be able to fix your own stuff is good. :)

Hi, after a week of fooling around with my first project…
Here is my code:

#include <MIDI.h>

//Flash arduino 8u2 or 16u2 chip with HIDUINO_MIDI.hex
//Set ProTools or other DAW to use MIDI controller / HUI protocol / arduino_midi (default hiduino name)
//The two sets of messages that we are looking for are:
// RECORD ON
// 1) channel 1,  controller 12, value 14 
// 2) channel 1,  controller 44, value 69
// RECORD OFF
// 1) channel 1,  controller 12, value 14 
// 2) channel 1,  controller 44, value 5

int firstMsg=0;  // set int for the first part of the two messages

MIDI_CREATE_DEFAULT_INSTANCE(); 

void setup(){
//Use LED for reference
pinMode(13,OUTPUT); 
// Listen for MIDI on channel 1 only
MIDI.begin(1); 
//Listen for incoming ControlChange MIDI messages and pass bytes to function if received
MIDI.setHandleControlChange(CCSequence); 
}

void loop() {
MIDI.read(); // Read all incoming MIDI data
}

//Function that will receive the CC MIDI Bytes
void CCSequence(byte channel, byte controller, byte value  ) { 
  //Check if CC message is equal to the first part of our two sequences:
  //1) channel 1,  controller 12, value 14 
  if((channel==1)&&(controller=12)&&(value==14))
    {
      //Mark first part of the sequence as received
      firstMsg=1; 
    }
    
  //If first part is received look for the second part of our two sequences
  if(firstMsg==1)
      {
        //Check if CC message is the second part of RECORD ON
        //2) channel 1,  controller 44, value 69
        if((channel==1)&&(controller=44)&&(value==69))
          {
            //Turn LED ON
            digitalWrite(13, HIGH);
            //Reset Marker. We start waiting for the first part of the sequence again
            firstMsg=0;
          } 
        //Check if CC message is the second part of RECORD OFF
        //2) channel 1,  controller 44, value 5
        if((channel==1)&&(controller=44)&&(value==5))
          {
             //Turn LED OFF
             digitalWrite(13, LOW);
             //Reset Marker. We start waiting for the first part of the sequence again
             firstMsg=0;
          }
      }
}

Hi! I'm trying to do something very similar but I'm using a Teensy 3.2

I copied your code but it keeps giving me this error message:

Arduino: 1.6.11 (Mac OS X), TD: 1.30, Board: "Teensy 3.2 / 3.1, MIDI, 96 MHz optimize speed (overclock), US English"

hui_controller:15: error: expected constructor, destructor, or type conversion before ';' token MIDI_CREATE_DEFAULT_INSTANCE(); ^ Using library MIDI in folder: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/MIDI (legacy) expected constructor, destructor, or type conversion before ';' token

I was just wondering if there is a way to adapt this for the Teensy?

I copied your code but it keeps giving me this error message:

Well I have just tried compiling the code for a Teensy 3.2 and I got no error message at all. I suspect you haven't copied it correctly. I am using Arduino 1.8.4

I’m VERY new to Arduino and completely lost. My girlfriend made a “RECORDING” light for me for my birthday with a remote but I’d rather have it turn on and off when I press record in Pro Tools 12. I have an Arduino R3 Plus and a Sainsmart relay. I also have all of the components to make a MIDI circuit but would rather have this operate via MIDI USB. Could someone explain to me how to connect the Arduino to the relay and then what code to install? Also where would I connect the cable running from the light itself? Pretend you’re explaining it to a 5 year old. Lol. Thanks!

I am having a issue using HIDUINO. Pro Tools doesn't seem to send anything to my board. Did you change any configuration in PT? I can make it work sending raw MIDI CC Messages with MIDI-OX. Do you have any new code? Did you try using a MIDI Shield?

Thanks :)

I couldn’t get it to work so I threw in the towel. If you get it working though, PLEASE let me know!

I'm still pretty stupid at programming languages so won't be able to help you with coding. All I know is the code that was written by Mr. Grumpy Mike. I changed some values (all the changes are in the thread). Then (after testing it with midi shield) I turned my arduino to (I believe) Hiduino. After that arduino was plugged via USB and was recognized by computer as midi device. You have to configure your DAW. In Peripherals choose midi controller (hiduino). Under type choose HUI. After that PT will send midi data to your device. Just in case: the values in code correspond only to HUI protocol. It won't work with BABY HUI or Mackie (it's confusing but will work with MACKIE HUI in Cubase).

I got it working! Now, in Pro Tools 12, the pan faders are randomly changing for some reason. Almost as if there was automation on the track. It doesn't happen if I unplug the Arduino so it has something to do with that. Any idea what could be causing this?

UPDATE: This appears to be happening whenever I commit or render a track. It only seems to be affecting whatever the 6th track is on my edit window though. Very odd. Or is it?

gabermusic: I'm still pretty stupid at programming languages so won't be able to help you with coding. All I know is the code that was written by Mr. Grumpy Mike. I changed some values (all the changes are in the thread). Then (after testing it with midi shield) I turned my arduino to (I believe) Hiduino. After that arduino was plugged via USB and was recognized by computer as midi device. You have to configure your DAW. In Peripherals choose midi controller (hiduino). Under type choose HUI. After that PT will send midi data to your device. Just in case: the values in code correspond only to HUI protocol. It won't work with BABY HUI or Mackie (it's confusing but will work with MACKIE HUI in Cubase).

THANKS A LOT. It was this problem. Now it works perfectly. :)

Are you not having the issues with the pan fader shifting? If so, could you send me the exact sketch that you used? I’m so lost. Thanks!