Could I create music by typing in enormous strings of 1s and 0s?

I know that practically, this is impossible, but imagining that I was immortal and this was my focused task, could I open up some computer program, type in an immense string of 0s and 1s, and have music come out? Does such a program exist?

I think this depends a lot on what you’re defining music as (which would be a thread in and of it self…think John Cage 00000000000000000000…). If you mean could you make a file of nothing but ones and zeros and have it actually be a recognizable SONG, well if that’s what your asking, I would suggest you check out one of the shakespere/monkey threads for some insight (there’s a recent one, but I haven’t kept up with it). Don’t forget, all files on your computer mp3, exe, cab are, in their lowest level, just big giant strings of ones and zeros. The computer transforms them into hexadecimal to make them slightly easier to read, but they are just ones and zeros

Sure, in theory. Hell, you could have CD-quality 5.1 stereo surround music come out, if you wanted and knew which bits should be 1s and which should be 0s. After all, the music encoded on CD is essentially nothing more than very long string of 1s and 0s. I don’t think any program exists specifically to allow one to do this, but it wouldn’t be very hard to make one, were one so inclined. Basically, it would just save your binary bits into a file, then read the contents of that file into a digital-to-analog converter, just like a CD player does. The real trick, in practice, would be knowing WHEN to type a 1 and when to type a 0. I’m not sure any human could do that on the fly and have anything resembling music emerge when all was said and done.

Sweet. I just mean in the sense that sound will come out, and i’d be able to manipulate that sound. What I don’t get it, how does a 1 or a 0 in anyway represent a specific sound? Perhaps something to do with pitch?

If you use Lilypond notation and convert the ascii characters to binary, then…

Beethoven’s Ode To Joy theme (in C major) is:
11001011100101110011011001111100111110011011001011100100110001111001001100101110010111001001100100

Individually, they don’t. The 1s and 0s are combined in groups of 8, 16 or maybe 32 bits (or whatever makes sense to the DAC being used). A group of 8 bits can represent a number from 0 to 255, and this, in turn, represents a voltage level. 0 would be the lowest and 255 would be the highest. Stringing different voltage levels together can create different waveforms when they are applied to a speaker. If you take points on a sine wave representing a sound you wish to encode, and convert them to numbers representing the amplitude (voltage) at the given points, you can then play those numbers back through the
DAC to reproduce that sine wave through a speaker. More complex sounds have more complex waveforms, but the principle is the same.

Ignore me if I’m talking nonsense, but this does point out to me the two approaches to be taken. One is this, which I’d call the “vector” approach: the notes (themelves representing sounds of set frequencies) are translated into a conventional set of characters which can further be represented in binary bits.

The other, which for the sake of analogy, I’d call “bitmap” - or maybe “pure digital”, is the approach where the voltage used to push the computer’s speakers in and out is translated into values represented in binary bits, 1s and 0s.

The first is a lot more stylized, crams a lot more into a smaller number of symbols, and is thus maybe “easier” for the OP. The second would take a lot more effort, but could theoretically reproduce many kinds of sound more faithfully.

Thanks for your patience. I’m just trying to get this straight in my own mind.

As Q.E.D points out, the individual bits (1s and 0s) don’t represent specific sounds per se–the bit rate determines the smallest meaningful “chunk” of data, so even though the data can be represented as a binary string, it makes more sense to think of it as a string of numbers between 0 and n, depending on the bit rate. So you could visualize an 8-bit sequence as something like:

123 004 234 232 045 130

Obviously as the bit rate goes up, the sounds can be expressed with finer and finer detail. So if you actually did have a 2-bit sample, it would be very, very strange to listen to since virtually no detail of the original sound would be preserved.

But keep in mind that we’re talking about digital audio, as opposed to a notational system such as Lilypond, or an encoding strategy like MIDI. In the latter, qualities of the sound are encoded as a series of time-coded binary “messages” which describe changes in different qualities of what we call sound: pitch, attack, timbre, etc.

Basically, yes. And when you compare the size of a MIDI file to an analogous WAV or even MP3 file, you’ll notice the MIDI files is much, much smaller.

I don’t get it.

Would you be trying to create a two note song or is the computer going to assign different notes to your series of 1’s and 0’s?

Actually, it is possible to create rather accurate sounds using only 1 bit (on or off). You can create different signal levels by varying the on and off time and using a filter to smooth out the output. Want 75% output? Just vary the signal so it’s on 75 percent of the time and off 25% of the time. How many bits of resolution you have in your output depends on how many times you can change the bit within the time period set up by your filter hardware.

I programmed an apple II computer using only a monitor (not an assembler) to punch in the opcode numbers, many many years ago. It was a rather painful experience, but an assembler wasn’t in the budget. I can’t imagine typing in numbers to make music.

Well, except for Stanley Kubrick and the background theme for Eyes Wide Shut…

Of course, “resembling music” might be the contested phrase in this example. :wink:

Sounds like my story, although I had a Trash 80 Color computer, and like you no budget for an assembler. Those relative jumps in machine code sure were annoying when you needed to insert a few more operations between the jump location.

I had lots of fun sending numbers to the DAC. I set up a program that would let me set different variables to create different patterns over time, it sounded just like a synthesizer.

PWM[sup]*[/sup] amplifiers (also known as ‘full-digital’ or sometimes ‘Class D’ ) are somewhat popular these days in certain applications, mostly for their high efficiency. The quality is somewhat dependent on the output filter, though it doesn’t have to be very high order, since the switching frequencies are usually in the hundred kHz range.

You do realize that you need to type those strings in pretty fast if you want real-time playback, right?

[sup]*[/sup]Pulse Width Modulation, essentially the one-bit DACs being referred to. Music encoded on e.g. an audio CD is PCM, Pulse Code Modulation, using 8 or 16-bit numbers. Then again the actual information on the CD are encoded with 14 channel(?) bits - pit/land transitions - for 8 data bits, plus a lot of error correction data with the music.

I have a tangentially related story. Back in the late 70’s / early 80’s I was working as an assembly language programmer. One of the [del]nerds[/del] engineers working there took the time to analyze the frequency of the RF emissions that the computer generated when each instruction was executed. He wrote a program that when executed with an AM radio nearby would play Beethoven’s Ode to Joy.

You can also use Sony’s 1bit Direct Stream Digital system. A 1 represents positive voltage, a 0 negative voltage, and alternating them is zero voltage. With a very high sample rate you can replicate wave forms, like they do here check the chart half way down the page.


  • And it’s not “1’s and 0’s”, but the program SoundProbe has a feature where you can zoom in on a waveform and actually “re-draw” any part of it with the mouse acting as a pen tool. So with that you could draw an entire song if you wanted with this program, but I doubt it would sound very nice. This “drwing” was only really good for flattening out individual pops. The program works perfectly, but if I tried to re-draw any length of waveforms, they were never anywhere near conisistent enough and the results always sounded lousy.
    ~

Another anectdote: The Apple II had a 1 bit audio system (the speaker was tied to a particular memory address). I had a program that played the theme to “Greatest American Hero” ("Believe it ir not, I’m walking on air…’). It wasn’t very good quality (staticy), but it was clearly recognizeable.

Brian

vinniepaz if you can be bothered you could work out the probability of coming up with your favourite CD by stringing together random binary digits. And you could factor in your bit generation rate to work out (on average) how long this would take. I wouldn’t hold your breath.

Alternatively, you could try the analogue approach. Listen to random analogue noise (like the static between FM radio stations) and see what tunes emerge.

I suppose it’s a bit like the Infinite Number Of Monkeys/Shakespeare problem. It’s not something that’s practically solvable.

You could try another approach. Make a random number generator, where the numbers generated are between set limits. Assign numbers to musical notes, and set it going. Another random number generator could set note length, a third timbre, and so on. Simple versions of this sort of thing were a feature on many analogue synthesisers, and sounded like music for deranged robots.

Like everyone is saying technically it is possible. Realisticly no. When you make a telephone call you have an analog signal back to the phone company who then digitized it, and sent it over a digital link to the closest switch to the recieving end. It would then convert it back, and send the analog signal to the other phone.

In the old days the digital signal was 64Kbits/sec (these days they use compression, etc to make it much smaller). The phone company took a sample of the analog signal 8000 times a second. The sample was encoded into 1 byte. Therefore 8000 samples x 8bits per sample = 64Kbits per second.

So following those rules you would need to type 64Kbits for 1 second of sound. Of course there are other techniques out there that can reduce that, but you are still going to be typing 1s and 0s for a long time. Then what happens when you loose your place and can’t remember where you were? Start all over? /shudder. I’ll just let the electronics handle the conversion.

-Otanx