Protools or DAW to HUD MIDI

Hello I was trying to get a hold of the codes or help with the way protools midi or logic output to an IDE for Arduino that makes a light. This has been discussed before but it's not really understood from the set up on other DAWs to what to add to arduino in an easy fashion. Can anyone help? I can pay for time or code, because I always wanted to make a recording light.

Example here: Pro Tools Rec Light - #21 by gabermusic

It's easy enough for an Arduino Micro to act as a MIDI device, any of the incoming signals can be used to get the Arduino to do whatever really.

in theory yes and i know but my issue is i have no coding skills and i saw online people doing it and i read the other post but only felt more confused… i want to do this with a RF device that just has the ide for “getting midi data” “sending to transmitter” “transmitter sends an on or off to receiver” “receiver uses a relay to turn off and on light” thats it… can anyone help me with this i

Not sure what you mean by an IDE, but are you trying to decode a a MIDI message on an arduino, send a signal to an RF device that then signals a remotely-controlled light?

If I got all that (besides the IDE part!), which MIDI message do you need to decode?

well I assume IDE is just the simple code on arduino or any device that can accept the information that processes another mechanical thing. Well ok protools has an HUD and so does logic I think (Mackie) when I hit record, I want the light to be on, when stop or playback then the light is off. I know there is already documentation on this topic, the fact is there is no easy way to figure out how to do it with an RF controller and I don't know how to compile code to listen for whatever protools or any DAW puts out and have that translate to on or off for a RF (radio frequency) controller

IDE is an abbreviation for Integrated Development Environment.

This should do the trick:

#include <Control_Surface.h> // https://github.com/tttapa/Control-Surface

USBMIDI_Interface midi;
NoteLED led {LED_BUILTIN, MCU::RECORD};

void setup() { Control_Surface.begin(); }
void loop() { Control_Surface.loop(); }

See Control Surface: 1.Note-LED.ino and Control Surface: MCU MIDI Note controls for details.

thank you so much for responding but which device is this for? arduino nano or a simple nRF24L01+,HC-12,RFM69? my DAW needs to have a midi track or setting up the HUD or external controller? sorry for my ignorance on the topic i just am more a sound designer and only built one arduino in the past

Any Arduino board with MIDI over USB support: Control Surface: MIDI over USB

These are not general-purpose microcontrollers (and not simple either).

setting up the HUD or external controller?

You'll need to configure the Arduino as a Mackie Control Universal or similar in your DAW.

Thanks so much but I found GitHub - arduino-libraries/MIDIUSB: A MIDI library over USB, based on PluggableUSB is this possible to have it recognize a nano for example as a MIDI and send the recording enable on and off to it? If yes how would it be coded? Lastly Mackie Control Universal is like MIDI learn? If so how would I do that in the nano to receive it?

Since protools uses HUI is there a way the script can accept MCU: : and HUI : : ?

No, this is not possible. The Nano's hardware does not support MIDI over USB.
(And in fact, the Control Surface library will use the MIDIUSB library on platforms that support it.)

No, the Mackie Control Universal is a well-known commercial control surface whose protocol is supported by most DAWs.

No, because they use completely different protocols. If you want to use the HUI protocol, you'll need to keep track of the selected zone, which involves listening to multiple MIDI messages for a single LED On/Off message. See the documents linked in Arduino interaction with DAW - #5 by PieterP for details about these messages. You can still use the Control Surface library to receive the MIDI messages, but you'll need some more logic around it.

Thanks again for your message and reply. I hate that I'm a newbie, I tried to hire someone but it seems they have no idea about the complexities of HUI and MCU for minimal setup by me or my friends I give it to. That's the hard part is finding a clear and concise solution or way to have an installer that compiles everything easily. Or a simple change in protools or Cubase for example. I will read your link as soon as im home

does this Mackie from hui have any merit ?

No that won't help, because it assumes that the connected device mode has a HUI compatibility mode (which you would have to implement yourself in the Arduino code).

Here's a proof of concept:

#include <Control_Surface.h>

const auto record_led_pin = LED_BUILTIN;

// The MIDI over USB interface to use
USBMIDI_Interface midi;

// Custom MIDI callback that keeps track of the selected HUI zone.
struct MyMIDI_Callbacks : FineGrainedMIDI_Callbacks<MyMIDI_Callbacks> {
  static constexpr uint8_t zone_select_command = 0x0C; // Taken from HUI.pdf (https://forum.cockos.com/showthread.php?t=101328)
  static constexpr uint8_t switch_port_command = 0x2C;
  static constexpr uint8_t record_zone = 0x0e;
  static constexpr uint8_t record_port = 5;
  uint8_t zone = 0xFF;

  // Function that is called whenever a MIDI Control Change message is received.
  void onControlChange(Channel channel, uint8_t controller, uint8_t value, Cable) {
    if (channel != Channel_1)
      return;
    if (controller == zone_select_command) {
      zone = value;
    } else if (controller == switch_port_command) {
      uint8_t port = value & 0x0F;
      bool led_state = value & 0x40;
      if (zone == record_zone && port == record_port)
        digitalWrite(record_led_pin, led_state ? HIGH : LOW);
    }
  }

} callback;

void setup() {
  pinMode(record_led_pin, OUTPUT);
  midi.begin();                // Initialize the MIDI interface
  midi.setCallbacks(callback); // Attach the custom callback
}

void loop() {
  midi.update(); // Continuously handle MIDI input
}

(Untested.)

I really appreciate your time. I was thinking what is the difference between these generic control surfaces (like the Presonus Fader Port) with record functionality working out of the box (maybe they have an installer or quick setup) and what we can do with the arduino. The presonus was kind of just plug and play if I remember.

Is this the right hardware to compile the code on? https://www.aliexpress.com/item/1005006190765971.html?spm=a2g0o.order_detail.order_detail_item.4.4c216d76TUDD72

Thanks again

As soon as I get my arduino I will try and add this code and open protools and see what happens... will the output be a voltage change on a pin? Thanks

Do you have any thoughts on the code?

The good news is that the Arduino can do basically anything these commercial control surfaces can do. The bad news is that you have to implement this yourself, and the manufacturers of commercial control surfaces do not publish details about their APIs, protocols and handshakes. DAW developers and control surface manufacturers share these details privately, so they can work together out-of-the-box. As a hobbyist, you're out of luck, and you won't get the same special treatment as Mackie or Presonus, and you'll have to rely on reverse-engineering, or on the (often limited) MIDI scripting functionality of the DAW.

That should work.

It will turn on the on-board LED of the Arduino when a recording is started in the DAW. (But you'll first have to select the Arduino as HUI in your DAW.)

I have been told I should listen for each DAWs midi signal for record on or off with this:

#include <MIDIUSB.h>

const int ledPin = 13; // Built-in LED on most Arduino boards

void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
}

void loop() {
midiEventPacket_t rx;
do {
rx = MidiUSB.read();
if (rx.header != 0) {
processMIDI(rx);
}
} while (rx.header != 0);
}

void processMIDI(midiEventPacket_t packet) {
// Check for Note On messages (many DAWs use these for transport control)
if (packet.header == 0x09) {
byte note = packet.byte2;
byte velocity = packet.byte3;

// Example: Note 60 (middle C) for record start/stop
if (note == 60) {
  if (velocity > 0) {
    digitalWrite(ledPin, HIGH);
    Serial.println("Recording started");
  } else {
    digitalWrite(ledPin, LOW);
    Serial.println("Recording stopped");
  }
}

}

// Check for Control Change messages
if (packet.header == 0x0B) {
byte control = packet.byte2;
byte value = packet.byte3;

// Example: CC 42 for record on/off in some DAWs
if (control == 42) {
  if (value > 64) {
    digitalWrite(ledPin, HIGH);
    Serial.println("Recording started (CC)");
  } else {
    digitalWrite(ledPin, LOW);
    Serial.println("Recording stopped (CC)");
  }
}

}
}