Musical Floppy Drives - Computerphile

Computerphile · Intermediate ·🌐 Frontend Engineering ·13y ago

Key Takeaways

This video showcases a project where floppy disk drives are used to play music, with the help of an Arduino board and a Java program, demonstrating the principles of stepper motors, frequency control, and MIDI file playback.

Full Transcript

as 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 [Music] 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 [Music] 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 [Music] now well that's supposed to have stopped but um something's got lost somewhere oh well there we go fixed

Original Description

Floppy disk drives make sweet music, well, tuneful noises anyway. You might have seen them on YouTube before, but how do they work? Now you can find out! Featuring Alex Pinkney from the University of Nottingham's Department of Computer Science. http://bit.ly/nottscomputer Alex originally saw these videos: http://www.youtube.com/user/Sammy1Am http://www.youtube.com/user/MrSolidSnake745 The code, written by Sammy1Am is available online here: http://github.com/SammyIAm/Moppy/ Follow Computerphile... http://www.facebook.com/computerphile https://twitter.com/computer_phile Video by Sean Riley. Computerphile is a sister project to Brady Haran's Numberphile. See the full list of Brady's video projects at: http://periodicvideos.blogspot.co.uk/2012/06/here-are-my-channels.html
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Computerphile · Computerphile · 3 of 60

1 Follow the Cookie Trail - Computerphile
Follow the Cookie Trail - Computerphile
Computerphile
2 EXTRA BITS - Follow the Cookie Trail - Computerphile
EXTRA BITS - Follow the Cookie Trail - Computerphile
Computerphile
Musical Floppy Drives - Computerphile
Musical Floppy Drives - Computerphile
Computerphile
4 The Hair Algorithm - Computerphile
The Hair Algorithm - Computerphile
Computerphile
5 Getting Sorted & Big O Notation - Computerphile
Getting Sorted & Big O Notation - Computerphile
Computerphile
6 Quick Sort - Computerphile
Quick Sort - Computerphile
Computerphile
7 Hyper History and Cyber War - Computerphile
Hyper History and Cyber War - Computerphile
Computerphile
8 Entropy in Compression - Computerphile
Entropy in Compression - Computerphile
Computerphile
9 Original Elite on the BBC B - Computerphile
Original Elite on the BBC B - Computerphile
Computerphile
10 IP Addresses and the Internet - Computerphile
IP Addresses and the Internet - Computerphile
Computerphile
11 A Career in Video Games - Computerphile
A Career in Video Games - Computerphile
Computerphile
12 Error Detection and Flipping the Bits - Computerphile
Error Detection and Flipping the Bits - Computerphile
Computerphile
13 Programming BASIC and Sorting - Computerphile
Programming BASIC and Sorting - Computerphile
Computerphile
14 Birthplace of the World Wide Web - Computerphile
Birthplace of the World Wide Web - Computerphile
Computerphile
15 Punch Card Programming - Computerphile
Punch Card Programming - Computerphile
Computerphile
16 Programming Paradigms - Computerphile
Programming Paradigms - Computerphile
Computerphile
17 CERN Computing Centre (and mouse farm) - Computerphile
CERN Computing Centre (and mouse farm) - Computerphile
Computerphile
18 Error Correction - Computerphile
Error Correction - Computerphile
Computerphile
19 Home-Made Code - Computerphile
Home-Made Code - Computerphile
Computerphile
20 Security of Data on Disk - Computerphile
Security of Data on Disk - Computerphile
Computerphile
21 Gesture Controls - Computerphile
Gesture Controls - Computerphile
Computerphile
22 How Intelligent is Artificial Intelligence? - Computerphile
How Intelligent is Artificial Intelligence? - Computerphile
Computerphile
23 Encryption and Security Agencies - Computerphile
Encryption and Security Agencies - Computerphile
Computerphile
24 Virtual Machines Power the Cloud - Computerphile
Virtual Machines Power the Cloud - Computerphile
Computerphile
25 Hacking Websites with SQL Injection - Computerphile
Hacking Websites with SQL Injection - Computerphile
Computerphile
26 How Huffman Trees Work - Computerphile
How Huffman Trees Work - Computerphile
Computerphile
27 Cracking Websites with Cross Site Scripting - Computerphile
Cracking Websites with Cross Site Scripting - Computerphile
Computerphile
28 Cloud Computing (Cloudy with a Chance of Pizza) - Computerphile
Cloud Computing (Cloudy with a Chance of Pizza) - Computerphile
Computerphile
29 Texting Cabbage with a Recorder - Computerphile
Texting Cabbage with a Recorder - Computerphile
Computerphile
30 Hashing Algorithms and Security - Computerphile
Hashing Algorithms and Security - Computerphile
Computerphile
31 How YouTube Works - Computerphile
How YouTube Works - Computerphile
Computerphile
32 How NOT to Store Passwords! - Computerphile
How NOT to Store Passwords! - Computerphile
Computerphile
33 A New Golden Age of Video Games - Computerphile
A New Golden Age of Video Games - Computerphile
Computerphile
34 A Universe of Triangles - Computerphile
A Universe of Triangles - Computerphile
Computerphile
35 Cross Site Request Forgery - Computerphile
Cross Site Request Forgery - Computerphile
Computerphile
36 The True Power of the Matrix (Transformations in Graphics) - Computerphile
The True Power of the Matrix (Transformations in Graphics) - Computerphile
Computerphile
37 The Great 202 Jailbreak - Computerphile
The Great 202 Jailbreak - Computerphile
Computerphile
38 EXTRA BITS - Printing and Typesetting History - Computerphile
EXTRA BITS - Printing and Typesetting History - Computerphile
Computerphile
39 Triangles to Pixels - Computerphile
Triangles to Pixels - Computerphile
Computerphile
40 The Problem with Time & Timezones - Computerphile
The Problem with Time & Timezones - Computerphile
Computerphile
41 The Visibility Problem - Computerphile
The Visibility Problem - Computerphile
Computerphile
42 Lights and Shadows in Graphics - Computerphile
Lights and Shadows in Graphics - Computerphile
Computerphile
43 The Penguin Barcode - Computerphile
The Penguin Barcode - Computerphile
Computerphile
44 Typesetters in the '80s - Computerphile
Typesetters in the '80s - Computerphile
Computerphile
45 The Font Magicians - Computerphile
The Font Magicians - Computerphile
Computerphile
46 The Little Mac with the Big Bite - Computerphile
The Little Mac with the Big Bite - Computerphile
Computerphile
47 EXTRA BITS - More on the Original Mac at 30 - Computerphile
EXTRA BITS - More on the Original Mac at 30 - Computerphile
Computerphile
48 XP to Ubuntu with an 8yr old Hacktop - Computerphile
XP to Ubuntu with an 8yr old Hacktop - Computerphile
Computerphile
49 EXTRA BITS - Hacktop Real-Time Boot Comparison - Computerphile
EXTRA BITS - Hacktop Real-Time Boot Comparison - Computerphile
Computerphile
50 EXTRA BITS - Making a Bootable USB in Linux - Computerphile
EXTRA BITS - Making a Bootable USB in Linux - Computerphile
Computerphile
51 EXTRA BITS - Installing Ubuntu Permanently - Computerphile
EXTRA BITS - Installing Ubuntu Permanently - Computerphile
Computerphile
52 The Dawn of Desktop Publishing - Computerphile
The Dawn of Desktop Publishing - Computerphile
Computerphile
53 What is Bootstrapping? - Computerphile
What is Bootstrapping? - Computerphile
Computerphile
54 Reverse Polish Notation and The Stack - Computerphile
Reverse Polish Notation and The Stack - Computerphile
Computerphile
55 Home-Made Z80 Retro Computer - Computerphile
Home-Made Z80 Retro Computer - Computerphile
Computerphile
56 Should Everybody Learn to Code? - Computerphile
Should Everybody Learn to Code? - Computerphile
Computerphile
57 Programming in PostScript - Computerphile
Programming in PostScript - Computerphile
Computerphile
58 Heartbleed, Running the Code - Computerphile
Heartbleed, Running the Code - Computerphile
Computerphile
59 YouTube's Secret Algorithm - Computerphile
YouTube's Secret Algorithm - Computerphile
Computerphile
60 YouTube Search & Discovery - Computerphile
YouTube Search & Discovery - Computerphile
Computerphile

This video demonstrates how to use floppy disk drives to play music using an Arduino board and a Java program, showcasing the principles of stepper motors and frequency control.

Key Takeaways
  1. Connect the floppy drives to the Arduino board
  2. Write a Java program to control the Arduino and play MIDI files
  3. Configure the program to control the frequency of the stepper motors
  4. Test and refine the setup to achieve the desired sound quality
💡 The project demonstrates how to abstract away the complexity of the floppy drives using the Arduino board, allowing the Java program to focus on playing the music without needing to know the details of the hardware.

Related AI Lessons

Up next
The masks we wear | Zora Krstić | TEDxLuxembourgCity
TEDx Talks
Watch →