I have created a simple push button that should send out a simple SysEx command that I know is right but when it sends it, it also sends a load of other nonsense with it not just the SysEx I'm trying to send.
So basically I'm just trying to clear up my output so its only the SysEx signal being sent.
This is my code.
#include <MIDI_Controller.h>
#include <MIDI.h>
#define BUTTON 2
byte MIDI_CHANNEL = 1;
int currentstatus = LOW; //Variable. Is the key currently pressed?
int noteisplaying = 0; //Variable. Is the Note currently playing?
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() //The Setup Loop
{
Serial.begin(31250); //Buad rate of midi
MIDI.begin(MIDI_CHANNEL); //initialise midi library
digitalWrite(BUTTON, HIGH); //Light up led when button pressed
}
//---------------------------------------------
void loop() //the main loop
{
int keyispressed = digitalRead(BUTTON); //read pin 2
if (keyispressed != currentstatus) { //state has changed
currentstatus = keyispressed;
if (currentstatus == LOW) { // Button is now pressed
// Sub 90 @ 100
byte message[] = { 0xf0, 0x7F, 0x01, 0x02, 0x01, 0x06, 0x5A, 0x00, 0x64, 0x00, 0xf7 };
MIDI.sendSysEx(message, sizeof(message));
} else { // Button is now released
//Sub 90 @ 0
byte message[] = { 0xF0, 0x7F, 0x01, 0x02, 0x01, 0x06, 0x5A, 0x00, 0x00, 0x00, 0xF7 };
MIDI.sendSysEx(message, sizeof(message));
}
}
}
And this produces this output.
As you can see it does produce the right line of code but it looks like it goes through every other command first which can't happen. I need it to be a single clean line outputted.
Any assistance would be great, thank you!

