The THX Sound
musicthing.blogspot.co.uk
musicthing.blogspot.co.uk
the THX sound was created by a synthesis program that was probably quite substantial itself (I have long been under the impression that it was a MUSIC-N derivative, and Moorer's description seems to confirm it) and, I'm guessing, probably not written in C. The input to this program was itself generated by a 20KLoc C program.
EDIT: i figured "i don't have to explain music-n, people can just look it up" but i just read the wikipedia article and i think that explanation only makes sense if you already know what it is. so...
MUSIC is a software synthesizer by Max Mathews, considered the father of computer music synthesis. It consists of a library of 'unit generators' and an orchestra/score processing system for using them. The "orchestra" file is used to define "instruments", basically parameterized combinations of unit generators, which themselves are basic synthesis building blocks (say, a square wave generator, or in the case of the THX sound, a wavetable oscillator).
The orchestra is controlled by a score, also known as a note list. This is just a series of statements saying, basically, "start playing instrument N at time T with parameters X,Y,Z".
MUSIC was followed by MUSIC-II, MUSIC-III, etc, hence the name "MUSIC-N". Basically every extant software synthesis package is derived from MUSIC-N on some level, but Csound is the most direct descendant.
I would argue that if the C program didn't "create" the sound that it was certainly the musician responsible.
Fundamentally though, you are of course correct. This was a mainframe in the 80s, so presumably there was an operating system and system libraries and they all played a part, so should we credit those developers as well? it's tortoises all the way down.
Composers have a 'musical imagination' and often write at the keyboard of (typically) a piano. Classical composers sometimes write music that is not 'idiomatic' for a particular instrument; adjustments follow. From the original article it seems as if the composer had a definite idea of what he was after and adjusted things until he got close.
What interests me about the original anecdote is the use of random numbers in the parameters, and the difficulty that the composer had in reproducing a particular 'state' of the sample.
I'm pretty sure he has far more interesting stories to tell than this, and he is pretty hot on the banjo.
"it was a 7 line Perl script that generated 20k lines of c that generated inputs for whatever"
(definst thx [gate 1]
(let [target-pitches (map midi->hz [77 74 72 70 65 62 60 58 53 50 46 34 26 22 14 10])
r-freq (env-gen:kr (envelope [1 1 0.007 10] [8 4 2] [0 -4 1] 2) gate)
amp-env (env-gen:kr (envelope [0 0.07 0.21 0] [8 4 2] [0 1 1] 2) gate :action FREE)
mk-noise (fn [ug-osc]
(mix (map #(pan2 (ug-osc (+ (* r-freq (+ 230 (* 100 (lf-noise2:kr 1.3))))
(env-gen:kr (envelope [0 0 %] [8 6] [0 -3]))))
(lf-noise2:kr 5))
target-pitches)))
saws (mk-noise saw)
sins (mk-noise sin-osc)
snd (+ (* saws amp-env) (* sins amp-env))]
(* 0.5 (g-verb snd 9 0.7 0))))
https://github.com/overtone/overtone/blob/master/examples/th...
http://overtone.github.com/http://www.folklore.org/projects/Macintosh/more/BootBeep.txt
And the story:
What I don't quite get is that the asm code seems to start with a sharp square wave that smoothens off as time passes, but in that video the first sound already sounds very smooth in the beginning.
"Square wave sounds. Unknown to most, the square wave synthesizer never produced
true square waves. It was more like a modified sine wave. This has been corrected.
As a result you'll notice that the Simple Beep sounds different. It can now be
heard as it was originally designed to sound."This will make more sense if you see the spectrum; I've put a picture of the spectrum at: https://picasaweb.google.com/lh/photo/qbuyIVSC2Bsvgxg5HlSD4-... Time is the X axis, and frequency is the Y axis. The lines that move in parallel are harmonic frequencies.
((1000/((t/12)%(t>>10))&1)35 + (1000/((t/23)%(t>>10))&1)35)
Link to generate (using javascript) and hear the sound above: http://bit.do/thx-first-try
More sounds created like using those simple equations: http://js.postbit.com/digital-computer-music-with-bitwise-op...
And discussion from a few years ago: http://news.ycombinator.com/item?id=725564
Don't miss their Deep Note SuperCollider one-liner at the end: "play{Mix({|k|k=k+1/2;2/kMix({|i|i=i+1;Blip.ar(iXLine.kr(rand(2e2,4e2),87+LFNoise2.k"
• Putting a couple of spaces before your formula so the markup processor doesn't chew it up.
• Using Darius Bacon's bytebeat player instead of the old Wurstcaptures one: http://wry.me/bytebeat/?code0=((1000%2F((t%2F12)%25(t%3E%3E1...
If you want to approximate the original more closely, I think you might need sine-wave oscillators rather than square waves. You can get a pretty decent bytebeat sine wave from http://wry.me/bytebeat/?code0=((t%2615)*(-t%2615)%5E!(t%2616..., but most of the time I use a triangle wave instead when the standard sawtooth is too harsh.
I'd like to point out that your bytebeat isn't actually using bitwise operators in any non-arithmetic way; it's equivalent to http://wry.me/bytebeat/?code0=((floor(1000%2F((t%2F12)%25flo..., and in C you can leave out the occurrences of "floor".
The Music Thing blog has some other great posts about music and instrument hacks.
The reference to the C code is here:
"The score consists of a C program of about 20,000 lines of code. The output of this program is not the sound itself, but is the sequence of parameters that drives the oscillators on the ASP. That 20,000 lines of code produce about 250,000 lines of statements of the form "set frequency of oscillator X to Y Hertz".
The original file was found in the US Patent and Trademark Office: http://tdr.uspto.gov/search.action?sn=74309951
But I agree with the sentiment, that's really interesting.
And it isn't merely generated by a pseudo-random process, it's generated by code written and adjusted to produce a sound within certain parameters, with variation within those parameters provided by pseudo-random perturbations.
That said, I'm sure you could also record the sound of birds chirping in the dawn chorus, with even less input from the recording individual other than selecting a particular portion of the recorded audio, and copyright that.