Show Posts
Pages: [1]
1  Using Arduino / Audio / Re: Arduino dropping midi signals on: May 14, 2012, 09:07:38 am
Hi there,

I ran into exactly the same scenario and found a workaround.
I had kuk's MIDI solution wired on a second hand Yamaha keyboard I bought, and was only able to receive a 144 note on signal every 4 or so seconds.
I was pretty sure it had to be the same reason, as the original poster also mentioned a Yamaha PSR series keyboard.
It turns out that Yamaha does kind of ignore MIDI standards. The signals I received on playing "C D E" for example were:
20 80 20 0
22 80 22 0
24 80 24 0
So the information about all the notes is being passed through, just not always starting with a 144 note on signal. No idea why.
But every noted is being closed with a velocity of 0, which can be used to detect which notes have been played:

void loop () { 
  if (Serial.available() > 0) {
    incomingByte =;
    if (incomingByte >= 36 && incomingByte <= 96) { // note range is between 36 and 96
      prevNote = incomingByte;     
    else if (incomingByte == 0) {
      output += prevNote;
      output += "-";

So my code ignores the 144 signals, but every time it detects a 0 signal, it adds the previously read byte to the output, as that one represents the note that has just been hit. This doesn't yet take velocity into account, a slightly more complex code is needed for that, but for me this was sufficient.

Hope this helps!
2  Topics / Device Hacking / Read force sensors of the keys an existing electronic keyboard on: February 17, 2012, 08:10:56 pm
Hello there!

An rookie in electronics could use some help here =).

I'm attempting to hack an electronic piano to read the keystrokes into an arduino and do stuff with it.
On opening the piano I found two pins per key that, when I put my multimeter to them, generate around 2 volt when the key is pressed.
So I soldered wire to these to connect to a breadboard (see picture 1).

The second picture shows the circuit I made for one sensor.
This works perfectly, I can analogRead the force sensor and display them in my serial monitor; I get values of around 900 when a key is pressed, and values less than 70 when the key is not pressed.

However, when I connect a second force sensor (third picture), I'm getting the following problem:
When I press either of both keys, they both sound. When I disconnect their GND's, it's not the case anymore. So apparently a shared ground makes that generating current on one force sensor-circuit, also puts current on the second one, making it sound?

Pressing one key also makes the second sensor read 250 even though it's not pressed.

I guesss I have to separate some things somewhere, but I have no idea what. Or should I put a diode somewhere in there?

I hope I'm making this clear.
Thanks in advance for any help!

PS. I don't need the velocity of the note, just whether or not it's pressed. If all else fails I'm gonna try and connect push buttons to the keys but I'm sure there's a way to hack into the existing circuit...
3  Using Arduino / Microcontrollers / Re: Reading low voltage with digital pins on: February 13, 2012, 09:42:08 am
Thanks guys! Going to check out multiplexers.
4  Using Arduino / Microcontrollers / Reading low voltage with digital pins on: February 10, 2012, 05:53:50 pm

The following is a beginner question, I'm new to arduino and I don't have an electronic background (only software), so bear with me :-).
I'm hacking an electronic piano to intercept the signals when the keys are pressed. They're force sensors, emitting a voltage between 0 and about 1.2 volt when pressed, depending on how hard you hit them.

I'd like to read this in arduino, I know the "analog in" pins are the way to go, but because there aren't enough of them (I need 12, a full scale of notes), is it anyhow possible to use the digital pins for reading this signal?

If not I guess I'll have to take a look at multiplexers.

Thanks for your time!

Pages: [1]