Tick Tick Tick
Add BEEP to each tick of the countdown — rising pitch, changing border colour, building tension.
The countdown works, but it’s silent. A bomb counting down should sound urgent. Each tick needs a sound — short, sharp, rising in pitch as time runs out. The border should shift from black to yellow to red. Sound and colour together create tension that numbers alone can’t.
Sound With BEEP
Type NEW, then:
10 BEEP 0.5,0
20 PRINT "Middle C"
30 BEEP 0.5,12
40 PRINT "One octave up"
50 BEEP 0.5,-12
60 PRINT "One octave down"
70 BEEP 0.1,5
80 BEEP 0.1,10
90 BEEP 0.1,15
100 BEEP 0.1,20
110 PRINT "Rising scale"
Type RUN. Three distinct tones play — middle C, one octave up, one octave down — followed by four quick ascending notes.
BEEP takes two numbers: duration (in seconds) and pitch (in semitones from middle C). BEEP 0.5,0 plays middle C for half a second. BEEP 0.5,12 plays one octave higher (12 semitones = 1 octave). BEEP 0.1,5 plays a short high blip.
Short durations make ticks. Long durations make tones. The pitch number controls how high or low the sound is — negative numbers go below middle C, positive numbers go above. The Spectrum’s range is -60 to 69.
The Ticking Countdown
Replace the simple countdown from Unit 3 with this version. Type NEW, then:
5 BORDER 0: PAPER 0: INK 7: CLS
10 LET t=9
12 FOR c=t TO 0 STEP -1
14 IF c>5 THEN LET pc=7
16 IF c<=5 AND c>2 THEN LET pc=6
18 IF c<=2 THEN LET pc=2
20 LET dr=3: LET v=c: GO SUB 8200
22 IF c>5 THEN BORDER 0
24 IF c<=5 AND c>2 THEN BORDER 6
26 IF c<=2 THEN BORDER 2
28 BEEP 0.06,5+((t-c)*3)
30 PAUSE 20
32 NEXT c
34 STOP
8200 REM === Draw single digit centred ===
8210 FOR r=dr TO dr+4
8220 PRINT AT r,12;" "
8230 NEXT r
8240 LET dc=14: LET f=v: GO SUB 8000
8250 RETURN
8000 REM === Draw digit f at dr,dc ===
8010 RESTORE 5100+f*10
8020 FOR r=0 TO 4
8030 READ a$
8040 FOR q=1 TO LEN a$
8050 IF a$(q TO q)="1" THEN PRINT AT dr+r,dc+q-1; PAPER pc;" "
8060 NEXT q
8070 NEXT r
8080 RETURN
5100 DATA "1111","1..1","1..1","1..1","1111"
5110 DATA ".11.","..1.","..1.","..1.",".11."
5120 DATA "1111","...1","1111","1...","1111"
5130 DATA "1111","...1",".111","...1","1111"
5140 DATA "1..1","1..1","1111","...1","...1"
5150 DATA "1111","1...","1111","...1","1111"
5160 DATA "1111","1...","1111","1..1","1111"
5170 DATA "1111","...1","..1.",".1..",".1.."
5180 DATA "1111","1..1","1111","1..1","1111"
5190 DATA "1111","1..1","1111","...1","1111"
Type RUN.

The digit counts down from 9. Each tick plays a short beep — low at 9, higher at 8, higher still at 7. The pitch rises as time runs out. The digit starts white, shifts to yellow at 5, then red at 2. The border follows the same pattern: black, then yellow, then red. By the time the counter hits 1, the screen is screaming urgency.
How the Colour Changes Work
Lines 14-18 use IF/THEN to pick the digit colour based on the countdown value:
c > 5— white (pc=7). Plenty of time. No panic.c <= 5 AND c > 2— yellow (pc=6). Getting close.c <= 2— red (pc=2). Critical.
Lines 22-26 do the same for the border. The digit and border change together — the whole screen communicates urgency, not just the number.
The AND keyword combines two conditions. c<=5 AND c>2 is true only when both are true — the countdown is at 5 or below, and still above 2. You’ve seen OR in Lucky Number; AND works the other way. OR means “either one”, AND means “both”.
How the Pitch Rises
Line 28 is the tick sound: BEEP 0.06,5+((t-c)*3).
The pitch formula is 5+((t-c)*3). When c=9 (start), t-c is 0, so the pitch is 5. When c=0 (end), t-c is 9, so the pitch is 32. Each tick is 3 semitones higher than the last. The sound climbs a musical staircase while the digit counts down.
The duration is 0.06 seconds — just a click. Short enough to feel like a tick, long enough to hear the pitch.
Try This
- Change
0.06in the BEEP to0.2. The ticks become longer, more ominous. Try0.02— barely audible clicks. - Change the pitch formula to
5+((t-c)*5). The pitch rises faster — the last few ticks are very high. Try*1for a subtle rise. - Swap the colour thresholds. Make the digit start red and end white. Does the countdown feel less urgent?
What You’ve Learnt
- BEEP duration,pitch — plays a tone; duration in seconds, pitch in semitones from middle C
- Rising pitch — a formula that increases with each tick creates ascending tension
- Border as atmosphere — changing BORDER colour reinforces the countdown’s urgency
- IF/THEN with AND — combines two conditions that must both be true
- Colour thresholds — different ranges of the countdown trigger different colours