Shop OBEX P1 Docs P2 Docs Learn Events
Digital Piano — Parallax Forums

Digital Piano

Techno KeithTechno Keith Posts: 12
edited 2008-09-09 13:00 in Propeller 1
Hello,
I am making sort of a custom digital piano.· It will have over 100 different buttons which will each play a different note.· Should each button have a different resistor attached, and the propeller measuring the resistance to tell which button is being pressed?· How should I do this?

- keith

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-09 00:48
    That's hard to do with so many buttons. That technique works best with fewer buttons. You're better off using scanning with maybe an 8 x 16 matrix using either 8-bit shift registers like 74HC595 for output and 74HC165 for input or maybe I2C I/O Expanders like the PCA9554. You probably want a diode at each button so you can detect multiple button presses.

    If you have 24 I/O pins available, you can use those directly for scanning the buttons rather than using shift registers (8 + 16 = 24). It all depends on what you want to do overall.
  • RaymanRayman Posts: 14,359
    edited 2008-09-09 00:54
    I think you only need 20 pins for a 10x10 input matrix, right?· I think this might give faster input than i2c, but maybe they're both fast enough for human input...
  • Techno KeithTechno Keith Posts: 12
    edited 2008-09-09 04:05
    What if I wired the buttons up to a keyboard?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-09 04:21
    What do you mean by "wired the buttons up to a keyboard"? Why would you do that?
  • AribaAriba Posts: 2,687
    edited 2008-09-09 13:00
    These Piano-Keyboards with black and white "keys" have normally 3 states per key, not only an On/Off switch. You have one contact for released keys, and one for a full pressed key, and in between neither of the 2 contacts is closed. This allows measuring the time between the begin of a keypress until the key is ful pressed. And that time you use for playing the notes dynamically louder and softer. Without that, a keyboard is nearly useless for playing Piano (there are other sounds like organ, which does'nt require a dynamical keyboard).
    You also have to detect several concurrently pressed keys for a polyphonic playing, and all with individual measuered press times.

    So you need some kind of analog multiplexer, with a 3 level detector at the end, and the Prop have to scan one key after the other, store the current state of the key and increment a counter for every key, if the key is between released an pressed state.

    Andy
Sign In or Register to comment.