Go Down

Topic: MIDI input of endless FF  (Read 16 times) previous topic - next topic

glocka

May 06, 2015, 11:13 pm Last Edit: Today at 12:02 am by glocka
I'm trying to get incoming MIDI CC messages via serial, and transmit them out of another.

I have some devilishly simple code that isn't performing at all.

Code: [Select]


byte data;


void setup() {
  Serial1.begin(31250);
  Serial2.begin(31250);
}

void checkMIDI() {
  if (Serial1.available() > 0) {
   data = Serial1.read();
    if (data == 176) {
Serial2.write(Serial1.read());
    }
    }
  }



void loop() {
  checkMIDI();
}


When I check MIDI monitor connected to Serial2, the only readings I get are FF over and over again when I change a MIDI CC value.

I would expect to get 45 - or the hex value - as I am tweaking cutoff, followed by the value.

The significance of 176 is the first byte of a message containing MIDI CC on channel 1.

Thanks for your help in this deep confusion...

EDIT:

Synth attached is outputting MIDI clock pulses... I can see this if I pass through all MIDI info... It hits me with F8, which is a MIDI clock pulse.

glocka

It seems like something is interfering with MIDI, as even the simple code below causes an endless stream of FF:

void setup() {
  Serial3.begin(31250);
  Serial2.begin(31250);
}



void loop() {
Serial2.write(Serial3.read());
    }

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy