• Line 100 gets a single character from the keyboard
and places its integer keycode in the variable “a.” Color
BASIC has 26 variables — A through Z — and each is case
insensitive. So, variable “A” is the same as “a.” Some Color
BASIC programmers use lowercase variables to make
them easier to see in the uppercase commands.
• Line 110 checks the keycode in variable a. If it is
zero, no key has been pressed, and program flow jumps
back to line 100 to check again for a keystroke.
• Line 120 copies the value in variable a to variable
“b,” so we can change the copy while preserving the
original value. The use of LET is optional in Color BASIC
value assignment, so we could have just said b=a without
• Line 130 checks the integer value in b and — if it is
greater than 90 — divides it by 2 to produce a more mid-range sound. (Higher numbers with the NOTEON
command in line 140 produce hard-to-hear high pitched
sounds.) Note that when playing your Amigo synthesizer,
you can use the Caps Lock key to change the tone
reference for the letter keys.
• Line 140 uses the processed keycode to turn on a
corresponding continuous tone. The note will continue
until another NOTEON or a NOTEOFF command is
received. Color BASIC will only play one note at a time.
• Line 150 checks the original keycode to see
whether the CTRL Q key combination (in either upper or
lower case) has been pressed. If so, it turns off any current
tone and ends the program. (A tone will continue after the
program ends unless it is turned off with NOTEOFF.)
• Line 160 checks the original keypress for a <Space>.
If one is detected, it turns off any current tone.
• Line 170 directs program flow back to get another
keystroke, and does it all again.
Enjoy your sci-fi synthesizer (Figure 5)!
That’s a Wrap
This completes the five easy projects for the Mentor’s
Friend. I hope you and any young helpers have fun, and
that these projects get you off to a good start with the
Amigo and Color BASIC.
We’ll do some future articles that will cover more
about Color BASIC, as well as some fun hardware projects
to control with the Amigo. Until then, be well, my friends!
January 2016 51
Dane Weston’s book on Color BASIC for the
Pocket Mini Computer is available at
FIGURE 5: Just add earbuds for a simple sci-fi synthesizer!