At the moment im just using this code for testing :
/*
MIDI note player
This sketch shows how to use the serial transmit pin (pin 1) to send MIDI note data.
If this circuit is connected to a MIDI synth, it will play the notes
F#-0 (0x1E) to F#-5 (0x5A) in sequence.
The circuit:
- digital in 1 connected to MIDI jack pin 5
- MIDI jack pin 2 connected to ground
- MIDI jack pin 4 connected to +5V through 220 ohm resistor
- Attach a MIDI cable to the jack, then to a MIDI synth, and play music.
created 13 Jun 2006
modified 13 Aug 2012
by Tom Igoe
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Midi
*/
void setup() {
// Set MIDI baud rate:
Serial.begin(31250);
}
void loop() {
// play notes from F#-0 (0x1E) to F#-5 (0x5A):
for (int note = 0x1E; note < 0x5A; note ++) {
//Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
noteOn(0x90, note, 0x45);
delay(100);
//Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
noteOn(0x90, note, 0x00);
delay(100);
}
}
// plays a MIDI note. Doesn't check to see that cmd is greater than 127, or that
// data values are less than 127:
void noteOn(int cmd, int pitch, int velocity) {
Serial.write(cmd);
Serial.write(pitch);
Serial.write(velocity);
}
I built the circuit up like this, i tried it with the second 220 Ohm resistor between Digital Pin 1 (TX) and the socket too, didnt worked either. I sadly dont have a picture right now cause i just removed everything from the circuit.
So as i said i want to send Midi Notes to FL Studio or a other program. I tried both connecting the MIDI OUT or the MIDI IN from the USB Converter to the 5 PIN socket on the arduino but i havent used both at the same time. Im not sure yet wich one needs to be connected to the 5 PIN socket to send MIDI Messages from the arduino to the music program.
As the USB to MIDI Converter has IN and OUT i tought too i should connect both but i dont know really i havent tried that yet.
I just want to get it right... So with the MIDI OUT part of the usb converter i send data too the music program. With the MIDI IN part i recieve data with the arduino? As said i tried both ways didnt worked either.