Arduino Forum

Using Arduino => Audio => Topic started by: gabermusic on Oct 13, 2016, 01:15 pm

Title: Pro Tools Rec Light
Post by: gabermusic on Oct 13, 2016, 01:15 pm
Hello!
I'm trying to make Pro Tools Rec Light. And I actually made it . But I have a strong desire that Pro Tools sends messages to Arduino through HUI protocol.

Ok.   
I have Arduino Uno. Midi shield. M-audio card with MIDI Out. First I thought that there should be Sysex data mess
but (how lucky I am) it sends Control Change messages.
So PT sends messages, Arduino gets them, the Lights are ON/Off.

That's the code:
Code: [Select]
#include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();

       void setup()
{
 pinMode(13,OUTPUT);
  MIDI.begin();
  MIDI.setHandleControlChange(MyCC);
 
}
       void loop() {
 
       
MIDI.read();
 
 }

void MyCC(byte channel, byte controller, byte value ) {

   
  if(channel==1)

 if(controller==44)

 if(value==69)

 digitalWrite(13,HIGH);

 if(channel==1)

 if(controller==44)

 if(value==5) 
 
  digitalWrite(13,LOW);
 

 }
 





Everything is perfect! Except one small thing: when I press alt/opt button ....Rec lights are also ON!
With the help of Midi Monitor I've learned that this cunning HUI sends at least two messages for all the buttons.

So : to turn the REC On PT sends

1) channel 1,  controller 12, value 14
2) channel 1,  controller 44, value 69

to turn the REC Off

1) channel 1,  controller 12, value 14
2) channel 1,  controller 44, value 5


I've got theory: first message is some kind of a name of a button and the second one is the command itself.


And ALT/OPT button (by the way I hate it for now))) sends:
1) channel 1,  controller 12, value 8
2) channel 1,  controller 44, value 69


And here is the point: I'm a beginner with Arduino and I can't figure out how I can make the board react on two messages and  interpret them as one.


Please help.
Thank you! And sorry for my English it's not a native language for me.




Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 13, 2016, 01:54 pm
Quote
I've got theory: first message is some kind of a name of a button and the second one is the command itself.
Officially
CC 12 is Effect Control 1
CC 44 is LSB for Control 12 (Effect control 1)

So one way to do this would have each CC message set the appropriate part of the number then combine them like this.
Code: [Select]
effectsController = (ccMessage1Value << 7) | ( ccMessage44Value & 0x7F);
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 13, 2016, 06:07 pm
Thank you!
I'll try to fight this through))
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 13, 2016, 06:29 pm
I vaguely understand  but I work on it. One question before I take a deep dive into it:
Code: [Select]
effectsController = (ccMessage1Value << 7) | ( ccMessage44Value & 0x7F);  - all the the values are just examples? I'm a bit confused with 0x7F (since PT doesn't send value 127, at least connected with Rec button). Sorry to bother.
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 13, 2016, 11:05 pm
Quote
I'm a bit confused with 0x7F
This value is a bit mask, it ensures that the value you are adding to the number is restricted to the range 0 to 127. It should already be in this range but just to make sure it does no harm to force it not to overflow.

Quote
all the the values are just examples?
Not sure what you mean by values? Do you mean variables? If so yes the variables have names that illustrate what sort of value they hold. It is a good idea to write your code like this so you know what sort of values these variables will contain.
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 14, 2016, 10:12 pm
I'm sorry I'm too slow at programming languages. ))
I went to the reference and read about <<, | and &. It helped a bit but not too much.

oook. I understand that I 've got a lot of questions but:
Am I right considering this:  
Code: [Select]
effectsController = (ccMessage1Value << 7) | ( ccMessage44Value & 0x7F); - as a math expression? And if yes  should I get a resulting numeric value?  And again if yes, what is the numeric value of this expression?   

If we consider that:
ccMessage1Value =14
ccMessage44Value=69

Will it be correct to write it down like this:

Code: [Select]
effectsController = (14 << 7) | ( 69 & 0x7F); ?

Thank you!
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 14, 2016, 11:45 pm
Quote
Am I right considering this:  
Code: [Select]

effectsController = (ccMessage1Value << 7) | ( ccMessage44Value & 0x7F);

- as a math expression?
Not quite it is a program statement. If it were maths the = would mean "is equal to" but as a program statement the = means "make it equal to"

Quote
If we consider that:
ccMessage1Value =14
ccMessage44Value=69

Will it be correct to write it down like this:......
Yes.

So what will the value of the variable effectsController be?

Basically you are making one number from two part numbers. The one number has 14 bits and the two part numbers have 7 bits each.

(http://forum.arduino.cc/index.php?action=dlattach;topic=429241.0;attach=183884)
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 15, 2016, 09:45 pm
Thank you! Now I got it!  It's beautiful.

And of course the coding. It took me pretty long but I'm not sure if I used the idea correctly:
Code: [Select]
#include <MIDI.h>

byte ExpressionContr1;
byte ExpressionContr2;
byte ExpressionContr3;

MIDI_CREATE_DEFAULT_INSTANCE();

     void setup()
{
pinMode(13,OUTPUT);
MIDI.begin();
MIDI.setHandleControlChange(MyCC);

}
     void loop() {
 
MIDI.read();
}

void MyCC( byte channel, byte controller, byte value ) {

if (ExpressionContr1=(channel==1<<7)|(channel==1&15 ))
if (ExpressionContr2=(controller==0xC <<7) | (controller==0x2C&0x7F ))
if (ExpressionContr3=(value ==0xE <<7) | (value ==0x45&0x7F ))

digitalWrite(13,HIGH);

if (ExpressionContr1=(channel==1<<7)|(channel==1&15 ))
if (ExpressionContr2=(controller==0xC <<7) | (controller==0x2C&0x7F ))
if (ExpressionContr3=(value ==0xE <<7) | (value ==0x5&0x7F ))
digitalWrite(13,LOW);

}


Since it still works as before (i.e. alt/opt also turns the lights on) something is wrong. May be I shouldn't declare "ExpressionContrs" as bytes?
Thank you!
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 15, 2016, 11:13 pm
Quote
May be I shouldn't declare "ExpressionContrs" as bytes?
That's right.

As the variables ExpressionContr are trying to hold a 14 bit number then bytes will not be big enough. While the value variables can be bytes ( a byte is 8 bits ) when you combine the two you need a type of variable with more bits. Use a int type variable, this will hold a maximum of 16 bits. The fact you only need 14 of them is not important because an int is the smallest variable type that will fit your number.
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 16, 2016, 04:15 am
I changed  "bytes" to "ints" but "alt/opt" still lights the Led. I suppose that there is something wrong with my "if" statements. Somehow the board can't differ the messages.

Code: [Select]
#include <MIDI.h>

int ExpressionContr1;
int ExpressionContr2;
int ExpressionContr3;

MIDI_CREATE_DEFAULT_INSTANCE();

    void setup()
{
pinMode(13,OUTPUT);
MIDI.begin();
MIDI.setHandleControlChange(MyCC);

}
    void loop() {

MIDI.read();
}

void MyCC( byte channel, byte controller, byte value ) {

if (ExpressionContr1=(channel==1<<7)|(channel==1 & 15 ))
if (ExpressionContr2=(controller==0xC <<7) | (controller==0x2C & 0x7F ))
if (ExpressionContr3=(value ==0xE <<7) | (value ==0x45 & 0x7F ))

digitalWrite(13,HIGH);

if (ExpressionContr1=(channel==1<<7)|(channel==1 & 15 ))
if (ExpressionContr2=(controller==0xC <<7) | (controller==0x2C & 0x7F ))
if (ExpressionContr3=(value ==0xE <<7) | (value ==0x5 & 0x7F ))
digitalWrite(13,LOW);

}
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 16, 2016, 05:41 am
Yes they are all wrong. First off you need a double equal sign in them to compare anything. But the big mistake is that you first fill your Expression control variable with a value you device from the MIDI messages and then you test it with an if statement to see if it is the number you are looking for.
When you find that it is that number then you do something about it like controlling your LED. The if statement when true will execute the statement following or the block following defined in curly braces.

You need to post all the code you have not just a part as I suspect more of it is totally wrong like this.
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 16, 2016, 05:01 pm
You need to post all the code you have not just a part as I suspect more of it is totally wrong like this.
That is all code I've got. I just want to make this rec light to shine and nothing more. :)



First off you need a double equal sign in them to compare anything. But the big mistake is that you first fill your Expression control variable with a value you device from the MIDI messages and then you test it with an if statement to see if it is the number you are looking for.
When you find that it is that number then you do something about it like controlling your LED. The if statement when true will execute the statement following or the block following defined in curly braces.
I changed the code a bit and again I'm not sure I did it correctly:
Code: [Select]
#include <MIDI.h>

int ExpressionContr1 = 1;
int ExpressionContr2 = (0xC, 0x2C) ;
int ExpressionContr3 = (0xE ,0x45) ;
int ExpressionContr4 = (0xE,0x5);
MIDI_CREATE_DEFAULT_INSTANCE();

     void setup()
{
pinMode(13,OUTPUT);
MIDI.begin();
MIDI.setHandleControlChange(MyCC);

}
     void loop() {
 
MIDI.read();
}

void MyCC( byte channel, byte controller, byte value ) {
 

if (ExpressionContr1==(channel==1<<7)|(channel==1 & 15 ))
if (ExpressionContr2==(controller==0xC <<7) | (controller==0x2C & 0x7F ))
if (ExpressionContr3==(value ==0xE <<7) | (value ==0x45 & 0x7F ))

digitalWrite(13,HIGH);

if (ExpressionContr1==(channel==1<<7)|(channel==1 & 15 ))
if (ExpressionContr2==(controller==0xC <<7) | (controller==0x2C & 0x7F ))
if (ExpressionContr4==(value ==0xE <<7) | (value ==0x5 ))
digitalWrite(13,LOW);

}


But something is still wrong.
Tried different ways to write the variables:
Code: [Select]
int ExpressionContr2 = 0xC| 0x2C ;

Code: [Select]
int ExpressionContr2 = (0xC)| (0x2C) ;
Alt/opt still disturbs.


I experimented with the  code: when I change the placements of notes ("reversed sequence") alt/opt is out of the game, but now the "play" button turns the light on(for a short time). Argh!
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 16, 2016, 05:59 pm
OK that code it totally screwed in many many ways.
This is something on the right track. I have not tested it but it does compile. See if you can understand what it is doing. The "magic numbers" might not be right.

Code: [Select]

#include <MIDI.h>
// I assume these are the right magic numbers
int ExpressionContr1 = 1;
int ExpressionContr2 = (0xC << 7) | 0x2C ;
int ExpressionContr3 = (0xE<< 7) | 0x45 ;
int ExpressionContr4 = (0xE<<7) | 0x5;
int controlRecieved;
byte ccMessage12Value;
byte ccMessage44Value;
boolean ledState;

MIDI_CREATE_DEFAULT_INSTANCE();

void setup(){
pinMode(13,OUTPUT);
MIDI.begin();
MIDI.setHandleControlChange(MyCC);
}

void loop() {
MIDI.read();
}

void MyCC( byte channel, byte controller, byte value ) {
 // build up your full message
  if(controller == 44){
  ccMessage44Value = value;
  ccMessage12Value = 0; // blank MSB of message to stop rapid on / off of LEDs
 }

 if(controller == 12){
  ccMessage12Value = value;

// now put them together into one variable
controlRecieved = (ccMessage12Value << 7) | ( ccMessage44Value & 0x7F);
// now see if you have anything of intrest
// here you seem to test the same thing to turn it on or off so you need a variable to hold the state you last put the LED
if( (ledState == false) && (controlRecieved == ExpressionContr1 || controlRecieved == ExpressionContr2 ||controlRecieved == ExpressionContr3) ){
      digitalWrite(13,HIGH);
      ledState = true;
    } else {
if( (ledState == true) && (controlRecieved == ExpressionContr1 || controlRecieved == ExpressionContr2 ||controlRecieved == ExpressionContr4) ){
      digitalWrite(13,LOW);
      ledState = false;
     }
    }
  }
}


Please come back with questions about it.
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 16, 2016, 06:40 pm
If I could I would hug you!
Thank you million times for your patience and knowledge.
For these three days I've learned much more than for the last 6 months.
It works!   :)

Looking at the code it seems easy and everything is clear now. But I understand that it would take me a year or two (or may be never) to write it!

Thank you!
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 16, 2016, 08:32 pm
If I'm right this code will work with any DAW. Will check it tomorrow with Cubase and will post here. ))
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 16, 2016, 09:08 pm
I have just edited the code in reply #12. I just realised that when receiving the LSB in CC 44 it would use the last version of what was in the MSB from CC 12. This could result in a rapid on / off of the LED due to a false message being generated. Therefore I wiped out the old number in ccMessage12Value when ever CC 44 arrived.

There may well be other wrinkles like that, as I said I have no hardware to try this on.

Quote
If I'm right this code will work with any DAW.
Yes if it sends the same numbers.
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 17, 2016, 09:34 am
I have just edited the code in reply #12.
There is a problem with new edition since the "ARM TRACK" button sends 12 CC message with value 0. So when the tack is armed everything is messed up )).
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 17, 2016, 09:48 am
Sorry I am not understanding you. What do you mean by 12 CC messages?
Is this
A CC message for controller 12? Or
Twelve messages of the CC type?

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

I know you did this in the first post but it looks like things have changed.
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 17, 2016, 10:15 am
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))

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.


Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 17, 2016, 10:30 am
Still not sure about the problem but try changing
Code: [Select]
ccMessage12Value = 0;
To
Code: [Select]
ccMessage12Value = -1;
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 17, 2016, 11:54 am
-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)))

Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 17, 2016, 03:45 pm
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.
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 17, 2016, 06:53 pm
Yes, I saw these docs and also I read the results of "reversed engineering (http://forum.cockos.com/showthread.php?t=101328)" . 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.   
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Oct 17, 2016, 09:05 pm
I decided to get rid of midi shield and changed the firmware. Now it is Hiduino. The program still works.   :)
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Nov 02, 2016, 06:13 pm
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 (https://youtu.be/V3bd5C1B7Xk) (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:
Code: [Select]
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!
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Nov 02, 2016, 11:49 pm
Quote
Fixed it!!! removing any info concerning channel byte. Now it works as should
Well done.  :)

Thanks for the update.
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Nov 18, 2016, 08:22 pm
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
Code: [Select]
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:
Code: [Select]
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! :)
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Nov 18, 2016, 08:38 pm
Quote
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.  :)
Title: Re: Pro Tools Rec Light
Post by: FLIKI on Sep 10, 2017, 09:36 pm
Hi, after a week of fooling around with my first project...
Here is my code:

Code: [Select]


#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;
          }
      }
}
Title: Re: Pro Tools Rec Light
Post by: dajaun on Oct 30, 2017, 12:52 am
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?
Title: Re: Pro Tools Rec Light
Post by: Grumpy_Mike on Oct 30, 2017, 01:02 pm
Quote
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
Title: Re: Pro Tools Rec Light
Post by: Diamondj421 on Apr 08, 2018, 03:16 am
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!
Title: Re: Pro Tools Rec Light
Post by: Rockmaclu on Jul 19, 2018, 09:40 pm
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 :)
Title: Re: Pro Tools Rec Light
Post by: Diamondj421 on Jul 19, 2018, 09:53 pm
I couldn't get it to work so I threw in the towel. If you get it working though, PLEASE let me know!
Title: Re: Pro Tools Rec Light
Post by: gabermusic on Jul 19, 2018, 10:37 pm
 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).
Title: Re: Pro Tools Rec Light
Post by: Diamondj421 on Jul 29, 2018, 06:07 am
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?
Title: Re: Pro Tools Rec Light
Post by: Rockmaclu on Jul 30, 2018, 09:57 pm
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. :)
Title: Re: Pro Tools Rec Light
Post by: Diamondj421 on Aug 01, 2018, 11:05 am
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!
Title: Re: Pro Tools Rec Light
Post by: Ronerone on Mar 24, 2019, 02:27 am
Hi @gabermusic
i just received my first arduino board and i'm trying to get it work with your code.
I also tried @FLIKI's code, but with no success.
My first attempts were done with some serial to midi bridge and looper as a virtual midi interface, with no success. I could see CC msg from protools but no light!
Then, i flashed (hard to figure out how to do when you're a beginner :) ) with hiduino and could finally understand i would have to switch from both firmwares (HIDUINO and original one) to upload code and test it alternatively.
So, at to moment, i can't manage to light the onboard led (i believe it should light up and then, when validated, i would use i3 pin to drive a relay, or even an external LED... is this the case?).
So, could you post your final code?
I thank you in advance.
Ron.
Title: Re: Pro Tools Rec Light
Post by: Ronerone on Mar 25, 2019, 12:00 am
Ahah, FLIKI's code repasted, and it seems to work :) Hell yeah!
Now i have to build the hardware part.
Title: Re: Pro Tools Rec Light
Post by: Ronerone on Oct 04, 2019, 04:47 pm
Argh, trying to adapt for Studio One (which i'm not able at the moment), i figured out there was an issue in FLIKI's code, at three location if i remember well:

"  if((channel==1)&&(controller=12)&&(value==14))"

-> controler is set, not tested.

Injecting MIDI values from Pocket midi seems not to react positively after correcting, i'm a bit disappointed and have to test further more.
Title: Re: Pro Tools Rec Light
Post by: Ronerone on Oct 04, 2019, 05:42 pm
Finally working punctually in the evenings is not a good method.
I corrected this little mistake and tried it in pro Tools: that still works, so my mistake is probably in Pocket Midi usage.
Regarding Studio One, i hadn't tried the mackie HUI controller, only mackie control (which made no sense).
Using mackie HUI - for which these midi codes fit well - allows one to use this light in any daw handling the HUI controller.