Drum Synth and Bass Synth

Type
Sound
Category
Keyboard drum kit and bass synthesizer
Author
Glenn Gutierrez
Published in
Antic, February 1985 (Vol. 3, No. 10), "Drum Synth / Bass Synth: Powerful AUDCTL Rhythm Section"
Year
1985
Language
Atari BASIC
Requirements
Any Atari 8-bit, Atari BASIC; paddles optional (Drum Synth)
Title screen: 'Glenn Gutierrez presents SYNDRUM, Written on 8/16/84 for ANTIC Magazine, PRESS START or any key' in white and blue on dark blue

About the program

Antic called these "the most realistic Atari musical instrument simulations we've ever heard". Glenn Gutierrez's two programs make the computer a drum machine and an electric bass you play from the keyboard. They came with a tutorial on driving POKEY directly instead of through the SOUND statement. Both are in plain BASIC and run on any Atari. Hooked up to a stereo, the article promised, they sound remarkably professional. The title screens date them to August 1984.

What you need

Atari BASIC and a good speaker. Drum Synth can also use paddles to set the tone and speed of its repeating sounds.

Typing it in

Both listings are almost plain ASCII. The {TAB} characters in the title lines are typed as ESC then TAB, and there is one inverse-video word. The DATA lines map the internal key codes to sounds or notes, so copy them exactly. Antic asked readers to check the programs with TYPO II.

How to use them

Drum Synth (SYNDRUM). Press START or any key at the title screen. The screen goes solid green (the display is switched off for speed), and the keyboard is a drum kit, with at least two keys per sound so either hand can play. A, S, + and * are the bass drum, D and ; the snare, F and L a "syn-drum", G and K a hand clap, and Z X C V B N M , . / five toms. Q and = repeat the high-hat (paddle 1 sets the speed), W and - give a closed high-hat, E and P an open one, and R, O, T and I crash cymbals. RETURN plays a bass and snare demo. START switches between fast and slow modes. Press BREAK and type END to silence everything.

Bass Synth (BASYNTH). Press a key to play a bass note. The note fades away unless another key interrupts it.

How it works

  • POKE instead of SOUND. SOUND 0,200,10,8 is the same as POKE 53760,200:POKE 53761,168, a frequency and a control byte of distortion×16+volume. POKEs are faster, and you can change just the pitch or just the volume. Unlike SOUND, they leave AUDCTL alone.
  • AUDCTL (53768) changes how POKEY's channels work. Bit 0 switches the base clock from 64 kHz to 15 kHz for much deeper notes, bits 1 and 2 add high-pass filters on channels 1 and 2, bits 3 and 4 join channels into 16-bit pairs, bits 5 and 6 clock a channel at 1.79 MHz, and bit 7 changes the noise. Bass Synth sets it to 7, the low clock plus both filters. It then plays the same note on channels 1 and 3, one step apart (N and N+1), for a thick, buzzy bass.
  • Drums from clicks. Each drum is a short burst of POKEs that switch noise and "volume only" settings on and off (control values in the 16–31 range). This makes the thumps and rattles of real percussion, in a loop that stops as soon as another key is pressed.
  • GOSUB KEY(P) uses an array of line numbers, indexed by the key code in location 764, to jump straight to the right sound.

Listings

Drum Synth

10 REM SYNDRUM
12 REM BY GLENN GUTIERREZ
14 REM ANTIC MAGAZINE
20 GOSUB 30000
30 GRAPHICS 17:POKE 708,15:POKE 712,192:POKE 559,0
35 POSITION 5,9:? #6;"SLOW  MODE"
40 P=PEEK(764)
41 S=PEEK(53279):IF S=7 THEN 44
42 SCR=SCR=0:POKE 559,34*SCR
43 IF PEEK(53279)=S THEN 43
44 IF P=255 THEN 40
50 TRAP 40:POKE 764,255:IF KEY(P)=0 THEN POKE 53761,0:POKE 53763,0:GOTO 40
60 POKE 53761,0:GOSUB KEY(P):GOTO 40
99 REM BASS DRUM
100 POKE 53768,1:POKE 53760,0:POKE 53761,193:POKE 53761,31:POKE 53761,28
110 FOR J=8 TO 0 STEP -4:POKE 53761,0:POKE 53761,16+J
120 IF PEEK(764)<>255 THEN POP :RETURN
130 NEXT J:RETURN
199 REM SNARE DRUM
200 POKE 53768,0:POKE 53760,0:POKE 53761,193:POKE 53763,31:POKE 53761,27:POKE 53760,3:POKE 53763,0
210 FOR J=3 TO 0 STEP -0.2:POKE 53761,128+J
220 IF PEEK(764)<>255 THEN POP :RETURN
230 NEXT J:RETURN
299 REM SYN-DRUM
300 POKE 53768,1:POKE 53763,31:POKE 53761,27:POKE 53760,1:POKE 53763,0
310 FOR J=4 TO 0 STEP -0.4:POKE 53761,128+J*0.7:POKE 53762,200-J*40:POKE 53763,160+J
320 IF PEEK(764)<>255 THEN POP :POKE 53763,0:RETURN
330 NEXT J:POKE 53761,0:POKE 53763,0:RETURN
399 REM REPEAT HIGH HAT
400 POKE 53768,0
405 POKE 53760,0
410 FOR J=3 TO 0 STEP -5/(PADDLE(0)+1):POKE 53761,128+J
420 IF PEEK(764)<>255 THEN POP :RETURN
430 NEXT J:GOTO 405
499 REM HAND CLAP
500 POKE 53768,0:POKE 53760,20:POKE 53762,5:POKE 53761,132
510 FOR J=4 TO 0 STEP -0.5:POKE 53761,128+J:POKE 53763,INT(128+J/2)
520 IF PEEK(764)<>255 THEN POP :POKE 53763,0:RETURN
530 NEXT J:RETURN
599 REM REPEAT TOM
600 POKE 53768,1
605 POKE 53760,0:POKE 53761,193:POKE 53761,31
610 FOR J=6 TO 0 STEP -4/(PADDLE(1)+1):POKE 53760,PADDLE(0)+27-J*2:POKE 53761,160+J
620 IF PEEK(764)<>255 THEN POP :RETURN
630 NEXT J:GOTO 605
699 REM TOM 1
700 POKE 53768,1:POKE 53761,31:POKE 53763,27
710 FOR J=6 TO 0 STEP -1:POKE 53760,255-J*20:POKE 53764,254-J*20:POKE 53761,160+J:POKE 53765,160+J
720 IF PEEK(764)<>255 THEN POKE 53765,0:POKE 53764,0:POP :RETURN
730 NEXT J:RETURN
749 REM TOM 2
750 POKE 53768,1:POKE 53761,31:POKE 53763,27
760 FOR J=6 TO 0 STEP -1:POKE 53760,200-J*20:POKE 53764,199-J*20:POKE 53761,160+J:POKE 53765,160+J
770 IF PEEK(764)<>255 THEN POKE 53765,0:POKE 53764,0:POP :RETURN
780 NEXT J:RETURN
799 REM TOM 3
800 POKE 53768,1:POKE 53761,31:POKE 53763,27
810 FOR J=6 TO 0 STEP -1:POKE 53760,169-J*20:POKE 53764,170-J*20:POKE 53761,160+J:POKE 53765,160+J
820 IF PEEK(764)<>255 THEN POKE 53765,0:POKE 53764,0:POP :RETURN
830 NEXT J:RETURN
849 REM TOM 4
850 POKE 53768,1:POKE 53761,31:POKE 53763,27
860 FOR J=6 TO 0 STEP -1:POKE 53760,160-J*20:POKE 53764,159-J*20:POKE 53761,160+J:POKE 53765,160+J
870 IF PEEK(764)<>255 THEN POKE 53765,0:POKE 53764,0:POP :RETURN
880 NEXT J:RETURN
899 REM TOM 5
900 POKE 53768,1:POKE 53761,31:POKE 53763,27
910 FOR J=6 TO 0 STEP -1:POKE 53760,149-J*20:POKE 53764,148-J*20:POKE 53761,160+J:POKE 53765,160+J
920 IF PEEK(764)<>255 THEN POKE 53765,0:POKE 53764,0:POP :RETURN
930 NEXT J:RETURN
999 REM HIGH HAT
1000 POKE 53768,0
1005 POKE 53760,0
1010 FOR J=3 TO 0 STEP -0.5:POKE 53761,128+J
1020 IF PEEK(764)<>255 THEN POP :RETURN
1030 NEXT J:RETURN
1099 REM OPEN HIGH HAT
1100 POKE 53768,0
1105 POKE 53760,0
1110 FOR J=4 TO 0 STEP -0.2:POKE 53761,128+J
1120 IF PEEK(764)<>255 THEN POP :RETURN
1130 NEXT J:RETURN
1199 REM CRASH CYMBAL
1200 POKE 53768,0
1205 POKE 53760,0
1210 FOR J=6 TO 0 STEP -0.2:POKE 53761,128+J
1220 IF PEEK(764)<>255 THEN POP :RETURN
1230 NEXT J:RETURN
1299 REM CRASH CYMBAL (LONG FADE)
1300 POKE 53768,0
1305 POKE 53760,1
1310 FOR J=7 TO 0 STEP -0.1:POKE 53761,128+J
1320 IF PEEK(764)<>255 THEN POP :RETURN
1330 NEXT J:RETURN
9999 REM DRUM DEMO
10000 POKE 20,30
10010 IF PEEK(20)>25 THEN POKE 20,0:GOSUB 100:GOTO 10010+20*STRIG(0)
10015 IF PEEK(764)<>255 THEN RETURN
10020 GOTO 10010
10030 IF PEEK(20)>25 THEN POKE 20,0:GOSUB 200:GOTO 10010
10035 IF PEEK(764)<>255 THEN RETURN
10040 GOTO 10030
30000 GRAPHICS 0:POKE 712,144:POKE 709,12:POKE 710,144:POKE 711,150:POKE 752,1
30010 DIM KEY(63)
30020 DL=PEEK(560)+256*PEEK(561):POKE DL+3,66:POKE DL+11,7:POKE DL+12,6
30030 POKE DL+23,6:POKE DL+24,6:POKE DL+26,65:POKE DL+27,PEEK(560):POKE DL+28,PEEK(561)
30040 POSITION 7,1:? "Glenn Gutierrez presents"
30050 POKE 708,15:POSITION 6,6:? #6;"SYNDRUM"
30055 POSITION 26,6:? #6;"{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}"
30060 POSITION 10,12:? "Written on 8/16/84"
30070 POSITION 10,13:? "for ANTIC Magazine"
30075 RESTORE 31000:FOR J=0 TO 63:READ D:KEY(J)=D:NEXT J
30080 POSITION 24,17:? "{inv}press start{/inv}":POSITION 14,18:? "or any key"
30090 IF PEEK(53279)<>6 AND PEEK(764)=255 THEN 30090
30100 POKE 764,255:RETURN
31000 DATA 300,0,200,0,0,500,100,100,1200,0
31001 DATA 1100,0,10000,1300,1000,400,750,0,750,0
31002 DATA 0,800,700,700,0,0,0,0,0,0
31003 DATA 0,0,850,0,900,800,0,850,900,600
31004 DATA 1200,0,1100,0,0,1300,1000,400,0,0
31005 DATA 0,0,0,0,0,0,300,0,200,0
31006 DATA 0,500,100,100

Bass Synth

10 REM BASYNTH
12 REM BY GLENN GUTIERREZ
14 REM ANTIC MAGAZINE
20 SOUND 0,0,0,0:POKE 53768,7:GOSUB 30000
30 P=PEEK(764):IF P=255 THEN 30
35 POKE 764,255
40 TRAP 30:N=NTS(KEY(P)):IF N=0 THEN GOTO 30
50 POKE 53760,N:POKE 53764,N+1
60 FOR J=15 TO 0 STEP -0.5:POKE 53761,160+J:POKE 53765,160+J
70 IF PEEK(764)<>255 THEN 30
80 NEXT J:GOTO 30
30000 GRAPHICS 0:POKE 712,144:POKE 709,12:POKE 710,144:POKE 711,150:POKE 752,1
30010 DIM KEY(63),NTS(37)
30020 DL=PEEK(560)+256*PEEK(561):POKE DL+3,66:POKE DL+11,7:POKE DL+12,6
30030 POKE DL+23,6:POKE DL+24,6:POKE DL+26,65:POKE DL+27,PEEK(560):POKE DL+28,PEEK(561)
30040 POSITION 7,1:? "Glenn Gutierrez presents"
30050 POKE 708,15:POSITION 6,6:? #6;"BASYNTH"
30055 POSITION 26,6:? #6;"{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}"
30060 POSITION 10,12:? "Written on 8/29/84"
30070 POSITION 10,13:? "for ANTIC Magazine"
30075 RESTORE 31000:FOR J=0 TO 63:READ D:KEY(J)=D:NEXT J:FOR J=1 TO 37:READ D:NTS(J)=D:NEXT J
30080 POSITION 24,17:? "{inv}press start{/inv}":POSITION 14,18:? "or any key"
30090 IF PEEK(53279)<>6 AND PEEK(764)=255 THEN 30090
30100 POKE 764,255:GRAPHICS 18:POKE 712,192:POKE 559,0:RETURN
31000 DATA 14,11,16,0,0,0,0,0,32,0
31001 DATA 34,29,0,30,36,37,6,0,5,0
31002 DATA 0,8,3,1,23,0,21,26,0,0
31003 DATA 19,0,13,0,15,10,0,12,17,0
31004 DATA 24,0,22,27,0,25,20,18,31,0
31005 DATA 33,28,0,0,35,0,0,9,4,0
31006 DATA 0,7,2,0
31010 DATA 243,230,217,204,193,182
31011 DATA 173,162,153,144,136,128
31012 DATA 121,114,108,102,96,91
31013 DATA 85,81,76,72,68,64
31014 DATA 60,57,53,50,47,45
31015 DATA 42,40,37,35,33,31
31016 DATA 29

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: BASYNTH.BAS, SYNDRUM.BAS.

Credits