Shop OBEX P1 Docs P2 Docs Learn Events
Hearing code? — Parallax Forums

Hearing code?

potatoheadpotatohead Posts: 10,261
edited 2009-10-12 16:35 in General Discussion
http://cessu.blogspot.com/2008/09/have-you-listened-to-your-program-today.html

This is absolutely brilliant! I'm sure many of us have put radios next to computers, particularly older ones, to hear notes as programs did their work. This guy took the results of adds and subtracts, assigned bit values to notes, then "recorded" some programs at a speed that lets you "hear" the code working, to the point of being able to recognize different kinds of operations, loops, lists, etc...

Enjoy. Just click on the little embedded player you see in the blog post.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-10-09 18:33
    One of the first programs written for the Altair was a radio next to the computer that played Daisy, Daisy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • icepuckicepuck Posts: 466
    edited 2009-10-09 19:01
    You could also do that with a C64 and 1541 disk drive. It used the stepper to bang the read/write head against the stops. Of course your drive would have to realigned afterwords.
    -dan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Arguing with myself--sometimes me, myself, and I don't always agree.
    (Former) Caterpillar product support technician
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-10-09 20:34
    I remember doing that to my poor 1541. Wow.. Yes IIRC it was the cause for alignment issues later. [noparse];)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • hover1hover1 Posts: 1,929
    edited 2009-10-09 20:50
    I spent 3 hours inputing that little program on my Altair till I got it right (in 1975).

    Jim
    Franklin said...
    One of the first programs written for the Altair was a radio next to the computer that played Daisy, Daisy.

  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-10 17:11
    Does anyone remember a little TSR hook program that you could write with the DEBUG program to make your hard-drive audible through the PC speaker? .... This was the response in the mid-80's early 90's to a complaint that the "NEW-er" hard drives were too quiet. There were many of us that missed the audible sound they gave off. In some cases it was this audible feedback that assured us that things were working properly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • kwinnkwinn Posts: 8,697
    edited 2009-10-10 17:36
    The first three music playing computers I heard personally:

    1969 - A PDP8 at the university programmed in machine language and used a simple resistor DAC on an output port.

    1971 - A Collins 8400 computer emulating an IBM1401 used 3 tape drives and the line printer to play tunes.

    1973 - A couple of high school juniors had written a Basic program on an HP2100 mini to play tunes on a radio.

    Of the three I was most impressed by the last one. Quite an accomplishment for a couple of high school juniors to get a computer
    running a Basic interpreter to generate music via RF interference.
  • kwinnkwinn Posts: 8,697
    edited 2009-10-10 17:43
    The prop can generate signals in the AM and FM band easily. Has anyone tried using that to produce audio output via a nearby radio on either band?
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-10 18:28
    I've been wanting to do that. An AM radio near the prop shows a lot of potential, just running stuff.

    Beau: Yes! My early computer being an Atari, made noise on disk access. It was possible to hear lots of subtle things, detect errors, etc... In fact, my first copy protection hack involved that. On ULTIMA II, there were about 19 - 23 disk accesses, then an error, then the game would load normally. On an ordinary disk, lacking the bad sector, the game would fail. So, count the beeps, open the door, wait for the error, close it, life is good! (they didn't check for the kind of error, only that there was an error)

    Early on, sounds were kind of important. This continued through keyboard clicks, disk access, phone modem, etc... One by one, needing those things slowly faded, where today, I find most sounds distracting. Running a computer off a solid state storage is amazing! It makes NO sound, other than the fan for heat. Clock down the CPU, and it's totally silent, and a laptop battery can hit 4 hours on some models doing that.

    The AM radio next to the prop can tell you whether or not it's hung waiting for a pin or the counter, vs running code, BTW. (Yes, I've done that once, lacking other debug means early on.)

    What I liked about this particular representation was the clarity of the sound. It is good enough to identify specific structures in the code, unlike just hearing similar noise patterns on a radio.

    1973: Very impressive!

    Sometime in the very late 80's, I was working in manufacturing on a CNC spot welder. It had the bare minimum program capability, enough to loop, branch, etc... I got it to play a few tunes with 100 program steps available. It was quite noisy as I used a combination of air valve clicks, and current strong enough to rattle the wires in the electrical conduit running across the shop floor to the machine. We figured each 10 second playing of the tune was probably costing us 10 bucks in power. Heh [noparse]:)[/noparse] A sustained draw would even dim the lights for that special theatrical introduction. A very large block of steel was the load needed to pull current. One block was good for a few plays before becoming too hot to handle otherwise. Shortly after that I ended up doing some advanced CNC programming for punch and laser machines. Go figure.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-10 18:46
    On a similar topic, Apple computers featured a speaker with one bit control. Assembly language loops that hammered on the click memory access spots (Apple had a name for this, which was interesting, and I can't remember) produced interesting sounds. In HS, we toyed with this, and noted many games derived their sounds from interesting program loops. Just insert the addresses at key points, and listen to see if it's appropriate.

    Ended up being stunned at the first programs to feature speech. "Castle Wolfenstien" was the first to do it! Later Electronic Arts published "Music Construction Set", that managed to play (mostly) 4 part harmonies on that same croddy old speaker.

    Fast forward to today, and we've got PWM audio that's good. And then this guy....

    http://mister_beep.republika.pl/

    parishq.net/proposed//sound/mister_beep-cpus_explosion.mp3 (one bit, 8 parts, 3.5Mhz Z80)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • kwinnkwinn Posts: 8,697
    edited 2009-10-10 19:01
    Potatohead, your mention of using sound for debugging reminds me of an early circuit I used for debugging code on 8080/Z80 S100 systems. The original idea came from an article in one of the computer/electronics magazine at the time, and I modified it slightly for my own use.

    The circuit was simplicity itself. The address on the bus was latched and decoded for display whenever a read occurred. The entire address was displayed in hex on a 4 digit 7 segment display, and the lowest 6 bits were decoded to light an individual led on an 8x8 led matrix simultaneously.

    It was amazing how helpful such a simple circuit was for debugging code. I wonder if the idea could be updated for use on todays chips.
  • potatoheadpotatohead Posts: 10,261
    edited 2009-10-10 19:15
    I personally like sounds. We've got absolutely great resolution. Very short events can be distinguished, down to ~20-50ms or so. For most people, frequencies are easily used in tandem to "see" multiple things occur, and we can hear rapid sonic events and recall them fairly well.

    Phil has always intrigued me with how he uses a scope for debug. I've an older analog one that can do this for loops, and it helped me with video related things. Still, having to look at something always seems to change my mental "state", where as hearing it seems to occur in tandem with whatever else I happen to be looking at, and I can recall it better too. Fast streams of visuals, like digits on LED's isn't something I can follow anywhere near as well as I can with sound, or some visual abstraction, such as a line graph, or pixel stream...

    The sonic version of that circuit could map the address space into 10Khz or so, and be quite useful, particularly if there was a scale, so one could "zoom" to discriminate between smaller address ranges. The really great discrimination with us runs from 100Hz, to about 8-10Khz. Sounds in that range are the best, particularly where there are multiple sound events all happening at once.

    Thinking out loud here has resulted in kind of an aural logic analyzer. Yeah, I would use it. Add a sample capability, and more scaling, and it might just be great for events under 20-50ms resolution.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-10-11 03:38
    In the sixties we used to play tunes on an IBM 1403 printer attached to an IBM 1401 computer that handled printed output from a 360/50.· Then the IBM 1403-N1 printer came out with a really good sound-deadening enclosure, alas, and we couldn't hear it any more.

    The 1403 was a chain printer, with the letters circulating rather fast on a print train, which was a chain somewhat like a bicycle chain.· In early models of the 1403, if you knew the order of the letters on the train, you could devise a printline that would cause all the hammers to strike simultaneously, all the way across the 133-character pirntline.· This usually broke the chain, and the Customer Engineers hated us students at the University of Florida.

    The 1403-N1 had not only the sound-deadening enclosure, but also protective logic so we couldn't break the print train any more.· Bummer.

    So instead we devised ways to defeat the MVT operating system's security and get into supervisor state so we could issue privileged instructions.· A DIAGNOSE instruction with certain operands could cause a machine check, which made life really exciting for the operators.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • kwinnkwinn Posts: 8,697
    edited 2009-10-11 16:50
    Carl, now that you mention it, that was an IBM 1403 chain printer attached to the Collins 8400, and it certainly did not have much sound deadening. I wonder if it might have been the same music program. The printer produced the notes and the tape drives provided the percussion.

    The music program was already there when I started that job and consisted of several decks of punch cards. A program deck and decks to place behind the program deck to play individual tunes.
  • kwinnkwinn Posts: 8,697
    edited 2009-10-11 16:57
    There was also a circuit using an address bus latch and 2 8 bit ADC's to drive the XY input on a scope for debugging. It gave you a pretty good idea of where the cpu was executing code in memory and how much time it was spending in loops and such.
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-10-11 20:51
    Probably not the same program, though the data to be printed may have been the same.· Ours was punched cards for the 1401, but the 360/50 program was in assembler 'cuz we liked assembler.· I did, anyway; still do, except Propeller assembler which is even wackier than PC assembler (if anything is wackier than PC assembler).

    On most of the 360 and 370·series you could get an idea of what the program was doing by watching lights on the front panel (if you had the machine to yourself and it wasn't running hundreds of programs at a time).· On the 3080-3081-3084 and 390 series most of the lights were omitted, being basically useless.

    On a 360/65 and 370/155·(others too), there was a switch on the panel (lamp test) that could turn all the lights off, or turn them all on, or make'em behave normally.· Each light (it was a big square array) was a plug-in lamp that you could pull out with your fingers so that it lost contact and stayed off.

    One time·our operators got bored, and heard that·a VIP tour was scheduled.· They pulled out all the lamps (several hundred of them), then pushed in selected lamps to spell TILT.· Then they turned the lamps off.

    When the VIPs came through, an operator manned the switch, very casually, and blinked the TILT display as the visitors approached, but quit when they got too near.· As soon as the visitors had passed, they pushed all the lamps in again and restored the switch to the normal position.

    Computers are fun.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-10-11 21:01
    Were you at Rockwell/Collins? I was a systems programmer there (Dallas) in the mid-1980s. If I remember right, we had a 3090 of some description and a couple 3084s, with several 1403-N1 printers. You could always push the OPEN button on the back of the 1403-N1 and the cover would open (it hoisted/folded upwards automatically) to listen -- or, more usually, to add paper and remove output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • LeonLeon Posts: 7,620
    edited 2009-10-11 21:06
    When I was a student working at LEO Computers in the early 1960s I was asked to design an audible monitor circuit for the new LEO III computer. It's mentioned here:

    en.wikipedia.org/wiki/LEO_computer

    It divided the input pulses by 100 using a diode pump circuit and a simulated unijunction transistor made from an NPN and PNP device (we couldn't actually buy UJTs at the time), and played the sound through an amplifier and speaker. The original LEO I also had an audible monitor, but it was so slow that it didn't need a divider.

    I also designed a logic probe, based on a 'staticiser' module, using one of the neon bulbs on the latch outputs to indicate the logic state of the input. The actual probe was made from a BIC ballpoint.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 10/11/2009 9:13:35 PM GMT
  • kwinnkwinn Posts: 8,697
    edited 2009-10-12 03:05
    Carl, I was at Collins Canada (in the east end of Toronto) from about 1971 to 1973. That was well before it was bought up by Rockwell. I started as a computer operator while still in university, did some programming, and became manager of computer operations just before they closed the computer department down. I returned for a few months about a year later to restart the computer department, but it was only a remote job entry terminal connected to the 370 in Cedar Rapids. I was at the Dallas facility once, in Cedar Rapids fairly often, and even got a ride on the company DC3 a couple of times. Talk about a nerve wracking flight. Here I am the new guy just out of school, and riding on tha same plane as Mr. Collins himself, the VP of this, director of that, and head of something else. By the time I got off the plane I was so nervous the only thing I could remember was Mr. Collins being on the flight. They were all very friendly and tried to put me at ease, but it was a bit much for me at the time.

    Leon, the early 60`s to the mid 80`s was a period of incredible creativity in computers and electronics. An awful lot of the circuits and products I see now are based on ideas from that time frame.
  • LeonLeon Posts: 7,620
    edited 2009-10-12 09:22
    The LEO III was one of the first micro-programmed computers (it might have been the first) and I was later given the job of testing the micro-program units - large SRBP T-shaped units with lots of ferrite core pulse transformers and wires running through them that we called 'banjos' - on an automatic tester. They were assembled at the main English Electric Computers factory at Kidsgrove - I was actually based there and EE had just taken over LEO. I couldn't be bothered to fill in all the paperwork for units that failed the tests, and it took a couple of weeks to get them back, so I fixed the faults myself. They were usually misplaced connections and quite easy to find, but one had me scratching my head until I realised that the unit had been assembled with two plastic washers in one hole, instead of a ferrite core and plastic washer. Both were black and it wasn't easy to see the difference.

    I remember one of the prototype computers in the Kidsgrove development lab playing music (the jingle from a TV commercial for Esso petrol) a year or so later, I think it was the KDF9. They had a KDF7 controlling a model train layout - they were hoping to get a contract from the railways for an automated goods yard. If someone removed a truck from a number of them being pulled by a train the message "Someone has pinched a truck!" was printed on a Teletype. I was working on a LACE analogue computer at the time, next to it was a little KDN2 computer that my boss and some other engineers used to generate permutations for their weekly attempts to win the football pools. They never won anything.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 10/12/2009 10:04:09 AM GMT
  • kwinnkwinn Posts: 8,697
    edited 2009-10-12 15:37
    The Collins 8400 was also a micro-programmed computer. Had a fast 36 bit wide core memory for the micro-code and a slower core main memory. The micro-program was loaded from a paper tape via the model 33 teletype paper tape reader/punch. There were 2 micro-program tape choices. The one we used most often was the 1401 emulator, and the other was MPCS (Multi Program Control System) which allowed multiple programs to run. It was the software Collins Radio used on the computer for message routing applications (its main purpose).
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-10-12 16:09
    Leon said...
    When I was a student working at LEO Computers in the early 1960s I was asked to design an audible monitor circuit for the new LEO III computer.

    Was it named after you?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • LeonLeon Posts: 7,620
    edited 2009-10-12 16:35
    LEO - Lyons Electronic Office.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
Sign In or Register to comment.