Music downloads
Video clips
Chip music
Hardware projects

Partita Prelude

for 8-Bit Ensemble

Floppy drives and stepper motors have been used to make music before, but for live playing I think the technology is underexplored.

This video features three separate Commodore 64 computers, colour coded for your convenience. I'm playing the melody on a dark grey C64C (custom case from Individual Computers) and chords on a brown “breadbin”. These machines run Qwertuoso, my accordion-inspired C64 program for playing live chip music. An external potentiometer is hooked up as a volume control.

The chord progression was shaped by both musical and technical constraints: I wanted to pick chords that would fit the melody while playfully extending its harmonical structure—but I also had to avoid note combinations that would result in keyboard ghosting.

The third computer, a light grey C64C, doesn't use the SID chip to generate sound. Instead it controls the motors of a programmable floppy disk drive, providing bass and rhythmical noises. The lid of the drive has been removed in the video so you can see the moving parts.

A 1530 Datasette unit is also put to good use.

I've already demonstrated Qwertuoso elsewhere (Sixtyforgan, Monty On The 'Bin, Vocalise), so in this article I'll focus on how the disk drive sound generation works. The basic principle is straightforward, but the resulting instrument has a number of charming quirks.

A soothingly sonorous storage system

The 1541-II floppy drive remains a popular peripheral for the Commodore 64 home computer. It has two motors: A DC motor for spinning the disk, and a stepper motor for positioning the read/write head over a desired track.

The DC motor can be turned on or off under software control, causing pleasant whispery noises as the motor spins up or slows to a halt. But when the motor is left running, it produces a rather dull and musically uninteresting murmur. Ideally we'd like to keep the DC motor off during most of the performance, to minimise this murmur. But unfortunately this is not possible, and I'll tell you why in a minute.

Let's turn our attention to the stepper motor, which is a much more versatile source of sound. By manipulating a few register bits we can turn its rotor by a precise amount. This rotating motion is translated by wire into a linear force that pulls the read/write head one step hubwards or rimwards. What we're directly controlling is the orientation of a magnetic field, which then drags the physical rotor around. The magnetic field changes very quickly, but accelerating the rotor takes a couple of milliseconds. Hence, when the drive operates normally as a storage device, it changes the magnetic field by one step and then waits for a while, giving the read/write head time to reach and settle on the next track. The settling head produces a distinct “click” sound.

But suppose we alternate rapidly between two settings. As we rotate the magnetic field, the head starts to move, but before it reaches the requested position we force it to move in the other direction, and so on, back and forth. Since the head never settles, there is no click, but the vibration of the head creates a sound wave in the air and we hear a tone. The rate at which the magnetic field is wiggled controls the pitch of the sound. But as soon as we stop wiggling the field, the head eventually settles with a click. Can we find a way to avoid such a click at the end of every note?

Recall that the DC motor makes a constant murmur whenever it's spinning. Unfortunately for our purposes, the design of the 1541 prevents us from moving the stepper motor without also powering the DC motor. I mentioned that the DC motor can be turned on or off under software control, but more accurately we can turn the entire motor subsystem on or off—energising both motors in tandem. That seems to leave us with two general strategies: Either we keep the DC motor running throughout the musical performance, accepting the background murmur, or we try to switch it off as much as possible, accepting the whispery noises that come with that. In this project I opted for the second strategy. The haphazard spin-up and spin-down noises fit in well with the overall keyboard clatter, but there's a more compelling reason: By turning off the power to the DC motor—and therefore also the stepper motor—at the end of every note, nothing is forcing the read/write head to move. In the absence of a strong magnetic field, the head slows down quietly at its own pace and no click is heard.

Loudness and timbre

When we generate tones with the stepper motor in this way, we have no direct control over the volume of each note. However, there's a large variation in loudness across the range of the instrument. First of all, the lower the wiggling frequency, the more time the head gets to move before it's forced to turn around. As the head covers a larger distance, it produces a sound wave with a bigger amplitude, i.e. a louder sound. Certain pitches also appear to make the drive case resonate.

Furthermore, in the lower bass range the rate of change in the magnetic field is slow enough to allow the head to settle after each flight, at least to some degree. This results in a rapid series of clicks halfway between a mechanical rattle and a musical note. This harsh sound is familiar to anyone who has used a floppy drive normally: It is heard each time the head needs to step over a bunch of tracks in order to reach a desired data sector. The difference is that during loading, all those steps are taken in the same direction, but in our case the head is stepping back and forth between adjacent tracks. So in addition to the pitched loading rattle, we get a comparatively quiet tone from the wiggling of the head itself, just as we did in the treble register.

So in summary, certain ranges of pitches are louder and harsher than others. By adapting the musical composition to these variations, it's possible—within limits—to create accents and dynamics.

Intriguingly, the timbre of the sound also appears to be affected by the position of the read/write head. Rapidly moving the head between tracks one and two, say, might produce a sound that's noticeably different from the one found between tracks two and three, even at the same pitch. In my software, the left-arrow key (operated by the left hand) generates a click noise by briefly allowing the head to settle before resuming any held note. But since the wiggling restarts from a different track position, the held note has a different timbre before and after the click. There's a passage starting at 0:31 in the video where you can hear this effect being used to add variation to a constant-pitch bass note.

Recording and mixing

In this project I allowed myself to indulge in mixing in the broad sense, so each recorded part has been refined with EQ, compression, and reverb. This resulted in something slightly more pop-like than the average chiptune, but the raw 8-bit sounds are still quite prominent in the mix.

The sound from the floppy drive is picked up in two ways: One is an ordinary wearable mic, just hanging over the edge of the open enclosure. The other is a piezo sensor attached to the enclosure, connected to a homemade preamplifier. The two microphones produce slightly different sound recordings that are then recombined at different levels and stereo positions during mixing. But in the talking part of the video, only the piezo sensor is used—because the wearable mic is on my shirt.

The preamp circuit for the piezo sensor consists of an LMC662 op-amp wired up as a non-inverting amplifier with a gain factor of about 300, powered by a 9-Volt battery. You can spot the same build in the Sixtyforgan video, where it handles the signal coming back from the reverb tank. In principle the piezo sensor could be plugged straight into the microphone jack of a recording device, but long wires tend to pick up noise. By boosting the signal close to the source we reduce the relative level of that noise, here by a factor of 300 (or 50 dB in audio terms).

Acknowledgements

The melody was composed by Johann Sebastian Bach as the first part of his Partita No. 3 in E major (BWV 1006.1). I added the bass and chord progression. Other musicians have put a beat on this piece—I first heard it in Vanessa-Mae's Bach Street Prelude from 1997.

Download

Posted Friday 3-Jun-2022 07:16

Discuss this page

Disclaimer: I am not responsible for what people (other than myself) write in the forums. Please report any abuse, such as insults, slander, spam and illegal material, and I will take appropriate actions. Don't feed the trolls.

Jag tar inget ansvar för det som skrivs i forumet, förutom mina egna inlägg. Vänligen rapportera alla inlägg som bryter mot reglerna, så ska jag se vad jag kan göra. Som regelbrott räknas till exempel förolämpningar, förtal, spam och olagligt material. Mata inte trålarna.

quiss
Matthias Kramm
Wed 8-Jun-2022 11:20
Turning off *both* motors at the end of a note, to get rid of those clicks...! Nice one, Linus.

What pulse width(s) are you using? Also, looking at the video, the head is positioned on one of the outer tracks?
lft
Linus Åkesson
Fri 10-Jun-2022 15:26
Just a plain 50% pulse width.

Yes, I'm starting from track five. I have to start from a known track to get consistent timbres, and it's easy to reset to a low track number.

Also, during the free coasting that occurs after every note, the head tends to drift towards higher track numbers (for some unknown reason). So I need some margin in that direction.