Midi messages to lightboard?

I want to use arduino/MIDI to control the lightboard at my church. (eventually via tablet over ethernet but that's for later). I am using this library MIDI Library, For Communication With Musical Instruments

The commands the board wants are on page 211 of this manual. http://www.leprecon.com/productfiles/212085V3.2Manual.pdf

I'm assuming to transmit the example they use in the manual my code would be:
(excluding library setup code)

//System Reset 0xFF n/a 
MIDI.sendNoteOn(??, ??, 3);

//Set FADER_01 = 255 (100%) 0xB3 0x7F 0x00 0xB3 0x0D 0x7F 
MIDI.sendNoteOn(0x7F, 0x00, 3);
MIDI.sendNoteOn(0x0D, 0x7F, 3);

//Set FADER_02 = 128 (50%) 0xB3 0x0E 0x40 n/a 
MIDI.sendNoteOn(0x0E, 0x40, 3);

//Set FADER_BUMP_01 = ON 0xB3 0x7F 0x01 0xB3 0x03 0x7F 
MIDI.sendNoteOn(0x7F, 0x01, 3);
MIDI.sendNoteOn(0x03, 0x7F, 3);

//Set FADER_BUMP_01 = OFF 0xB3 0x03 0x00 n/a 
MIDI.sendNoteOn(0x03, 0x00, 3);

Would this be correct? And what does it want for reset?

Any help is appreciated
ematson5897

The first bye of a Note On message is 0x90 through 0x9F. Your lighting board wants 0xB3 so you need a Control Change message instead of Note On.

The 0B 7F xx messages are use to access the high-order bits for channels above 126 (0x7E).

You should have a function to sends values to channels:

void sendValue(unsigned channel, unsigned char value)
    {
    static unsigned char extendedBits = 0;

    if (channel/127 != extendedBits)
        {
        MIDI.controlChange(127, channel/127);
        extendedBits = channel/127;
        }

    if (channel > 126)
        channel = channel % 127;  // Modulo to strip off extended bits.

    MIDI.controlChange(channel, value);
    }

Note: I have no idea if the MIDI library implements a controlChange() method. If it doesn't you'll have to add it.

So my code would be

void sendValue(unsigned channel, unsigned char value)
    {
    static unsigned char extendedBits = 0;

    if (channel/127 != extendedBits)
        {
        MIDI.send(ControlChange, 127, channel/127, lightboardChannel);
        extendedBits = channel/127;
        }

    if (channel > 126)
        channel = channel % 127;  // Modulo to strip off extended bits.

    MIDI.send(ControlChange, channel, value,  lightboardChannel);
    }

We are getting some new moving heads and our worship pastor wants to unveil it with me sitting in the audience with my hp touchpad controlling lights lol

And then I can have other functions to do stuff like this

void setFader(int faderNumber, byte Value)
{
  if(faderNumber<25 || faderNumber>0)
  {
    sendValue(faderNumber + 12,  value)
  }
}

One last question, how do I send a system reset message?

Is there a MIDI.reset() method?

Yea. I will test all this on thursday when I go up to hook up stuff. Thanks for all of your help!

So yesterday I tried out this code:

#include <MIDI.h>


void setup() {

  MIDI.begin();            	
  Serial.begin(9600);
  MIDI.send(0xFF,255,255,1);   //reset board
}

void loop() {
  for(int w = 6; w<24; w++)
  {
    sendValue(w, 50);
    delay(1000);
    sendValue(w, 0);
    Serial.println(w,DEC);
  }
}



void sendValue(unsigned channel, unsigned char value)
    {
   
 static unsigned char extendedBits = 0;
    if (channel/127 != extendedBits)
        {
        MIDI.send(ControlChange, 127, channel/127, 1);
        extendedBits = channel/127;
        }

    if (channel > 126)
        channel = channel % 127;  // Modulo to strip off extended bits.

    MIDI.send(ControlChange, channel, value,  1);
    }

and it only worked on the first message sent. It also addressed the wrong channel, but that might be the boards issue. It isn’t freezing, because the numbers in the serial port continue to increment. The system reset also doesn’t work.

Any ideas?

It’s not clear what you intend to happen. Channels 6 through 12 are “PLAYBACK_01” through “PLAYBACK_06”, there is no channel 12, channel 13 through 36 are “FADER_01” through “FADER_24”. Perhaps you intended to use channels 13 through 36 instead of 6 through 24.

Oh Idk why the stop number was so high. I knew what it was supposed to do. I just want to know why it only worked with the first message and not the rest of them