Pages: [1]   Go Down
Author Topic: BIG the musical  (Read 754 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A local high school drama group plans to perform BIG the musical.  They'll have a 9 meter long piano keyboard.  The keys light when danced upon.  Thus, they have switches for each key.  Possibly 88 keys.  Is Arduino suitable to connect to a synthesizer to produce piano like sound?

Let's ask again, the musical bit is rather irrelevant, but might help as a reference for the next person with this task.  I've got 88 switches.  Let's say a closed switch indicates a set bit.  What's a good circuit and connection to Arduino to make the board report eleven 8 bit bytes to my computer 30 times per second indicating the state of the switches?

Thanks, Dave.
Logged

Montreal
Offline Offline
Edison Member
*
Karma: 23
Posts: 2487
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have a look:
http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you!  Mike Cook has built a number of interesting devices.
Logged

Offline Offline
Edison Member
*
Karma: 23
Posts: 1173
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd say it's too risky for the stage...  Of course the decision is up to the director, but I'd fake it.   There is too much chance of something going wrong electrically or mechanically, or an actor flubbing the performance,.    Maybe, I'd do it if I could build a back-up...  Then, you'd only have to shut down the show for a few minutes to switch-out the prop...   smiley-roll

88 inputs is a lot, and you'd have to use multiplexing, matrixing, a serial connection, or some other "tricks" if you wanted to sue a single Arduino.  (And 88 switches/wires/connections means 88 potential failure points on each end of the cable/connection.  smiley-eek-blue )

How much time have you got?   I do know a lot about electronics, but I've only done one Arduino project so far, I'm not a musician, and my MIDI knowledge is limited...  with everything I don't know, I'd want 6 months to learn, design, build, program, and de-bug the thing....  Hopefully, it would only take a couple of months, but it HAS to be ready & reliable when the show opens (actually before the show opens).
« Last Edit: June 18, 2012, 05:29:28 pm by DVDdoug » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

0) The set construction crew wants to make the show authentic---that is, the actors control the music rather than have the pit pianist play.

1) How many keys are actually needed?  I haven't seen the show, but have heard that a character slides across the keyboard.  Therefore, at least enough notes need to work for a reasonable glissando.

2) Date: I don't know when they start rehearsal.  Seems like the device ought to be functional by mid-September.

One plan is to find the switches on a (or two) synthesizer keyboard (remove keys as needed) and rewire the switches to the foot pads.  I figure this has about 25% chance of success.

Otherwise, I was thinking I could multiplex using several multiplex chips or many op-amp addition circuits to an Arduino(s) board.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Caveat: untested, and I haven't designed a circuit for 20 years.  I haven't had a report from the set crew so I expect the synthesizer rewiring  worked.

Following circuit looks like a low cost solution.  Wire several keys in parallel as shown to make a voltage divider.  Find suitable values for the resistors RA, RA+, RB, RC such that any combination of closed switches is are unique, and that the order of output voltages for all combinations  doesn't change given silver band resistors.  Following is j code executable Iverson notation to solve the problem.  This scenario would require power supply and ground wires to the keyboard, and also a long wire to measure Vout for every 4 keys.  The resistances, divided by some power of 10, are 10 22 47 100 ohms, R1 does not change the order of output voltages for combinations of notes played.  I chose R1 as 24*10^n ohms for no other reason than that it is the harmonic mean of the others.  To wire 8 keys together use a factor of 3 between the resistances of the parallel resistors.  Connect the key groups to the analog inputs  of the Arduino board.  Calibration requires each key played once.  Needn't play all possible chords!

The software to produce sound doesn't appear difficult.  Using ubuntu linux distribution and the alsa sound driver, I recorded my favorite instrument playing the notes using the arecord program.  (One note is enough.  audacity can generate other frequencies with same envelope shape.)  Then I can play multiple tones using aplay --channel=# tone.wav in the background.  There are 16 channels which is far more than the audience will be able to distinguish.
Code:
Note 'circuit diagram for 4 keys'

V+ +----------+----------+----------+----------+-------o
   |          |          |          |          |
   |          \          \          \          \
   |          o o        o o        o o        o o
   |          |          |          |          |
   |           \          \          \          \
  ---      RA  /     RA+  /      RB  /      RC  /
V  -          \          \          \          \       V+
  ---          /          /          /          /
   -          |          |          |          |
   |          +----------+----------+----------+---o
   |          |
   |           \
   |       R1  /
   |          \                                  Vout
   |           /
   |          |
 0 +----------+------------------------------------o---o
   |
 -----
  ---
   -
)

mean=: +/ % #
gm=: */ ^ %@:#                          NB. geometric mean
hm=: # * +/&.:%                         NB. harmonic mean

BANDS12=: 10 11 12 13 15 16 18 20 22 24 27 30 33 36 39 43 47 51 56 62 68 75 82 91x
BAND3=: 10x^i.4
STANDARD_RESISTANCES=: BANDS12 */~ BAND3
R=: , STANDARD_RESISTANCES

s=: +        NB. serial resistor
p=: +&.:%    NB. parallel resistor
p=: +/&.:%   NB. parallel resistors

switches=: >@:,@:{@:([: <"1 (_&,.))
pers=: parallel_equivalent_resistances=: p/"1@:switches

voltage_divider=: 0&$: : ([ % (s pers)) NB. R0 voltage_divider RPi


round=: 0&$: :(4 : '<.@:(0.5&+)&.:((10^x)&*) y')

vout=: ($:~ round@:hm) : voltage_divider

spread=: ((*"1) (1 + 1r10 * _1 + [: +: [: #: [: i. 2 ^ #))"1

all=: *./

resistances=: 4&$: : (R {~ (*  i.)~)

f=: (4&$: : ([: all 2 -:/\ [: /:@:vout"1 [: spread resistances))"0


Note 'solution'
   1 i.~ f i.12
8
   NB. Vout to Vsupply ratios for switch combinations
   ((3 round 24&vout) ,. switches) resistances 8
    0  _  _  _   _
0.194  _  _  _ 100
0.338  _  _ 47   _
0.429  _  _ 47 100
0.522  _ 22  _   _
0.571  _ 22  _ 100
0.616  _ 22 47   _
0.648  _ 22 47 100
0.706 10  _  _   _
0.725 10  _  _ 100
0.744 10  _ 47   _
0.759 10  _ 47 100
0.777 10 22  _   _
0.789 10 22  _ 100
  0.8 10 22 47   _
0.809 10 22 47 100
)
Logged

Pages: [1]   Go Up
Jump to: