Thanks for your answer. Sure I forgot the code ... it happens also with this small piece:
#include <MIDI.h>
int poti=0;
int last=0;
void setup() {
MIDI.begin(); // Launch MIDI with default options
}
void loop() {
poti=analogRead(0);
if(abs(poti-last)>2){
MIDI.sendControlChange(101,poti/8,1); //Controller#, Wert, Kanal
last = poti;
}
}
When I program the same with the Serial library, as I said, everything seems fine. The code:
int poti=0;
int last =0;
void setup() {
Serial.begin(31250);
}
void loop() {
poti=analogRead(0);
if(abs(poti-last)>2){
midi(0xB0, 101, poti/8); //Midi-Typ (B=ControllerChange) + Kanal (0=1), Controller#, ControllerWert - Division durch 8: Skalierung auf Midi
last = poti;
}
}
void midi(int cmd, int pitch, int velocity) {
Serial.write(cmd);
Serial.write(pitch);
Serial.write(velocity);
}
Monitored it with MidiOx while resetting / powering the Arduino:
Serial library:
00001047 8 -- B0 65 7F 1 --- CC: RPN MSB
Midi library:
0001C4C8 8 -- B0 65 7F 1 --- CC: RPN MSB
...Sends the current value, only differs in the timestamp.
Greets