setup : board : Arduino UNO, OS : linux POP Os, Daw : Reaper
Hi People,
I am a little confuse with some midi library and arduino.
I try some libraries and some example, the one that seems made for my setup is "UHS2-MIDI", i tried some example code, in reaper, I see "midi through" as midi device but my arduino board receive nothing from the daw and the daw receive nothing from the arduino board.
If i try with my casio midi keyboard (connected to the pc via usb) I can send and receive notes to the daw without any issues. And if i look in the QjackCtl graph, "midi-through" is connected to reaper the same way my casio keyboard is connected.
the code that i use :
#include <UHS2-MIDI.h>
// Simple tutorial on how to receive and send MIDI messages.
// Here, when receiving any message on channel 4, the Arduino
// will blink a led and play back a note for 1 second.
USB Usb;
UHS2MIDI_CREATE_DEFAULT_INSTANCE(&Usb);
int a = 0;
String test = "";
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
MIDI.begin(4); // Launch MIDI and listen to channel 4
if (Usb.Init() == -1) {
while (1); //halt
}//if (Usb.Init() == -1...
delay( 200 );
Serial.begin(115200);
Serial.println(Usb.getUsbTaskState());
}
void loop()
{
Usb.Task();
//digitalWrite(LED_BUILTIN, HIGH);
MIDI.sendNoteOn(42, 127, 1); // Send a Note (pitch 42, velo 127 on channel 1)
delay(100); // Wait for a second
MIDI.sendNoteOff(42, 0, 1); // Stop the note
//digitalWrite(LED_BUILTIN, LOW);
delay(100);
//Serial.println(MIDI.read());
if (MIDI.read()) // If we have received a message
{
Serial.println("midiread");
digitalWrite(LED_BUILTIN, HIGH);
MIDI.sendNoteOn(42, 127, 1); // Send a Note (pitch 42, velo 127 on channel 1)
delay(100); // Wait for a second
MIDI.sendNoteOff(42, 0, 1); // Stop the note
digitalWrite(LED_BUILTIN, LOW);
}
}
I have to install something more to make it run ? I use the wrong library, It is not possible to use arduino as a midi device?
My goal is to pilot some modular synth with my daw and i want to use the arduino as interface between my daw and the modular synth.
Thanks a lot.