I know this is a predictable remark, but I miss the good old days. The Apple II was so simple and understandable that I was able to write a program that played two musical notes at once (I called it the "Electric Duet"), in tune, and a fairly tolerable sound, even though the speaker was driven by a TTL output (meaning no analog level control).
If the Apple II had had interrupts, my program would have stopped working. I know this because an Apple II successor supported a mouse, the mouse required an interrupt, and it ruined the performance of my program.
Oh, I almost forgot -- Tom Clancy wrote "The Hunt for Red October" on Apple Writer.
That program inspired me to (cough) take it apart and understand how something so cool could come out of the Apple II's speaker. That exercise taught me 6502 opcodes and I've been working in embedded systems ever since.
Looking back, I realize I must have spent two weeks just writing the Electric Duet player, because the time through the player loop had to be constant. The loop read through the notes to be played, synthesized them, and changed their duty cycle, but had to use the exact same number of machine cycles regardless of what it did, so the music stayed in tune.
Near the end of the project, I had two problems: the music was slightly off-pitch -- middle A wasn't exactly 440 Hz -- and the number of machine cycles wasn't quite constant (it varied between 40 and 41 cycles depending on which branches the code took).
Finally I realized I could insert a single NOP (no-operation) instruction at a critical location. The NOP forced the number of cycles to be a constant, regardless of the path through the loop, and I then realized that it also slightly changed the output frequency to be tuned exactly right.
Horribly off topic, but what is the current status of the Electric Duet player routine? I read somewhere that you had placed it in the public domain in the 90s, but I can't find any confirmation of that.
I didn't really "place" it in the public domain, I just let nature take its course. The inevitable result is that there are now only versions of the program online in which my name and copyright notice have been removed:
I searched for the original program online, but couldn't find it -- only the pirated version. By "pirated" I mean someone has removed my copyright notice and offered the program as their own, successfully replacing the original in all online archives.
Yeah, the Apple II era seems to have been particularly destructive with removing copyright notices in favor of "crack screens" and other drivel. Bleah.
More recently, I've been working on my own Apple II game (really). I'd like to release it fully open source, which makes it particularly challenging to use third-party libraries since open source wasn't really a "thing" when they were written. Some of them (notably old Beagle Bros. disks) have since been explicitly placed in the public domain.
So... I would very much like to have some Electric-Duet-based music and sound effects in my upcoming open source Apple II game. (Yes, I just typed that.) Would you be willing to relicense your amazing player routine under an open source license, or to place it in the public domain? I would, of course, give you full copyright attribution in the scrolling credits screen or wherever you'd like.
The original was copy-protected, I believe, which means it cannot be archived in the standard .dsk format (there are some more complicated formats that represent a disk at a lower level, but they are not very well supported by emulators). In a few decades, the only surviving copies of many 80s software programs will be the ones that were cracked and distributed widely. In this way, crackers and pirates acted as inadvertent archivists.
For what it's worth, the pirated version I had (back in the old days) had your name on it (plus a crack group's name and probably BBS phone number). I remember thinking "Hey, that's the Apple Writer guy, what else did he write?" and that's how I found GraFORTH. Bought Leo Brodie's book and had a blast learning the language, then actually implementing small Forth-like languages for the fun of it. There was a Byte book, "Threaded Interpretive Languages" that gave me several epiphanies about programming in general and language design in particular.
I used Apple Writer for years, until eventually my typing speed increased so much that the program couldn't keep up with me anymore when typing long paragraphs (the word wrap algorithm, that was run after each character, apparently took time proportional to the length of the current paragraph, with a big enough constant that my 1 MHz Apple II started dropping keystrokes regularly despite the program having a 32-character buffer). I eventually resorted to disabling word-wrap while typing, and re-enabling it prior to printing (Control-Z, I think it was). Later, I bought a Zip Chip that increased the computer speed to about 3.5 MHz, and the problem disappeared.
I wasn't using Apple Writer by then, because I had discovered
another word processor, a weird, Rube Goldberg contraption called Gutenberg Sr. that used double-high-resolution graphics at a time when few programs did, and had a more powerful markup language (troff-inspired, I found out later), could two two-column printing and had some page layout capabilities, and had great support for printer-downloadable fonts, including user-defined ones. The interface was atrocious but the software itself was powerful.
I've had similar situations, but never as victorious as that. That's awesome. Thanks for sharing that story....(now I want to get that code back somehow and look for that NOP)
1. I wrote most of my high school reports on it.
2. I once wrote a set of WPL programs to automate the generation of multiple-choice tests, and sold it for $50 to my uncle who was a physics teacher.
3. Apple Writer was the second program I disassembled from beginning to end (the first was Locksmith Fast Disk Copy), learning a lot in the process.