Thunder Storm
- Type
- Sound
- Category
- Sound and screen effect
- Author
- Alphonso Carioti
- Published in
- Antic, November 1985 (Vol. 4, No. 7), I/O Board
- Year
- 1985
- Language
- Atari BASIC
- Requirements
- Any Atari 8-bit computer, any memory size, Atari BASIC
- Tags
- antic, sound, pokey, white-noise, display-list, screen-shake, short-listing, io-board, 1985
About the program
Alphonso Carioti of Fort Lauderdale sent this short program to Antic's I/O Board in November 1985 as "a thunderstorm to sync with video or film". It's a good example of how much atmosphere a single POKEY voice can create. A steady hiss stands in for the rain. Pressing the space bar sets off rolls of thunder, while the screen flashes and jumps as if lit by lightning.
Typing it in
The only special characters are the inverse words SPACE BAR in line 30: {inv} … {/inv} means press the Atari (inverse) key before and after. Line 15 disables the BREAK key, so press RESET to stop the program.
How to use it
RUN it and listen to the rain. Press the space bar for thunder (it keeps rolling) and any other key to go back to rain. For the best effect, turn the TV or monitor volume up.
How it works
The whole program is one loop, lines 100–130, and the trick is in line 120.
- The rain. Location 764 holds the internal code of the last key pressed. Unless it is 33 (the space bar), line 120 uses
POPto drop the FOR loop and jumps back to line 100. The loop then never gets pastX=0, so you hear a steadySOUND 0,0,0,15: distortion 0, POKEY's noisiest setting, at its highest pitch and full volume. That makes a convincing hiss of rain, and the screen stays dark. - The thunder. Once the space bar has been pressed, the loop runs all the way through. The pitch value climbs from 0 to 245, so the noise drops into a low rumble, and the volume fades from 15 to 0 across the sweep. The same counter is POKEd into the background, border and text colours (line 110), so the screen flashes and fades with the sound. Location 764 isn't cleared, so the thunder keeps rolling until another key is pressed.
- The jolt. During the loud first part of each roll (
X<68), lines 125–127 find the display list via 560/561 and briefly add a random 39–41 to the low byte of its screen-memory address, then put it back. The whole display jumps by about a text line for an instant, like a flash of lightning. POKE 16,64:POKE 53774,112switches off the BREAK key interrupt.
Listing
2 REM THUNDER STORM
4 REM BY ALPHONSO CARIOTI
6 REM ANTIC PUBLISHING
10 GRAPHICS 0:POKE 752,1
15 POKE 16,64:POKE 53774,112
20 POSITION 12,4:? "LISTEN TO THE RAIN"
30 POSITION 4,6:? "PRESS THE {inv} SPACE BAR {/inv} FOR THUNDER!"
40 POSITION 3,8:? "PRESS ANY OTHER KEY FOR RAIN AGAIN"
50 POSITION 14,11:? "DON'T GET WET!!!"
100 FOR X=0 TO 245:SOUND 0,X,0,ABS(15-(X/8))
110 POKE 712,X:POKE 710,X:POKE 709,X+10
120 IF PEEK(764)<>33 THEN POP :GOTO 100
125 SCR=PEEK(560)+PEEK(561)*256+4:K=PEEK(SCR)
127 POKE SCR,K+(X<68)*(INT(RND(0)*3+1)+38):POKE SCR,K
130 NEXT X:GOTO 100
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: THUNDER.BAS.
Credits
- Program listing: Thunder Storm — program listing (Antic, November 1985 (Vol. 4, No. 7), I/O Board) — Alphonso Carioti
- Picture: Thunder Storm's screen during the rain. It flashes through the colours with each roll of thunder. — Alphonso Carioti (program); screenshot by the site
- Antic, November 1985 - Vol. 4 No. 7: scan of the printed magazine, PDF page 9 (I/O Board) — Internet Archive, 1985
- Antic disk, November 1985 - Vol. 4 No. 7: THUNDER.BAS (detokenized listing) — Alphonso Carioti, 1985
