Robotic Glockenspiel Crunches “Popcorn”

[James] sent us a video of his latest creation: a robotic glockenspiel that’s currently set up to play “Popcorn”. It uses eight servos to drive mallets that strike the tone bars with fast, crisp movements. The servos are driven with a 16-channel I²C servo driver and MIDI shield, which are in turn controlled with an Arduino Uno. The previous incarnation of his autoglockenspiel employed solenoids, dowels, and elastic bands.

[Gershon Kingsley]’s 1969 composition for synthesizer “Popcorn” has been covered by many artists over the years, though perhaps the most popular cut was [Hot Butter]’s 1972 release. Check it out after the break, and dig that lovely cable management. We’d love to see [James]’s autoglockenspiel play “Flight of the Bumblebee” next.

If you’re hungry for more electro-acoustic creations, have a gander at [Aaron Sherwood]’s Magnetophone.

Continue reading “Robotic Glockenspiel Crunches “Popcorn””

Robotic Player Guitar Rocks Out on Its Own

Back in 1988 [Ben Reardon] walked through the Japanese pavilion at the World Expo held in Brisbane, Australia. He saw a robot playing a classical guitar, and was in awe. Later in his life, he decided to learn guitar, and always thought back to that robot. After going to SIGGRAPH 2014 and being inspired by all the creative makers out there, he realized the technology was here — to build his own Robot Guitar.

He started small though — with a prototype robotic Tambourine. It helped flush out some of the ideas for coding that he would eventually employ on the Robot Guitar. The guitar features both an Arduino and a Raspberry Pi, along with six RC servos — one for each string. The biggest challenge with the project was getting the servos mounted just right — stiff, but with adjustment so each pick could be tuned for identical timing. He ended up using aluminum extrusion to mount the servos, three per side in order to leave space for the picks.

Once the mechanical portion was done — onto the coding…

In the end, it ended up being only 460 lines of code. Python and a bit of Bash for the Raspberry Pi — and of course a few sketches for the Arduino. But enough talking about it — let’s hear it!

Continue reading “Robotic Player Guitar Rocks Out on Its Own”

Logic Noise: More CMOS Cowbell!

Logic Noise is an exploration of building raw synthesizers with CMOS logic chips. This session, we’ll tackle things like bells, gongs, cymbals and yes, cowbells that have a high degree of non-harmonically related content in them.

Metallic Sounds: The XOR

I use the term “Non-harmonic” in the sense that the frequencies that compose the sound aren’t even integer multiples of some fundamental pitch as is the case with a guitar string or even our square waves. To make these metallic sounds, we’re going to need to mess things up a little bit, and the logic function we’re introducing today to do it is the exclusive-or (XOR).

An XOR logic gate has two inputs and it outputs a high voltage when one, and only one, of its inputs is at the high voltage level. When both inputs are low or both inputs are high, the output of the XOR is low. How does this help us in our quest for non-harmonic content? It turns out that the XOR logic function is the digital version of a frequency mixer. (Radio freaks, take note!)

Ideal frequency mixers take two input frequencies and output the sum and difference of the two input frequencies. If you pipe in 155 Hz and 200 Hz, for example, you’ll get out the difference at 45 Hz and the sum at 355 Hz.

Because we’re using square waves and an XOR instead of an ideal mixer, we’ll also get other bizarre values like 2*155 – 200 = 110 Hz and 2*200 – 155 = 245 Hz, etc. All said, the point is that we get out a bunch of frequencies that aren’t evenly divisible by one another, and this can make for good metallic sounds. (And Dalek voices, for what it’s worth.)

The 4070: Quad XOR

4070_pinout

Which brings us to our logic chip du jour. The 4070 is another 14-pin wonder, just like the 40106 and the 4069UB and the power and ground pins are in the same places. Since an XOR gate is a three-pin deal, with two inputs and one output, only four XORs fit on the 14-pin chip instead of six inverters.

By now, you’re entirely used to the 4000-series logic chips, so there’s not much more to say. This is a great chip to add sonic mayhem very easily to your projects.

Frequency Modulation with XOR: More Cowbell!

Let’s make some metallic noise. The first step is to mix two oscillators together. Whip up two variable-frequency oscillators on the 40106 as we’ve done now each time, and have a listen to each individually. Now connect each output to the inputs of one gate of an XOR in the 4070. As promised, the resulting waveform is a lot more complex than either of the two inputs.

Now tune them around against each other and listen to all the strange frequency components created as the sums and differences slide in and out. Cool, no? Here’s a bonus video that you can skip, but that demonstrates what’s going on with the frequency mixing.

Two-diode VCA

After a couple of minutes playing around, you’ll start to realize that this sounds nothing like a cowbell. We’ll need to shape the volume of the sound in time to get anywhere, and this means another step in the direction of “traditional” synthesizers. We’ll build up a ghetto voltage-controlled amplifier (VCA) and drive it with the world’s simplest envelope generator.

An active VCA takes its input signal and either amplifies or attenuates it depending on the control voltage (CV) applied on another input. When the control voltage is high, more of the sound gets through, and when the CV is zero, the output is ideally silent. Building a general-purpose VCA is a bit out of scope for our needs, so let’s just cobble something together with a few diodes.

This circuit works by cheating, and works best with digital logic signals like what we’ve got. When the input from the XOR is low, diode D1 conducts in its forward direction and all of the control voltage signal is “eaten up”, sunk into the output of the XOR chip.

Conversely, when the XOR is high, diode D1 is reverse-biased and blocks the CV, leaving it nowhere to go except through diode D2 and out to our amplifier. The resistor needs to be large enough that the XOR can sink all of its current, but otherwise the size is non-critical.

cap_square_to_pulesNotice what’s happened here. The voltage at the output is no longer the GND to VCC of our logic circuit, but instead ranges only from GND to the control voltage (minus a diode drop). So if we want to make a quieter version of the XOR input, we just lower the control voltage. It’s a simple voltage controlled attenuator. Now we just need to create a voltage signal that’s got something like the amplitude contour of a cowbell.

Remember how we converted square waves into trigger pulses by adding a series capacitor? The resulting voltage had this steep rise and exponential trail-off.

If we add in another capacitor, we can lengthen out the decay. And then while we’re at it, we can add in a potentiometer to control the rate of that decay.

diode_vca_with_envelope_no_diodes

Capacitor C1 converts the square wave into a pulse and charges up C2 very quickly, applying the positive voltage to the input of our VCA. The charge on C2 drains out through the variable decay potentiometer.

This simple circuit actually works well, but has one shortcoming. For long decay times, as illustrated above, the decay gets cut off when the control square wave goes low. If you only want short percussive hits, the simple circuit is enough. If you’d also like longer decays, you’ll need to add a couple diodes to chop off the negative part of the control voltage spikes.

diode_vca_with_envelope_sustain_no_diodes

Now that only periodic positive spikes are getting though to our decay capacitor, we have a nice variable-rate exponential decay voltage envelope. Here’s how it looks on the scope (with some extra capacitance slowing down the attack — envelope_with_xor_drumit might have been connected to the laptop soundcard). You can clearly see the control-voltage envelope chopped up by the diode action and the XOR’s output.

Putting the XOR frequency-modulated sounds through the two-diode VCA that’s driven by our quick and dirty envelope generator gets us a percussive metal sound.  But it it cowbell?  We still have to tune the oscillators up.

The classic, love-it-or-hate-it, cowbell sound of the 1980’s has to be the Roland TR-808. And if you look through the 808 service manual (PDF download) you’ll see that it uses two square waves from a 40106 chip simply mixed together. We’re improving on that by XORing, but we can still learn a bit from Roland. In particular, they tune their oscillators to 540 Hz and 800 Hz.

Because we’re XORing two oscillators together, our peaks come in at the sum and difference frequencies. This means that we’ve got to solve X + Y = 800 and X – Y = 540. Grab pencil and paper, or just believe me that you’ll want to tune up the individual square wave oscillators to 130 and 670 Hz respectively. At least, to get something like that classic cheesy cowbell sound.

Amplification Aside

We’ve been trying to stick to the use of purely CMOS logic chips here, but this session we broke down and used a transistor. The reason is that the audio input on our laptop insists on a bipolar, centered audio signal. In contrast, the output of our “VCA” sits mainly at zero volts with very short peaks up around one volt. The input capacitor in the laptop is charging up and blocking the VCA’s diode output. Boo!

Indeed, we can’t use our old tricks with the 4069UB as an amplifier here either. The 4069UB works great for signals that are centered around the mid-rail voltage, but distorts near either GND or VCC. Unfortunately, we’d like our quiet drum sounds to taper off to zero volts rather than the mid-rail, so we’ll have to use something else to buffer our audio with.

quick_and_dirty_transistor_amp.sch

The solution is to buffer the output with something suited to this unipolar signal, and the simplest solution is a plain-vanilla NPN transistor hooked up as a common-emitter amplifier common-collector amplifier. This configuration is a very useful analog buffer circuit; it puts out almost the same voltage as the input, but draws directly from the VCC rail and will certainly handle any sound card’s input capacitor. We used a 2N3904, but a 2N2222 or BC548 or whatever will work just fine.

Cymbals

Cymbals and similar metallic percussion instruments were pretty tricky to synthesize in the early days of drum machines. Until the LinnDrum introduced sampled cymbals, most just used a shaped burst of white noise. The aforementioned TR-808 used six 40106 oscillators linearly mixed together to approximate white noise. Again, we’ll improve on that by running it all through XORs with the result being somewhere between many oscillators and pure noise depending on how you set the oscillators up.

The inspiration for this circuit is the fantastic Synbal project (schematic in PDF) from “Electronics & Music Maker” magazine in 1983. It’s a much more complicated affair than what we’re doing here, but if you look at the left-hand side of the schematic, that’s the core. (If you’re copying the Synbal’s fixed frequencies for the oscillators, note that he uses 0.01 uF capacitors and we use 0.1 uF caps. Divide the feedback resistors by ten accordingly.)

cymbals.schThe trick to the cymbal circuit is making a lot of oscillators. We’ll hook up six of them, finally fully fill our 40106 chip. Then combine any pair in an XOR, take the output of that XOR and combine it with another oscillator. You’ve now got a complex oscillator that’s used up three 40106 oscillators and two XOR gates. Repeat this with the remaining oscillators and XOR gates and you’re nearly done. Connect the final two XOR outs through resistors to the output.

As with the cowbell circuit, this circuit can be made to sound “realistic” by picking the different component frequencies just right and tweaking the decay. We think that it makes a pretty decent hi-hat sound with a couple of the oscillators pitched high (1 kHz and up). On the other hand, if you’re into noise music you can skip the VCA altogether and tune the oscillators to similar, low frequencies. You get a vaguely metallic, almost rhythmic machine drone. Not to be missed.

Extensions

We’ve snuck it in under the guise of making a cowbell sound, but the quick-and-dirty VCA here is also useful for modulating most of the synth voices we made in the first few sessions. We went for a percussive attack by using a capacitor to couple the driving square wave to the VCA, but there’s no reason not to use a variable resistor in its place to charge up the capacitor more slowly. If you do this, note that the attack and decay potentiometers will interact, so it’s a little quirky, but what do you want for two diodes anyway? Also note that any other way you can think of delivering an interesting voltage to the junction of the two diodes is fair game.

The XOR-as-frequency-mixer technique is pretty great, but you can also get a lot of mileage by using the XOR as a logic chip. Combining different divided-down clock outputs (from a 4040, say) with XORs makes interesting sub-patterns, for instance. And we’ll get more use out of the XORs in two sessions when they’re coupled with shift registers.

Next Session

We’ve got a whole lot of possibilities by now. We’ve got some good, and some freaky, percussion voices. We’ve got a bunch of synthesizer sounds, and if you recall back to the 4051, we’ve got a good way to modulate them by switching different resistors in and out. It’s time to start integrating some of this stuff.

If you’re following along, your homework is to build up permanent (or at least quasi-permanent) versions of a couple of these circuits, and to get your hands on at least two 4017 decade counter chips. Because next week we’ll be making drum patterns and introducing yet one more way to make music.

Guitar Speaker Cabinet Actually Belongs In Garbage Can

[Dano] builds a lot of guitar pedals and amps. He needed a speaker cabinet dedicated to this task in order to be a consistent reference when checking out his electronic creations. He ordered a couple of 10″ guitar speakers…. and they sat around for a while.

Then one day at the craft store, he stumbled on an inexpensive wooden trash can. It had a tapered design and came with a lid. As would any normal person, [Dano] immediately thought these would make a perfect speaker cabinet so he bought two of them.

The trash cans would be used in an upside-down orientation. The intended lid makes for a well fitting bottom of the cabinet. Holes were cut for the speaker and two terminal blocks. Since these cabinets would be used for testing a bunch of different amps, two different terminal blocks were used to permanently have multiple connector types available.

A pair of modern kitchen cabinet handles were used as carrying handles for each of the two cabinets. If a speaker cabinet one speaker tall is cool, a cabinet two speakers tall must be twice as cool. To get there, the two cabinets were bolted together using electrical conduit as an industrial looking spacer. Those brackets bolted to the sides of the bottom cabinet are actually Ikea shelf brackets that [Dano] had bought and never used. The Ikea brackets support casters making for easy moving around the studio.

Overall, [Dano] is happy with how his cabinets sound. They are very unique and interesting at the least. We’d be happy to play some riffs through them!

Logic Noise: Filters and Drums

Filters and Drums

Logic Noise is an exploration of building raw synthesizers with CMOS logic chips. This session, we continue to abuse the 4069UB as an amplifier. We’ll turn the simple unity-gain buffer of last session into a single-pole active lowpass filter with a single part. (Spoiler: it’s a capacitor.)

While totally useful, this simple filter is a bit boring and difficult to make dynamic. So we’ll look into an entirely different filter, the Twin-T notch filter, that turns out to be sharp enough to build a sine-wave oscillator on, and tweakable enough that we’ll make a damped-oscillator drum sound out of it.

Here’s a quick demo of where we’re heading. Read on to see how we get there.

Continue reading “Logic Noise: Filters and Drums”

3D Spectrum Analyzer uses 1280 LEDs

One of [Dooievriend]’s friends recently pressed him into service to write software for a 3d spectrum analyzer/VU that he made. The VU is a fairly complex build: it’s made up of 1280 LEDs in a 16x16x5 matrix controlled by a PIC32 clocked at 80MHz. [Dooievriend] wrote some firmware for the PIC that uses a variation on a discrete Fourier transform to create a 3D VU effect.

j6v2i When [Dooievriend] set out to design the audio analyzing portion of the firmware, his mind jumped to the discrete Fourier transform. This transform calculates the amplitude in a series of frequency bins in the audio—seemingly perfect for a VU. However, after some more research, [Dooievriend] decided to implement a constant Q transform. This transform is very similar to a Fourier transform, but it takes into account the logarithmic way that the human ear interprets sound.

[Dooievriend] started implementing the constant Q transform using an interrupt-based sampler, but he quickly ran into issues with slow floating-point math on his PIC32 (which doesn’t have a hardware floating-point unit). Thankfully he rewrote his code using fixed-point math, and the transform runs nearly real-time. Check out the video after the break to see the VU in action, and a second video that gives some details on the hardware build.

Continue reading “3D Spectrum Analyzer uses 1280 LEDs”

The Hard Drive MIDI Controller

[shantea] builds MIDI controllers, and after a successful first endeavor with a matrix of buttons and knobs, he decided to branch out to something a little bit cooler. It’s called Ceylon, and it’s effectively a turntable controller built from an old hard drive.

As a contrast to the first MIDI controller, this would be a stripped-down build, with just three faders, LEDs for eye candy, a pair of pots for gain control, and a hard disk surrounded by six anti-vandal buttons. The hard disk is the star of the show, acting as a rotary encoder.

When manually spun, the hard disk generates a few phases of sinusoidal waves. The faster you spin it, the higher the amplitude and frequency. These signals are far too weak to be sampled directly by a microcontroller, and for digital control – as in, MIDI – you don’t need to read the analog signals anyway. These signals were turned digital with the help of an LM339 quad comparator. With two of these comparators and signals out of the hard disk that are 90 degrees out of phase, quadrature encoding is pretty easy.

The software for this MIDI controller is based on the OpenDeck Platform, a neat system that allows anyone to create their own MIDI controllers and devices.  It’s also a great looking board that seems to perform well. Video below.

Continue reading “The Hard Drive MIDI Controller”