Go Down

Topic: works: MIDI-IN: code + schematics (Read 51645 times) previous topic - next topic

tep

#90
Sep 16, 2009, 06:33 pm Last Edit: Sep 16, 2009, 06:35 pm by tep Reason: 1
I believe it's the same you can find eveywhere, not very minimalist...
Look at this one :

joanvallve

thanks for the fast answer!

but, what's p23? is it the out of octocoupler?
I understand the M151250 is the octocoupler isn't true?

the 3k9 resistor is the 3k3 and the 100k resistor isn't painted.

Any example for a IC17 and IC18?

thanks

tep

#92
Sep 17, 2009, 12:26 pm Last Edit: Sep 17, 2009, 12:36 pm by tep Reason: 1
Sorry, this seems not the best schematic since it comes from a book and the guy didn't scan everything...
For what I can answer:
- The M151250 is the 6-pin optocoupler, it seems very similar to ours.
- The 3k9 resistor depends on the circuit. As I mentioned previously, with a standard Arduino it is 3k3 and a standalone Atmega chip without FTDI it is 1k.
- Don't worry about the 100k! It works without and often better! (see other pages of the topic)

IC17 and IC18... hum, we'll have to find another schematic I guess!
[edit]http://whitefiles.org/b1_s/1_free_guides/fg1mt/pgs/h10d.htm ?[/edit]



tep

The best would be to try it out! ;)

If you could also post a link to this instructable?

joanvallve

it is a part of a Pod Guitar project:

http://www.instructables.com/id/SJZFF32F6S8S2BY/

i'll try this circuit, i'll post if it's ok if you want

Stuart Childs

Seem to have got the MIDI in code working. I'm hoping to send DMX outputs controlled by MIDI inputs. For this will I need:

2 arduinos?

A Processing - Arduino link?

I think I've spent too much time looking at a computer screen today - forgive any vastly stupid ideas ;)

Iteo

I have finally gotten the midi in schematic to work with a casio keyboard using the following code.
Code: [Select]
char incomingByte;
byte note;
byte velocity;


int statusLed = 13;   // select the pin for the LED

int action=2; //0 =note off ; 1=note on ; 2= nada


//setup: declaring iputs and outputs and begin serial
void setup() {
 //start serial with midi baudrate 31250 or 38400 for debugging
 Serial.begin(31250);        
 digitalWrite(statusLed,HIGH);  
}

//loop: wait for serial data, and interpret the message
void loop () {
 if (Serial.available() > 0) {
   // read the incoming byte:
   incomingByte = Serial.read();
Serial.print(incomingByte,HEX);
}

}


However, by checking the signals through USB in S2MIDI, it doesn't seem that the computer is receiving actual MIDI commands. Hexadecimal values appear when I press and release keys, but they don't represent actual midi values. Any ideas? (Here is S2MIDI's output for playing c through c (one octave))


2D 33 33 2D 33 37
2D 33 33 2D 34 39
2D 36 39 2D 37 33
2D 36 39 2D 31 2D 31
2D 33 35
2D 35 2D 33 2D 31
2D 33 33
2D 33 37 32 39
2D 33 35
2D 33 2D 31
31 32 33 2D 33 35
2D 31 37
2D 35 2D 33 33
2D 35 2D 31 2D 31
2D 32 31 2D 31
2D 35 2D 33 2D 31

tep

How is your setup ? Can you draw a quick schematic ?
(0x2D=45 and that's what you get if you send 144 (note on) at 9600bps and receive at 31250.)

Iteo

#99
Oct 27, 2009, 11:34 pm Last Edit: Oct 27, 2009, 11:40 pm by Iteo Reason: 1


*The question mark device represents the midi connector from the keyboard.  Also, the optocoupler is a 4N28, not what it says in the photo.

**SO does that mean that I should be receiving in 9600 to get MIDI data correctly??? That doesn't make sense...

tep

How is your computer connected ?

Iteo


tep

But what are you doing like this? Are you using the Arduino as interface?  :-?
I guess you wanted to monitor what the Arduino gets using the USB connection, but your baudrate in S2MIDI is not set correctly.
Anyway if you're using pure MIDI>Arduino I think something like a low-cost lcd (ebay, a few $ including shipping) is the best solution for monitoring the input. That's what I do!

Iteo

Pretty much the story is that I bought a midi interface because I wanted to connect my keyboard to the computer to be able to play with sound and record the notes etc. Unfortunately, that interface was cheap and didnt work, so I set out to build one on the arduino.  So I guess I am essentially using S2MIDI to 'forward' the signals to a midi input for a program such as midiox or fruity loops.  RIght now however, I dont receive any sound.  

tep

So let's be clear : you're only using the FTDI (USB>Serial) chip of the Arduino.
You're not using the microcontroller.
So you could also only use a FTDI and the circuit with optocoupler, for example this compact 14$ one http://www.sparkfun.com/commerce/product_info.php?products_id=9115 . (I can recommend it.)


Since your FTDI chip receives MIDI at 31250bps, it sends Serial over USB at the same speed. Try to configure S2MIDI for that speed (sorry I never used it).

I'm sure there is a better/cleaner/faster solution using your interface...  ;)

Go Up