Pro Tools Recording light

I’m very new to Arduino but have been doing a fair amount of research over the last few days. My girlfriend made me a remote controlled LED “RECORDING” sign for my studio. Using a remote would just be another worry on a long list of things to keep track of. I’d like to have the light turn on when I press record in Pro Tools. I’ve found a few codes but none seem to work. I’m not sure if I’m using the wrong sketches or if I have the Arduino and relay set up incorrectly. The Arduino that I purchased also has me pretty confused. I know that beggars can’t be choosers but I’d prefer keeping the setup USBmidi. Can anyone help this noob shine some light (pun intended) on the situation?

Can anyone help this noob shine some light (pun intended) on the situation?

Not a hope in hell, given ONLY the information you've provided so far. Which is ALL the information we have.

Re-read your post. Imagine some of the things that you'd need to explain to your grandmother. Like what the hell Pro Tools is, and how the Arduino would have a clue that you pressed some icon in some application running on some PC somewhere.

Like HOW the Arduino is connected to that computer.

Like what code the Arduino is running.

Like what pin(s) the sign is connected to, and what is actually between the pin(s) and the sign.

Haha. Touche. So Pro Tools is a DAW or Digital Audio Workstation (Software for recording music). I was originally trying to connect my Arduino, to my Mac Pro via MIDI to USB adapter but soon found that I could transfer MIDI data directly to the Arduino via USB so went that route. The light is connected to a Sainsmart 2 Relay Module which is then connected to the Arduino. It's to my understanding that the set up should be as follows:

Pin 13 to In #1 on the relay
GND to the GND on relay
5v to VCC on relay

I'm then using the Hairless MIDISerial application to run the USB input back into Pro Tools.

The code that I'm using is as follows:

#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;
}
}
}

Hope this provides some more insight on my current situation. The Arduino that I got is pretty confusing so I'll attach a picture. If you need any other info, let me know.

Thanks in advance!

The MIDI library uses the Serial port to receive data. That means that you can't use it to debug your program. That leaves you with 4 choices:

  1. Get a different Arduino, like the Leonardo, where pins 0 and 1 belong to the Serial1 instance, not Seriail.

  2. Get an FTDI cable, and use SoftwareSerial on the RX and TX pins that you choose (NOT pins 0 and 1) to connect the FTDI cable to. Then, you can open a different COM port and use something like RealTerm or PuTTY to get the serial data from the FTDI cable.

  3. Get an LCD and print to it.

  4. Debug by guesswork.

Option 4 is the cheapest, but the least likely to be successful.

Hello. Could you solve the problem? I am having the same issue as you but I am 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. Is there a new code?

Did you try using a MIDI Shield?

Thanks

I got it working but am having issues with the panning changing randomly. I hadn't actually flashed my Arduino properly but once I got Hiduino on there everything went (almost) smoothly. All I did was go to the MIDI setting in Peripherals, set it to HUI and then "arduino_midi" as the send and receive.

Hi,
Thanks the project ! :slight_smile:

Dear Diamondj421,
I built this protools recording light. This working almost perefectly. If i setup on protools HUI protocol receive from: arduino_midi and send to:arduino_midi, then some protools command, for example: Time stretch or Scrubb, trigger false PAN (panorama) some tracks.
I found a not nice solution: HUI: receive from:Avid003, port1 send to:arduino_midi
This setup work perfectly, but not too beautyful !
And i added some line to code, because i need a relay for domestic sound (in studio). If rec ready or rec on, relay breaks audio, and if rec off, wait 200ms and relay closed. Audio listening in studio during playback(REC NOT). This need for actor to try (or test).

Can i switch OFF the midi sends? and then i can using first HUI setup (receive and send arduino_midi)
Thanks and Regards
Laszlo

It is possible that I have the solution. Need a midi.turnThruOFF command in start void loop(), and now can i use HUI receive from:arduino_midi send to: arduino_midi.

it should work if i plug a led in pin 13 just for test if works?

Yes. Some (but not all) Arduino boards even have a built-in LED on pin 13.

Hello bedilaci and everybody,
How is your project working? I'm very interested in making a tally light for the record status of my protools. Does it work wlell? Can you shqre the code?
Best rgeards