Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 29, 2009, 01:53:28 pm
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 smiley-wink
But thanks anyhow!  
Andreas
2  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 29, 2009, 11:35:02 am
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  smiley-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 smiley-wink
Cheers,

Andreas
3  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 23, 2009, 01:25:17 pm
Hello,

What I did next was the following:

I connected the RX line to the red side of my voltage meter.
The black side I connected to the ground.

Here I found a voltage of around 7V (7,3-7,4).
By playing several notes at the same time this amount gets less.

The more notes I play at the same time, the lower this amount becomes.

Is this of any help in our quest?

Thanks!!!!!
4  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 23, 2009, 07:15:28 am
Hello Everyone,

What I did was the following.
Instead of linking the schematic to the RX of my Arduino, I put a LED between the incoming data and the 5V pin.

Here I received the following results:
During the idle midi-signal I received 0V.
Whilst playing only 1 note I got about 0,02V.
Whilst playing 2 notes at the same time I got 0,04V
Playing 3 notes around 0,06V and so on.

Is there an error?
What can we do  :-/

Thanks in advance,.

Andreas




5  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: August 21, 2009, 10:15:28 am
Hello everyone,

As Titus stated in the last post; we still have some problems with the RX of my Arduino.
I have an Arduino Duemilanove.
I use this with a M-Audio Uno Usb to midi device.
Also I downloaded MIDI OX to check whether my outputdevice works.
This works.

Everything works accept the incoming signal through the RX.
What are we missing? Are we using the RX pin correctly?
Can we use the usb-port as the poweradapter at the same time of the RX use? The usb is not connected to the PC, only to a AC adapter.

Thanks in advance,


Andreas
6  Forum 2005-2010 (read only) / Interfacing / Re: works: MIDI-IN: code + schematics on: July 24, 2009, 05:51:24 am
Hello there,

I have a big problem. I made the whole schematic, exactely as described in the post above. But it still fails to work.

I want to make about 36 LED's, corresponding to the midi output of my electronical keyboard.
This means that by playing the middle C, the first LED switches on. By pressing the C#, the second, and so on.

When letting the tone go, the LED should switch off.

This is a very important project for my school. Could somebody help me out?

I tried all the comments posted on this forum.
This is the code I used to debug the system.
Even this didn't work.

Another question I have is the following:
How can I tell the difference between pin number 4 and 5.
When looking at the front side of the plug, is it a fact that the left pin is always number 5?

I hope to receive a usefull reply!

Andreas Viruly from the Netherlands

Code:
byte incomingByte;
byte note=0;
byte velocity;
int statusLed = 13;   // select the pin for the LED
int action=2; //0 =note off ; 1=note on ; 2= nada

void setup()
{
  pinMode(statusLed,OUTPUT);   // declare the LED's pin as output
  Serial.begin(31250);      
  digitalWrite(statusLed,HIGH);
}

void loop ()
{
  if (Serial.available() > 0)
  {
    incomingByte = Serial.read();

    if (incomingByte== 144)
    { // note on
      action=1;
    }
    else if (incomingByte== 128)
    { // note off
      action=0;
    }
    else if ( (action==0)&&(note==0) )
    { // if we received a "note off", we wait for which note (databyte)
      note=incomingByte;
      playNote();
      note=0;
      velocity=0;
      action=2;
    }
    else if ( (action==1)&&(note==0) )
    { // if we received a "note on", we wait for the note (databyte)
      note=incomingByte;
    }
    else if ( (action==1)&&(note!=0) )
    { // ...and then the velocity
      playNote();
      note=0;
      velocity=0;
      action=0;
    }
    else
    {
      //nada
    }
  }
}

void playNote()
{
  digitalWrite(statusLed, LOW);
  delay(1000);
  digitalWrite(statusLed, HIGH);
}

7  Forum 2005-2010 (read only) / Exhibition / Re: Charlieplexing. on: October 23, 2009, 07:08:04 am
Oh yeah, that should be 6 and 7 but that was just a mistake in my post. With every combination I make, two LED's light up. Hm..  :-/
8  Forum 2005-2010 (read only) / Exhibition / Re: Charlieplexing. on: October 23, 2009, 06:37:04 am
Hi everyone

I'm building a charlieplexed circuit.
I still have a problem with two led's lighting up at the same time, when only 1 should. I've tried multiple resistors but that would not make any difference. I have 18 LED's on 5 pins. When I set pin 12 on HIGH and 11 on LOW, it seems like pin 10 is LOW as well, even though I've programmed it as INPUT.

Are there things I could be missing? It is a very important project for school, so any help would be appreciated.

Thanks
Andreas (the Netherlands)

(my code is attached as well)
Code:
/*
To do:
 -leds aandoen invoeren
 */

# define STATUS_OFF 0x80
# define BEGIN_NOTE 0x2d


# define UNDEFINED 5

# define PIN_1 6
# define PIN_2 7
# define PIN_3 8
# define PIN_4 9
# define PIN_5 10
# define PIN_6 11
# define PIN_7 12

# define STATUS_LED 13


void setup()
{
 pinMode(PIN_1,INPUT);
  pinMode(PIN_2,INPUT);
  pinMode(PIN_3,INPUT);
  pinMode(PIN_4,INPUT);
  pinMode(PIN_5,OUTPUT);
  pinMode(PIN_6,INPUT);
  pinMode(PIN_7,OUTPUT);


  pinMode(STATUS_LED,OUTPUT);



  digitalWrite(STATUS_LED,LOW);
  delay(1);
  digitalWrite(STATUS_LED,HIGH);
  delay(500);
  digitalWrite(STATUS_LED,LOW);
}

void loop()
{
  digitalWrite(PIN_7,LOW);
  digitalWrite(PIN_5,HIGH);
}
Pages: [1]