*SOLVED* MIDI IN to serial results in an endless stream of FF values


i'm trying incoming midi cc messages via serial, , transmit them out of another.

i have devilishly simple code isn't performing @ 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 check midi monitor connected serial2, readings ff on , on again when change midi cc value.

i expect 45 - or hex value - tweaking cutoff, followed value.

the significance of 176 first byte of message containing midi cc on channel 1.

thanks in deep confusion...

edit:

synth attached outputting midi clock pulses... can see if pass through midi info... hits me f8, midi clock pulse.

it seems interfering midi, simple code below causes endless stream of ff:

void setup() {
 serial3.begin(31250);
 serial2.begin(31250);
}
void loop() {
serial2.write(serial3.read());
   }

solved. ignored 0xb0 bytes.


Arduino Forum > Using Arduino > Audio > *SOLVED* MIDI IN to serial results in an endless stream of FF values


arduino

Comments