Go Down

Topic: Arduino send MIDI to FL Studio over a MIDI to USB Converter Cable (Read 574 times) previous topic - next topic

Recovery

Hello everyone,

I am having a Problem at the moment i am trying to send Midi Notes to FL Studio via a MIDI to USB Converter Cable based on this Tutorial :
https://www.instructables.com/id/Send-and-Receive-MIDI-with-Arduino/

So i did everything like there with the MIDI to USB Cable but it just doesnt work. I tried everything out already? Is it possible to test if the cable is working? I did it like in the tutorial connecting those 220 Ohm Resistors to right pins and ground. But it just doesnt work !
Would be awesome if somebody could help me out!

slipstick

Have you built both MIDI Out and MIDI In circuits or just Out?

Show a clear photograph of what you have built including all the connections. That instructables thing is wrong, as they often are. There should be 2 x 220 Ohms resistors on the MIDI Out socket and neither of them are connected to ground.

And just to be clear you have connected your MIDI Out socket to the MIDI IN plug on the adaptor haven't you?

Also post the code you are using (copy your code from your IDE - don't just say it's like on the webpage).

It's easier to help if there's something to see.

Steve

Recovery

At the moment im just using this code for testing :
Code: [Select]
/*
  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.

slipstick

The naming conventions of MIDI take a little getting used to.

To send MIDI from Arduino you need a 5-pin MIDI OUT circuit (because the data is coming OUT of the Arduino). You then connect that to the MIDI IN on the USB adaptor (because you want the data to go IN to the computer). That's how it works.

How are you checking if it is working or not? If that code does anything it sends very short, fairly quiet notes.

Steve




Recovery

So i will later tomorrow build up the circuit again. I will try to connect everything right this time. Then im gonna try with FL Studio or a other music program i have, recieving those midi notes and i will set the velocity higher in the program.

I already have program wich is working fine with the Serial to PC but now i want to do the same thing with a raspberry pi thats why i want to get that USB to MIDI Converter to work. But yea i will try to do it tomorrow again.

And if i understood right the circuit with just those 2x 220 Ohm Resistors and the connection to Ground is enough to send data from the arduino to the program?

Recovery

So today i built up the circuit and plugged the cable this time right into the socket. Still nothing has worked, so i then i decided to open up the circuit of USB Converter cable cause i read in internet that some parts maybe miss in it or arent done right. I bought the cable off amazon for a really low price, and i just read more people had the problem that they cant send any midi messages but can see the driver on the PC. And as i just opend it up i have seen there are 5 connections on one side but one is missing kinda the Ground Cable is missing? Here a picture of it:

So i kinda guess its not working because of that? You can see on the left side of the circuit there is a nothing on the "G" Pin

Grumpy_Mike

Quote
So i kinda guess its not working because of that?
No that is fine. You do not need a ground to send data. The ground on the Arduino to the MIDI socket has a ground for a cable screen only. It is important that this screen is not connected to ground at both ends. That is why it is missing from that PCB.

This is normal and will not stop you sending data.

Use
Code: [Select]
noteOn(0x90, note, 0x7F);
in place of
Code: [Select]
noteOn(0x90, note, 0x45);
For maximum volume

Grumpy_Mike

Or you can use this code:-
Code: [Select]

/* Midi note fire - Mike Cook March 2012
 *
 * -----------------
 * send MIDI serial data, automatically for a test
 *
###############################################################################################

*/
// Arduino pin assignments
#define midiChannel (byte)0

// Start of code
void setup() {
 //  Setup serial
   Serial.begin(31250);    // MIDI speed

}

//********************* MAIN LOOP ***********************************

void loop() {
  int val;
  val = random(20,100);
    noteSend(0x90, val, 127); // note on
    delay(200);
    noteSend(0x80, val, 127); // note off
   delay(800);
    } // end loop function
   
//********************* Functions ***********************************


//  plays a MIDI note
 void noteSend(char cmd, char data1, char data2) {
  cmd = cmd | char(midiChannel);  // merge channel number
  Serial.write(cmd);
  Serial.write(data1);
  Serial.write(data2);
}


Recovery

I changed the velocity and what i should mention is that the LED for INPUT on the USB Cable wasnt right soldered so when i soldererd it good in, the LED started shining when i connected the MIDI IN to the Arduino. But it still doesnt play anything on the music program. I really dont know what to do at the moment anymore. Trying to get this to work almost for 2 weeks.

I will try it with your code.

Grumpy_Mike

Quote
But it still doesnt play anything on the music program.
Does the LED flash when you run my code? It should flash every time you send a MIDI message. If it does not you have wired up something wrong between the cable and the Arduino. If it does flash but no sound is heard then there is something wrong with your MIDI routing / assignments on your PC.

The most common problem is the swapping over of the two signal connectors on the socket. You are using a 5V Arduino arn't you?

Recovery

The LED doesnt flash its just beeing on the whole time, i can even remove TX from the 5 PIN Socket and it will still just stay on, only when i get the MIDI IN of the Cable out it goes out.
And yea im using a 5V Arduino


//Edit
I just tried using ur Program still doesnt work like it should

Grumpy_Mike

I think it is time you posted some photographs of your wiring.

Recovery

I just threw everything away and imma buy a new MIDI to USB Midi Converter Cable. If it then still doesnt work im gonna get back here. Cause i just read in the Amazon Reviews of the Cable that 5 guys had the same problem that no Midi Signals came trough. Im gonna give out some more money and hope it does work then.

Grumpy_Mike

Quote
Cause i just read in the Amazon Reviews of the Cable that 5 guys had the same problem that no Midi Signals came trough.
It is not a cable problem but thow money away if you want. See you when you get fed up of trying random stuff and are serious about fixing things.

Recovery

I just bought the new MIDI USB Converter Cable and everything is working fine now.
I still wanna thank you for your help!

Go Up