Musical Floppy Drives - Computerphile

The Power and Complexity of Floppy Drives

When it comes to operating floppy drives, one of the most significant challenges is understanding what makes them tick. On the surface, it may seem like a simple task to get a drive to spin at a certain speed, but as we soon discovered, there are many nuances involved. In order to make the motor move directly on each of these floppy drives, we need to be able to tell the drive exactly how to behave in terms of its movement.

One of the key components of our system is the ribbon connector, which consists of two blacks, a green, and a blue. The blacks are simply ground, while the green and blue pins serve different purposes. The direction pin, for example, determines the direction in which the drive will move. If this pin is held low, the drive will move in one direction, and if it's held high at 5 volts, it will move in the opposite direction. Furthermore, the step pin serves as a pulse signal that allows us to control the movement of the drive by sending pulses through this channel.

To understand how our system works, we need to look at the Arduino board, which is essentially a small computer on the board. It's not quite like a full-fledged computer, but it does have input and output pins that allow us to interact with the world outside of itself. In our case, the Arduino is used to control the floppy drives, which are plugged into this board.

The Arduino has a little program running on it, which is communicated with by another program on the computer down this USB cable. This program sends messages to the Arduino at an incredible rate – thousands per second! – and tells it when to start each drive spinning and what frequency to use. However, the Arduino does something that keeps our program on the computer from getting stuck in a loop: it tracks the position of each floppy drive.

Now that we have this setup, we can tell the Arduino to make a particular drive spin at a certain speed, and it will know exactly which position the read head is in. This means that we don't need to worry about how the drives are moving or where they'll jam – the Arduino takes care of all that for us.

But what does this mean in practice? Well, if we're playing music on our system, we need a program that can read MIDI files and generate sound. Fortunately, there are many libraries available that make it easy to work with MIDI files. In our case, we use Java as the programming language of choice.

One of the features of our system is the ability to adjust the notes played by each channel separately. This means that if one track uses a particular instrument, another track can use a different instrument entirely – even if they're playing the same note. For example, in the case of the Bumblebee, it's largely composed of two channels, one of which is used predominantly.

To make adjustments to our system, we need to drag sliders around this interface, which allows us to adjust parameters like pitch and timing. For instance, if we want to transpose a note up or down, we can simply move the slider accordingly. And as we play the music, it will respond to these changes in real-time.

Of course, there are limitations to our system. For example, some notes may be too low for the drives to play, and this is where the limits of our hardware come into play. If we push the sliders too far, the drive can actually break – as I've seen happen before! But overall, our system allows us to create complex music using MIDI files and floppy drives.

The Code Behind the Music

As part of our project, we also need to look at the code that's used to communicate between the Arduino and the computer. In this case, we use a Java program that sends messages down the USB cable to the Arduino, which then uses these signals to control the floppy drives.

Unfortunately, the original program had some limitations – it only played a certain subset of notes, but I decided to modify the code to include all possible notes in our MIDI files. However, this modification has introduced an unexpected issue: sometimes the program gets stuck and won't play music at all!

To fix this problem, we simply need to pull out the power from the Arduino and wait for a few moments before trying again. This is a good reminder that even with our advanced system, there's still room for improvement – and perhaps some work needs to be done on the code itself.

The Joy of Experimentation

One of the best things about working on this project has been the opportunity to experiment with different settings and parameters. As we've dragged sliders around the interface, we've discovered new sounds and effects that we never would have encountered otherwise.

For example, when I adjusted the pitch slider, I noticed that the drive was moving very slowly at low frequencies – a fact that wasn't immediately apparent from just listening to the music! This has given us some interesting insights into the way our system works, and it's also led us to discover new ways of controlling the drives.

Of course, this level of experimentation can be frustrating at times. As we've seen with the occasional stuck program, there are still challenges to overcome when working with complex systems like ours. But overall, the process has been incredibly rewarding – and it's a testament to the power of creativity and experimentation in music-making.

"WEBVTTKind: captionsLanguage: enas with all these things I saw a video on YouTube of something similar and decided I'd like to do it myself just for just see if I could do it I'm Alex I'm a PhD student in computer science here at notingham and we're looking at my musical floppy drives about 18 months ago I came across a video on YouTube of something similar some guy had taken a load of floppy drives and made them play music and I thought I could do that in each of the floppy drives there's a stepper motor which drives the the read right heads up and down so in the 3 and a half inch floppy drives these ones the SE Motors these little round things here and that rotates and it moves the read right head in and out each of these stepper Motors the small ones here and on the 5 and a/4 in drive it's well there we go it's a very big motor the disc for the 3 and 1 half in floppy discs is divided into 80 tracks radially from the center and on the 5 and a/ qu in disc originally there I think they had 40 tracks there are high density ones that can have 80 tracks so in fact this drive has got a switch on the front so you can switch between 40 tracks or 80 tracks the read head can move up one step at a time up to 80 steps what we're doing is pulsing the motor you pulse it at the rate of the note you want to play so um every musical note has a certain frequency so you just pulse the the motor at that frequency when you had a floppy disc in your computer you hear it making noises um you get a similar effect with inkjet printers as they go up and down in this case we're explicitly controlling the speed at which it's running so normally it doesn't really matter as long as it does the right amount of steps and it does everything in the right order um in this case we want it to go exactly at the right frequency so it makes exactly the right note on an ID hard drive like this it looks fairly similar to a floppy Drive connector there's a few more pins I guess but on this the controller is on the hard dis itself so it's somewhere on one of these chips now what that means is when this is plugged into a motherboard the motherboard just says read me this bit of data from from this position and the hard driver will know how to do that it goes off and Spins the right place and sends you the data back on a floppy drive like this the controller is on the motherboard so there's nothing very clever on the floppy Drive what that means is it's a lot easier for us to tell the floppy Drive what to do in terms of making the motor move directly on each of these floppy drives you will see there are uh two connectors going in there's the power connector which is this these ones so that's just a power the drive the other cable you'll see is a ribbon connector the cables coming out of these ribbon cables see there's two blacks a green and a blue the blacks are just ground the green and the blue one is Step um one is Direction okay so if the direction pin uh is held low it will move in One Direction and when it's held high so probably at 5 volts it will move in the other direction and the step pin whenever you pulse that it will move one step in the direction of the direction pin all these cables they plug into this Arduino here an Arduino is it's almost like a small computer on the board it's not quite that but it's a small programmable board it's got all sorts of input and output pins a lot of hobbyists use it in little projects to make robots work or there's a whole community of people out there that use arduinos to do things the Arduino has got a little program running on it which is talked to by another program on the computer down this USB cable so on my computer uh it's a Java program and that sends messages down the USB to the uino it sends one message per drive and it tells it when to start a drive going and what frequency to make it run and when to stop it there'll be thousands of messages being sent down the USB cable per second each of the floppy drives the readr head can only be in one of 80 places okay and the Java program doesn't really know that so it doesn't know when to flip the direction pin what the Arduino does that keeps track of the position of the drive so you just tell it to make this drive run at this frequency and the Arduino will know exactly which position each Drive head's in and nowh to reverse it if you didn't do that it would get to the end and it would just go um you know it would just sort of jam up against the end I guess the Arduino has it's kind of abstracted away the complexity of the floppy drive so the pro program on the computer doesn't need to know anything about the floppy drives it just says play this note for this long the software itself reads MIDI files it's literally just a sequence of notes and a mid you can have lots of different channels each separate channel can have a separate instrument so you know track zero could be a piano track one could be a trumpet something like that unfortunately with the floppy drives they all sound the same and we can't really do anything about that in a midi file you can control the volume of each node as well whereas again the floppy drives you can't really do that they play at one volume I didn't write this code um the guy who uploaded the original video I saw um had uploaded some code um both the uino and um and around the computer in Java so I I've edited bits of it rather than having to edit the MIDI files I can just drag some sliders around this is the program here so I can load flight the Bumblebee this is a bit ey added one of the drives is particularly loud what this allows us to do is to change drive two to play channel uh one so if he wants to now I think fly to the Bumblebee uses Channel One and two predominantly so I'll just swap these around a bit okay and also what we've got here um we've got two sliders this one lets us transpose the notes so that means to put them up or down in Pitch if you like I can fiddle with it while it's playing and you'll be able to hear it I put the slider down to the bottom so it's playing Five V CU lower than it should be so the first thing I'll notice is the drive is moving very slowly and making a very well very nice noise so the drives aren't very good at playing low notes we found that out I guess so I can put it back up a few octaves the driv start moving faster and if I put it up even further I think this is the point where we start to break the stepper Motors and I've seem to have done something horrible to it oh no it's finished right okay so um yeah sometimes it does that right I'll just pull the power out there we go hopefully that'll reset itself now there certainly are some limitations the original program would only play a certain subset of notes but I decided why not put them all in um I think we've discovered why why not now well that's supposed to have stopped but um something's got lost somewhere oh well there we go fixedas with all these things I saw a video on YouTube of something similar and decided I'd like to do it myself just for just see if I could do it I'm Alex I'm a PhD student in computer science here at notingham and we're looking at my musical floppy drives about 18 months ago I came across a video on YouTube of something similar some guy had taken a load of floppy drives and made them play music and I thought I could do that in each of the floppy drives there's a stepper motor which drives the the read right heads up and down so in the 3 and a half inch floppy drives these ones the SE Motors these little round things here and that rotates and it moves the read right head in and out each of these stepper Motors the small ones here and on the 5 and a/4 in drive it's well there we go it's a very big motor the disc for the 3 and 1 half in floppy discs is divided into 80 tracks radially from the center and on the 5 and a/ qu in disc originally there I think they had 40 tracks there are high density ones that can have 80 tracks so in fact this drive has got a switch on the front so you can switch between 40 tracks or 80 tracks the read head can move up one step at a time up to 80 steps what we're doing is pulsing the motor you pulse it at the rate of the note you want to play so um every musical note has a certain frequency so you just pulse the the motor at that frequency when you had a floppy disc in your computer you hear it making noises um you get a similar effect with inkjet printers as they go up and down in this case we're explicitly controlling the speed at which it's running so normally it doesn't really matter as long as it does the right amount of steps and it does everything in the right order um in this case we want it to go exactly at the right frequency so it makes exactly the right note on an ID hard drive like this it looks fairly similar to a floppy Drive connector there's a few more pins I guess but on this the controller is on the hard dis itself so it's somewhere on one of these chips now what that means is when this is plugged into a motherboard the motherboard just says read me this bit of data from from this position and the hard driver will know how to do that it goes off and Spins the right place and sends you the data back on a floppy drive like this the controller is on the motherboard so there's nothing very clever on the floppy Drive what that means is it's a lot easier for us to tell the floppy Drive what to do in terms of making the motor move directly on each of these floppy drives you will see there are uh two connectors going in there's the power connector which is this these ones so that's just a power the drive the other cable you'll see is a ribbon connector the cables coming out of these ribbon cables see there's two blacks a green and a blue the blacks are just ground the green and the blue one is Step um one is Direction okay so if the direction pin uh is held low it will move in One Direction and when it's held high so probably at 5 volts it will move in the other direction and the step pin whenever you pulse that it will move one step in the direction of the direction pin all these cables they plug into this Arduino here an Arduino is it's almost like a small computer on the board it's not quite that but it's a small programmable board it's got all sorts of input and output pins a lot of hobbyists use it in little projects to make robots work or there's a whole community of people out there that use arduinos to do things the Arduino has got a little program running on it which is talked to by another program on the computer down this USB cable so on my computer uh it's a Java program and that sends messages down the USB to the uino it sends one message per drive and it tells it when to start a drive going and what frequency to make it run and when to stop it there'll be thousands of messages being sent down the USB cable per second each of the floppy drives the readr head can only be in one of 80 places okay and the Java program doesn't really know that so it doesn't know when to flip the direction pin what the Arduino does that keeps track of the position of the drive so you just tell it to make this drive run at this frequency and the Arduino will know exactly which position each Drive head's in and nowh to reverse it if you didn't do that it would get to the end and it would just go um you know it would just sort of jam up against the end I guess the Arduino has it's kind of abstracted away the complexity of the floppy drive so the pro program on the computer doesn't need to know anything about the floppy drives it just says play this note for this long the software itself reads MIDI files it's literally just a sequence of notes and a mid you can have lots of different channels each separate channel can have a separate instrument so you know track zero could be a piano track one could be a trumpet something like that unfortunately with the floppy drives they all sound the same and we can't really do anything about that in a midi file you can control the volume of each node as well whereas again the floppy drives you can't really do that they play at one volume I didn't write this code um the guy who uploaded the original video I saw um had uploaded some code um both the uino and um and around the computer in Java so I I've edited bits of it rather than having to edit the MIDI files I can just drag some sliders around this is the program here so I can load flight the Bumblebee this is a bit ey added one of the drives is particularly loud what this allows us to do is to change drive two to play channel uh one so if he wants to now I think fly to the Bumblebee uses Channel One and two predominantly so I'll just swap these around a bit okay and also what we've got here um we've got two sliders this one lets us transpose the notes so that means to put them up or down in Pitch if you like I can fiddle with it while it's playing and you'll be able to hear it I put the slider down to the bottom so it's playing Five V CU lower than it should be so the first thing I'll notice is the drive is moving very slowly and making a very well very nice noise so the drives aren't very good at playing low notes we found that out I guess so I can put it back up a few octaves the driv start moving faster and if I put it up even further I think this is the point where we start to break the stepper Motors and I've seem to have done something horrible to it oh no it's finished right okay so um yeah sometimes it does that right I'll just pull the power out there we go hopefully that'll reset itself now there certainly are some limitations the original program would only play a certain subset of notes but I decided why not put them all in um I think we've discovered why why not now well that's supposed to have stopped but um something's got lost somewhere oh well there we go fixed\n"