works: MIDI-IN: code + schematics

Yes!
But it should be about 5V... did you checked the resistors?

7V is quite impossible, given the fact that usb limits it to 5V(so does arduino).
and midi can't be 7 volts!

The "RX pin" andreas, is dat het blauwe draadje wat normaal in de arduino gaat? en zonder led naar 5V?

Tep----

That schematic is AWESOME!!!!!
:smiley:

Hello everyone,

I got it working!
At least.. my arduino receives the signal.
I've rebuilt the whole thing and suddently; arduino saw the light :wink:

Now.. next step to get all the lights to work properly.
Thanks for all the help you guys gave me!

Still.. you'll be hearing from me :wink:
Cheers,

Andreas

@sciguy: :slight_smile:

@AndreasViruly: Good, now I guess it'll be very quick, if you only want to light on LED on notes! :wink:

Haha, no that was just the first step. I want to make 36 different LED's corresponding to 3 octaves on the piano. Everytime a note is played on the master keyboard, these LED's have to light up, and go out the moment the key is released. I already saw my keyboard works with the "note on" with 0 velocity, when switching off a note..
I only have 13 pins on my Arduino so I have to start working with multi/charlieplexing.
Programming is just completely new for me so it'll take quite a while I think :wink:
But thanks anyhow!
Andreas

(pins 2-13 = 12 pins + analog pins = 6 pins. Total 18 pins ! ;))
Ok, those methods are good, but not very adapted if you plan to do other time-consuming things. I can recommend you shift registers. I got mine 5 for 1 us$ from Thailand on eBay. It's of course more assembly, but if you go this way I can give you a function to light LEDs a simple way.
Anoter thing : have a look at registers that handle PWM, you could handle the velocity!

On my MIDI controller with the MIDI IN issue I consolidated some solder and now found out that if I connect the RX pin to the RX pin of an empty Arduino Diecimila my onboard standalone Arduino receives the signal.

Do you have an idea of how to solve this?
[edit]Hm no, doesn't work anymore this way.[/edit]

Something strange: My MIDI IN circuit always work when I connect it to an Arduino. When it is a standalone Atmega, it doesn't work anymore. :frowning:

Look at this schematic :

He is using a 8-pin optocoupler, but he adds a 1.8k resistor to ground. What you think about it?
(My electronic knownledge is very small...)

Haven't seen it mentioned here, but I combined this sketch with teh serial to midi converter and it worked just taking the midi in through USB. Thanks for the sketch! I finally got my ableton clips triggering and flasing a LED at me when launched. Nice!

Hey, thanks for all your information, I have an arduino receiving midi from a controller or from the computer..!

Now i have another problem!! (when will i finish!?jejeje) i bought a 9V AC/DC for go everywhere with my arduino and my midi controller. But without the USB power it doesn't works!! What happens?!

I have the circuit done and working, but here is the problem:

With this code, happens two diferent thinks with power via USB or 9V black power jack.

without usb power, never is available, the serie...

int statusLed=13;  //one
int statusLed2=12;  //ten
int statusLed3=11;  //hundred
byte incomingByte;

void setup() {
  pinMode(statusLed,OUTPUT);   // declare the LED's pin as output
  pinMode(statusLed2,OUTPUT);   // declare the LED's pin as output
  pinMode(statusLed3,OUTPUT);   // declare the LED's pin as output

  Serial.begin(31250); //9600 for USB i 31250 for MIDI i 38400 for debugging
}

void loop () {
  if (Serial.available() > 0) {
    // read the incoming byte:
    incomingByte = Serial.read();
    blink(HIGH,statusLed);
    delay(temps);
    blink(LOW,statusLed);
    delay(20);
  }
}

void blink(byte valor, int nled){
  digitalWrite(nled, valor);
}

anyone can help me?

thanks a lot!

Hi!
Just to let you know where my problem is:

It is the resistance between RX and 5V.
It should be measured as about 1k to connect either MIDI or USB.
So I can't for now have a standalone solution where it is possible to connect the FTDI from time to time because the resistance is then too low or too high without the FTDI.

I can put a switch to enable a parallel resistor to the 3,3k one : enabled would be MIDI, disabled would be FTDI.
Or perhaps a transistor?
Or a FTDI in my enclosure... I made eveything to not have the need of it, but... And it would allow me also to have MIDI over Serial/USB connectivity.

So, for now I don't really know. I could try a transistor, but would it allow 9600 or 11250bps? I'm not sure with a 2N2222? (Their frequency is 250MHz or 300MHz)

Another thing: check out Ruin&Wesen library, could help some! :wink: http://ruinwesen.com/blog?id=582

hi, i'm searching a circuit of a MIDI THRU for put in this MIDI IN circuit, anyone can help me?

thanks!

I believe it's the same you can find eveywhere, not very minimalist...
Look at this one :

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

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]

this schematic is enouth?

http://www.instructables.com/files/deriv/FXY/7LDR/F6S8S2BV/FXY7LDRF6S8S2BV.MEDIUM.jpg

thanks!

The best would be to try it out! :wink:

If you could also post a link to this instructable?

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