Showing posts with label music. Show all posts
Showing posts with label music. Show all posts

Sunday, November 15, 2015

How does the Tooba's keyboard work?

The question I was most frequently asked when exhibiting the Tooba was about how the keyboard works. I was asked this by people who were obviously intelligent, and I have a deep understanding of it myself, so you would think there would be no problem in communicating it.

The short answer is, when you touch the copper contact, its effective capacitance increases, causing a change in an RC time constant which can be quickly measured with very simple electronics. The problem is that nearly zero otherwise intelligent people in our society understand capacitance.

I tried several different ways to explain this to people. Usually I said, "it works the same way as the touch screen on your phone", and that's true but it doesn't explain anything. It only gives people a known reference point to indicate that it's not physically impossible.


Capacitance is actually a pretty straightforward idea. You have two parallel metal plates. A battery or some other force pulls electrons out of one plate and pushes them into the other, so the first plate becomes positively charged and the second plate becomes negatively charged.

Opposite charges attract, so there is a force pulling the plates together, but they are mechanically held apart, usually by a layer of insulating material. The attractive force therefore acts upon the charges themselves, the excess electrons in the negative plate and the "holes" where electrons are missing in the positive plate. The negative and positive charges want to stay where they are, a bit like inertia, and this manifests as a measurable voltage difference between the plates. The only way to change that inertia is a current, a flow of electrons, into one plate and out of the other. A flow of 6.24x1018 electrons per second (or one coulomb per second) is one ampere.

Capacitors can be big or small. Capacitance is the size C measured in farads. Great, what the hell does that mean? Remember that the inertia of charge is measurable as a voltage V. The amount of charge is Q, the number of coulombs originally pumped into the plates by the battery. Then the magic formula is Q = C x V, or V = Q / C. How this pertains to the Tooba is that if Q is the same and C gets bigger, then V gets smaller.

Here is the touch-sensor circuit in the Tooba. The input on the left and the output on the right are I/O pins of the microcontroller. The left one is an output that drives electrons into and out of the capacitor, and the right one is an input to measure the voltage on the capacitor. It's a crude measurement, just a comparison to a threshold voltage that gives a zero or one.

BRIEF DIVERSION: In electronics, current is actually the direction opposite to how electrons are moving. This backwards convention is (no kidding) because Benjamin Franklin didn't have know whether the carriers of charge were positive or negative; the observable behavior was the same to him. He guessed, with a fifty-fifty chance of getting it right, and got it wrong. His mistake got codified into all of electronics, forever and ever, amen.

The output on the left is set to logical zero for a little while. The diode quickly discharges the capacitor to the same low output voltage representing a logical zero. Then the output is set to logical one, a higher voltage. The current flows to the right, against the direction of the one-way diode, so all the current flows through the resistor which slows down the movement of electrons. Here's the tricky part: if the capacitor is small, the voltage rises quickly, and if the capacitor is large, the voltage rises slowly. After a certain fixed amount of time, the voltage will just cross the zero-one threshold if your finger was not touching the copper, and the input will read a one. But if you touched the copper, the voltage will rise too slowly and the input will read a zero.

There is one more tricky bit to this. You may have been told in school that you always need to complete a circuit. Pushing current into the top of the capacitor would require that the bottom of the capacitor is connected to the ground in the Tooba. It turns out that capacitors are the one exception to this "complete the circuit" rule. You can (briefly) push current into a single plate and it will behave like a capacitor even without a second plate. That's why you can play the Tooba (or use the touch screen of your phone) without having a wire attached to you to complete the circuit.

Addendum - a friend read this post and wrote:
There's a missing piece in your explanation of capacitance: yes, the negative and positive charges do attract one another, but the charges in each plate also more strongly repel the same-sign charges in that same plate. That creates a restoring force that tries to push current back through the circuit to discharge the capacitor. 
The greater the capacitance, the smaller this net restoring force is. (You can think of a capacitor of higher capacitance as giving more room for the charges to spread out so they're not so crowded, or putting the plates closer together so that the "inertial" attraction across the gap is greater, or both.) 
If you touch one plate, a teeny bit of the charge can flow into your finger, or charges can become polarized in your finger so that some of the electric restoring force is cancelled out. Either way, it increases the capacitance by relieving some of the electric back-pressure through the circuit. And that's why you don't have to complete a circuit yourself.

Thursday, November 20, 2008

Gustav Mahler's Symphony No. 4 in G major

http://en.wikipedia.org/wiki/Symphony_No._4_(Mahler)
performed by the Vienna Philharmonic Orchestra (Wiener Philharmoniker), conducted by Leonard Bernstein
  • 1st movement (1, 2)
  • 2nd movement (1)
  • 3rd movement (1, 2, 3)
  • 4th movement (1)

Wednesday, September 03, 2008

Beethoven on Youtube

I've long been a fan of Beethoven's Violin Concerto (1, 2, 3). Here it is played by Yehudi Menuhin.

I also like some of the symphonies. Here's Herbert von Karajan conducting the Seventh Symphony, which I think doesn't get enough attention by comparison to the Third (1, 2, 3? 4?) or the Fifth or the Ninth (1, 2, 3a, 3b, 4). Why is it the only even-numbered Beethoven symphony you ever hear is the Sixth? In fact, none of Beethoven's power-of-two symphonies (numbers 1, 2, 4 and 8) get much airplay. Wierd.

Monday, August 25, 2008

Bach on YouTube

Brandenburg Concerto number 3, probably my favorite: first movement, second movement, third movement. For the third Brandenburg, Bach didn't really write a second movement. He just wrote a couple of chords and allowed the musicians to improvise whatever they wanted within that minimal harmonic constraint. Different groups do different things with that freedom. The first time I heard this concerto was Walter Carlos's rendition on the Switched-on Bach album back in the seventies, which included a lot of interesting sounds that people now associate with old bad sci-fi movies. But at the time, Carlos was one of the first explorers of electronic music and there wasn't yet an esthetic for it. In a later recording Carlos did something a bit more conventional, a minimal expansion on Bach's two chords with just a few flourishes.

One thing I never quite got about the first Brandenburg (first, second, third, fourth movements) is some funny work in the horns in the first movement. There are points where they just seem off-tempo with everybody else. When I first heard this I assumed the musicians had gotten lost. But now I'm hearing it in this second recording, so I have to conclude that Bach wrote it that way. Maybe he was trying to make sure the listener was awake? Perplexing.

I once read a review of the sixth Brandenburg (first, second, third movements) suggesting that it was a musical description of goings-on in the Bach household. Bach had lots of kids, all presumably running and bouncing about as kids will do, and this is a very busy concerto with a lot happening. So that might be what Bach had in mind, and it especially sounds that way in the third movement which has a real bounce to it. In this recording the cellos (maybe basses? I'm never sure) at the right end seem to have many more than four strings.