Hello everyone,
i've been messing around with MIDI for quite a few weeks now and everything works perfectly. I built a tiny keyboard with 22 keys and 2 pots, also an LCD screen for debugging and effects. On the side there's a midi-out socket and the USB to program my Mega 2560. I also successfully flashed the 8u2 with some midi firmware to try to make it an HID midi device and that worked too.
The one pot sends modulation data and the other should be used for volume control. Everything works perfectly, even the modulation pot is working fine. For your info, i'm not using the USB firmware but the original, using a Steinberg Midex 3 to convert the midi data to usb. Then using FM8 to play/test. The problem is, both pots are working fine, sending correct data 0-1023 range to arduino, But the volume control change data sent through the midi is (maybe) messed up.
I use this code to send the modulation data (midi channel 1):
Serial1.write(176); // Control change (channel1)
Serial1.write(1); // Volume command
Serial1.write(newModVal); // Volume 0-127
(after some threshold and mapping stuff)
and this code for the volume data.
Serial1.write(176); // Control change (channel1)
Serial1.write(7); // Volume command
Serial1.write(volMapped & 0x7F); // Volume 0-127
i've tried both (volMapped & 0x7F) or just (volMapped) for the last line but it acts the same.
my Midex3 only seems to show midi-in activity when the volume pot is around 85%.
Does anyone know what might be happening?
Thank you for your time!