
C64 Music Keyboard
10 March 2025
Aquarius video glitch repair
24 April 2025Light Scanner Controller V3 is a piece of software for controlling lights with the Commodore 64, programmed by Mirco Gaggiottini in 1994.
You can see it in action in this video:
The light control board is on GitHub:
C64-light-controller
Now let’s have a quick recap of how it all works, and then we’ll get into the details of the software.
The interface, which back then was different and housed in a box so it couldn’t be touched, is connected to the C64’s user port and drives triacs or solid-state relays that switch on the coloured light bulbs. Back then (the 90s) I used the classic 60W ones with coloured caps.
The computer is isolated from the voltage that drives the lamps by means of optocouplers.
WARNING! If you use the project for 110V-230V lamps: this is a dangerous voltage, so you must be very careful and insulate the whole live section to avoid getting hurt!
If you use LED lamps or anything low voltage (12V-24V), there are no problems.
The program
Let’s start with the latest version: this is the most complete program I made back then (1994). At start-up you had to use a hardware key (a connector plugged into the joystick port that made combinations impossible to make with a joystick); it has now been removed and you just press a key to continue. You’ll also notice several spelling mistakes that were never corrected and will stay as they originally were.
To load the program you can’t use load”*”; you have to type the full name, because the loader then loads the same name with “1” as the first character and wouldn’t find anything.
This is what the program looks like:
On the left we have a girl who will talk, writing underneath some phrases picked at random from a set of data 😀
Obviously this is of no use other than having fun seeing what comes out; back then it included some of my friends and things they used to say.
Also in the yellow box we have the keys we can use to start the light sequences (e.g. Q = Strobe, all the lights flash at the same time).
Once the effect key is pressed, the effect is shown below with some sprites, which incidentally we can change using a separate program called “grafik-change”.
On the original disk it had been put on side B and you had to flip the disk when starting the program; now everything is on one side.
While a light sequence is running, we can’t press any other keys except the one to exit (left arrow) or the numbers 1 to 0 (zero) to change the speed of the sequence. Our girl won’t say anything! All this is also confirmed by the word WORK at the bottom of the screen (red box). When you press the ← (left arrow) key you leave effect control mode and can select another one with its key; the old effect will keep running, but we won’t be able to change its speed. This gives us time to select something else without leaving everything in the dark.
The green box was meant for a possible scanner control that was never made. Back then Simone, a school friend of mine, was supposed to build a home-made one!
The F key is very important because in this version it works the other way round: if you don’t activate it, the effect will switch the light on and off so fast that we won’t see any bulb light up.
“IN THIS VERSION (F) LIGHT MUST BE 1” or the output won’t be driven!!!
There are other functions, such as A for random effects: we won’t have control over anything, neither speed nor type of effect; the C64 will choose the effect, the speed and its duration. To leave this mode we have to press “*”, which is shown in place of the text A = AUTO.
We can use the joystick in port 2 to control the lights: select effect 4 and, by moving the joystick in the various directions or pressing fire, we get an instant light show at a fixed speed, and when we let go of the stick everything switches off. In this mode we can use the “O” key for OLD, so that the last effect used stays on even with no direction selected. The left arrow key exits this mode.
There’s one last thing left to look at: the sequencer! You can compose effects with an external program called “sequencer”, which lets you create custom light shows frame by frame. These shows are then saved as a 4-character code; up to 3 of them can be loaded into memory, and you can select a specific one or a random one. Once saved to disk they can be loaded with the 1 key (typing dir shows the disk directory) and run with the 3 key. The 2 key clears the memory so you can load other custom light shows.
At the moment the program requires the start-key, a joystick combination (up-down and left at the same time). This can easily be done with an emulator that allows opposite directions at the same time, or on real hardware you need to make a female DB9 plug with those directions tied to GND. Otherwise the program has to be cracked, but I had compiled it with AustroComp E1, and when I decompile it I get errors on 2-3 lines and the program crashes after saving a sequence. For now I’m leaving it as the original, and as soon as I find a way to make it work properly I’ll update the file and the article.
To understand how the sequencer works, have a look below at version 2 of the program; it was identical.
You can download the program from the download page or by using this button
1993 - Light Controller V2
Going back in time, the year before I created this software, which was a big improvement on the first version because it used assembly routines to speed up the light shows and, above all, to keep the previously selected show running while the next effect was being chosen (just like version 3 works).
Instead of a talking girl, this program has 3 characters taken from a techno magazine of the time and Dylan from Beverly Hills 90210. Guys, what can I say, it was the era of those TV series. I went through Twin Peaks, X-Files and Beverly Hills 90210, then I gave up on series.
These were the three guys who chatted with each other and with whoever was sitting at the computer, just for a laugh.
Here too we had protection at start-up, but this time it was a two-character code to find in a table, like Maniac Mansion, remember that?
Obviously in this version I’ve removed the protection, so you can type whatever you like. Here too there’s the software to create 3 custom light sequences and then load them into the main program. Here the protection comes first, so once the program is loaded you choose whether to create a sequence or load the light control program.
The program for creating light sequences is very similar to the latest version; mainly the graphics change, but here too we first have to specify the memory we want to use (1, 2, 3), then give the file a 4-character name and press return to move on to this screen. Here we have to press space and start composing our sequence by switching on the lights with keys 1 to 8; once our frame of lights is ready, we press enter to go to the next position, where we draw another frame of the light sequence. Pressing the left arrow key saves the file, and you can carry on creating other sequences or exit. The frame speed can’t be chosen; it will be handled by the light program as a single speed for the whole sequence. Here the sequences can be saved on the same disk as the program. The file will have the extension .alc(x) (automatic light controller plus the number of the memory used, e.g. .alc1, .alc2 or .alc3)
Now let’s move on to the light control program.
The start-up screen just had to be one of the program’s characters.
Once you’ve understood how the latest version works, this one is identical.
We have the keys Q, W, E, R, T, Y to select a light show already set up in the program. This puts our program into WORK mode: the characters stop talking and we can control the speed of the effect with the numbers 0 to 9; zero stops the effect, leaving the lights on as in the current frame (something that didn’t happen in the latest version). To exit a program there’s always the left arrow key. The “A” key puts the program into automatic mode with random lights, and it can be stopped by pressing the “*” key, which isn’t shown anywhere!
To load a previously made sequence you press the 1 key; 2 clears everything loaded, and with 3 you can run memory 1, 2, 3 or R for a random effect among the loaded memories.
The “F” key MUST NOT BE USED! unlike the latest version, which was inverted, in this program we must not use the Light function, because it wouldn’t switch on any lights.
Other keys were planned but never completed, such as 5, 6, 7, 8. The 4 key lets you use the joystick to run a preset effect, as in the latest version; if we press the O (OLD) key, the last effect keeps running even if we don’t touch the joystick; left arrow to exit.
1992 - Turn On The Lightbulb
Let’s keep travelling back in time and arrive at 1992, when I created the first light control program.
The story of this adventure began with a school friend of mine, or rather the brother of a school friend, who turned up at my house one day with a project to build. He brought me a home-made circuit board that could be connected to the C64’s user port and could control lamps connected to the 230V mains.
This board needed software to be usable. They gave me a rough example of how the user port output was driven, a very simple program in Basic, and from there I set out to write a complete program that would make it easy to manage these lights, used like in a disco.
This first version was written entirely in Basic and, as you can imagine, it was very slow, so much so that they later asked me to have 2-3 bulbs light up between one program change and the next. Already when you left an effect everything stayed dark until you pressed another light effect, and the change took a second or two at most, but if you weren’t quick to press a new light show you could lose a lot more seconds.
So I added a function (X key) to turn “courtesy lights” on or off: four lamps that stayed on steadily when no effect was selected.
Looking at the screen alongside, you’ll realise how similar the program was across all versions. I had designed it like that from the start: keys paired with a light effect, a key to exit the effect (the usual left arrow) and the option to use a joystick or load a custom sequence.
Being in Basic, this version has no speed control while the effect is running; everything was already at maximum speed, it couldn’t go any faster. Here the “F” key was needed, the function that made the lights flash much more: as soon as the lamp was switched on, it was switched off again and the sequence carried on. Since Basic is very slow, this effect of switching the light on and immediately off came out as a strobe-like flash, and it wasn’t a bad effect for keeping the room darker.
Apart from that, here too we find the program for creating sequences, but we can make them directly from the light program with the “4” key. It works in a similar way, but here the sprites aren’t shown as if they were light bulbs; instead we type the numbers of the lamps to be switched on frame after frame. We can create several sequences in memory; it first asks for the number to assign, and I had allowed up to 20 with 80 frames each. The “3” key starts a sequence, and here we can also change sequence and speed while it’s running, though the speed can only be slowed down. With this function you can also advance the effect manually by pressing a key: M toggles manual/automatic mode, “P” stops playback and “S” starts it. With the F key you can use the flashing effect in the sequence too, and the “X” key switches off all the lights; the usual left arrow to exit.
The joystick worked a bit differently: here you could select which lamps to switch on for each direction or fire.
Same thing for the keyboard: with the “1” key you define which key you want to press and the lights that will come on when it’s pressed. We can define 10 keys. The “7” key uses the keyboard combination we have set up; if it hasn’t been defined first, no keys will be shown on screen and nothing will happen. You go back to the main menu with left arrow.
Demo mode plays sequences 1 to 20 in succession, so you won’t see anything unless some sequences are created first, and if there are only a few the lamps will probably be off much of the time.
I hope you enjoyed this journey back in time, with a lad who was 18 when he wrote this program and had fun both with his friends and programming his “do-it-all Commodore 64”.
You can download the first program I created using the download page or the button below.
similar posts



