Midi Data not what im expecting

This is my first ever project. Im making a midi GO box.

It has 4 buttons which basically tell a piece of software (qLab) to GO, PANIC(stop), PREV and NEXT

As this is my first project, im learning as i go along but dont have any programming knowledge so its very much cut and paste from others codes.

Ive built the board, uploaded the code (below), Flashed the firmware (hiduino_master) and my MAC sees the board as a midi device, but it seems to be sending strange MIDI messages.

For instance: when i press button 1 (GO), midi monitor shows:


19:32:37.935 From arduino_midi Pitch Wheel 1 -8192
19:32:37.935 From arduino_midi Pitch Wheel 1 -4068
19:32:37.936 From arduino_midi Stop

Then on button release:


19:32:37.940 From arduino_midi Pitch Wheel 1 -8192

The coding calls for MIDI.sendNoteOn(60, 127, 1);

Now im at a loss as to how to move forward from here and was hoping some midi boffins might be about to assist.

The receiving software (qLab) is able to “learn” incoming midi and listens out for two bytes of data to be able to learn whats coming in, but its not getting anything from my button press, although it knows a button has been pressed because it defaults to whatever was there before.


Byte 1

Byte 2

The entire code is as follows (but please note i dont understand most of it yet):

#include <MIDI.h>


int buttonApin = 9; //footswitch A
int buttonBpin = 10; //footswitch B
int buttonCpin = 11; //footswitch C
int buttonDpin = 12;

void setup() {
// put your setup code here, to run once:
MIDI.begin (); // MIDI START

pinMode(buttonApin, INPUT_PULLUP);
pinMode(buttonBpin, INPUT_PULLUP);
pinMode(buttonCpin, INPUT_PULLUP);
pinMode(buttonDpin, INPUT_PULLUP);


void loop() {
// put your main code here, to run repeatedly:

static bool buttonAvalueOld = HIGH;
static bool buttonBvalueOld = HIGH;
static bool buttonCvalueOld = HIGH;
static bool buttonDvalueOld = HIGH;

bool buttonAvalueNew = digitalRead(buttonApin);
bool buttonBvalueNew = digitalRead(buttonBpin);
bool buttonCvalueNew = digitalRead(buttonCpin);
bool buttonDvalueNew = digitalRead(buttonDpin);

if (buttonAvalueNew != buttonAvalueOld){
if (buttonAvalueNew == HIGH){
MIDI.sendNoteOn(60, 127, 1);
//Serial.println(“Qlab GO Pressed”);
else {
MIDI.sendNoteOff(60, 0, 1);
//Serial.println(“Qlab GO Released”);
buttonAvalueOld = buttonAvalueNew;

if (buttonBvalueNew != buttonBvalueOld){
if (buttonBvalueNew == HIGH){
MIDI.sendNoteOn(64, 127, 1);
//Serial.println(“Qlab PANIC Pressed”);
else {
MIDI.sendNoteOff(64, 0, 1);
//Serial.println(“Qlab PANIC Released”);
buttonBvalueOld = buttonBvalueNew;

if (buttonCvalueNew != buttonCvalueOld){
if (buttonCvalueNew == HIGH){
MIDI.sendNoteOn(65, 127, 1);
//Serial.println(“Qlab PREV Pressed”);
else {
MIDI.sendNoteOff(65, 0, 1);
//Serial.println(“Qlab PREV Released”);
buttonCvalueOld = buttonCvalueNew;

if (buttonDvalueNew != buttonDvalueOld){
if (buttonDvalueNew == HIGH){
MIDI.sendNoteOn(67, 127, 1);
//Serial.println(“Qlab NEXT Pressed”);
else {
MIDI.sendNoteOff(67, 0, 1);
//Serial.println(“Qlab NEXT Released”);
buttonDvalueOld = buttonDvalueNew;


Try changing Serial.begin(9600) to the normal value for MIDI which is Serial.begin(31250).

What Arduino are you using and what MIDI connection have you built and where is it connected?