Hacker News new | ask | show | jobs
by drivers99 500 days ago
My favorite program as a teen came about because I had gotten a Sound Blaster (in my 8088 IBM PC), and you could order C/MS chips (they were actually a pair of Philips SAA1099 chips, originally used in the Create Music System aka Game Blaster).[0] Since it came with documentation on how to directly program the hardware registers, and I enjoyed coding music output (I still do enjoy that kind of thing), I ended up writing a program in C that could drive all 12 voices on the chips using the same notation as used by Advanced BASIC "PLAY" statements[1], but added a "V" command to let you select a voice. (BASIC "PLAY" command only supported 1 voice. Maybe 3 on the PCjr.?) It would keep track of how much time passed in each voice while compiling the information so that you could line everything up, and then would use that information to play everything at the right time when the music played back. I remember I had a big case or if/else section depending on the next character, so I must have worked out some sort of state machine without knowing what that was at the time. I took the conductor's score for music we were playing in band class and entered that into a file for the program to play the multi-voice version on my computer. :)

[0] https://en.wikipedia.org/wiki/Philips_SAA1099

and here's a fun video showing the upgrade with a bit of music from The Secret of Monkey Island towards the end. Like the video creator said, I also like how it sounds similar to the GameBoy: https://www.youtube.com/watch?v=3ZtyP9tE3Ug

[1] QBASIC equivalent documentation https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006....