Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pacbell!att-ih!alberta!auvax!rwa From: rwa@auvax.UUCP (Ross Alexander) Newsgroups: comp.arch Subject: Re: Computer noises (was Re: Cray architecture) Message-ID: <583@auvax.UUCP> Date: 31 Mar 88 19:59:00 GMT References: <7762@alice.UUCP> <418@ole.UUCP> <3216@phri.UUCP> <1574@osiris.UUCP> <1503@vaxb.calgary.UUCP> Organization: Athabasca U., Alberta, Canada Lines: 70 Summary: it _can_ be done In article <1503@vaxb.calgary.UUCP>, radford@calgary.UUCP (Radford Neal) writes: > I have a vague recollection back from when I was a first-year student > (1974) of someone demonstrating a program for the PDP-8 that played a quite > good rendition of some piece of music on a radio placed beside the > CPU. In retrospect, this seems moderately unlikely, though not impossible. and continues by observing that it would be difficult to fit enough information into a 4k pdp8 to allow more than 10 seconds of music, assuming 6k samples/second. True enough; but that's not how it's done ;-). The basic code is something like .=0010 MUSICP, MUSIC / autoincrement pointer to list of notes .=0200 / code lives on page 1 CLA / 0 --> accumulator PLAY, TLS / essentially, start a 1/10 second timer :-) TAD I MUSIC / get next note code TAD DELAYL / convert to index into delay list DCA DELAYP / save address of delay count PAUSE, TAD I DELAYP / refresh delay counter DCA STALL ISZ STALL / sleep for a while JMP .-1 TSF / has timer expired yet ? ****** JMP PAUSE / no, go stall some more JMP PLAY / yes, get next note STALL, 0 / sleep counter DELAYP, 0 / pointer into delay list DELAYL, DELAYS / constant to form above pointer DELAYS, 0100 / these values are clearly incorrect 0200 0300 . . . MUSIC=0400 / list of notes starts on page 2 END The reason this works (aside from coding errors; it's been _years_!) is that the TSF (marked with the asterisks above) induces a spike of RF energy as a side effect. If you sleep 1/4000 second, do a TSF, and loop back to the sleep, a radio will produce a 4 kilohertz tone. After 1/10 second, the TSF will skip over the JMP PAUSE and we will advance to the next note. This basic technique can be extended ( there is room for both a duration and a note code in each 12-bit word, for example ) get better encoding and also more than one voice; three voices is doable but tricky. You can also do a light show in the accumulator display while you're at it - this is really impressive. I sure wish we had an 8 in the machine room nowadays - it would add a nice traditional touch that's lacking (the vaxen are visually boring). Ross Alexander, Athabasca University alberta!auvax!rwa