Posted on

Linus Live Codes Music on the Commodore 64

Linus Live Codes Music on the Commodore 64

In this extremely educational video [Linus Åkesson] takes us through the development of a synthesizer as well as a sequencer and editor for it on the Commodore 64, all in BASIC. Even if that sounds simple, [Linus] does this in hard mode: all sound is generated by POKE and it just gets crazier from there. If you are one of those people out there who think that BASIC is a limited language, you must watch this video.

[Linus] can do anything with POKE. On a simple computer like the C64, the sound chip, the screen chips, and even the interrupts that control program flow are accessible simply by writing to the correct part of memory. So the main loop here simply loops through a bunch of data, stores it in memory, and turns the sound chip on and off. The C64 also runs a counter that references a pitch lookup table in the code.

But the first part comes when he designs the sequencer and editor. Since C64 BASIC already has an interactive code editor, he uses this for his music editor. The final sequencer interface exists inside the program itself, and he writes music into the code in real time using things like LIST and editing. (Code is data, and data is code.) Add a noise drum hack, and you end up with some classic chiptuney sounds.

We love [Linus]are minimal C64 exercises, and this achieves the maximum effect from a running C64 BASIC environment. But that’s so much code compared to his 256-byte demo “A Mind is Born.” But to achieve that he had to use assembly.

Thanks [zogzog] for the great tip!