Ave Maria Christmas Card

Type
Sound
Category
Musical Christmas card
Author
Ed Brown
Published in
Antic, December 1984 (Vol. 3, No. 8), Antic Disk bonus
Year
1984
Language
Atari BASIC
Requirements
Any Atari 8-bit, Atari BASIC
A white-on-blue GRAPHICS 8 line drawing in a frame: a kneeling hooded figure on the left and, in a separate panel on the right, a tall star with crossed rays

About the program

Antic's December 1984 issue gave disk subscribers a holiday bonus: Ed Brown's musical Christmas card, which plays "Ave Maria" while it shows "an elegant drawing". The magazine didn't print it. It said the listing was too long to print for typing and gave disk subscribers the command RUN "D:AVEMARIA.BAS". So this is one of the programs that only ever existed on the Antic disk. At 80 lines, almost all of them music DATA, it is easy to type today.

What you need

Any Atari with Atari BASIC. Turn the sound up.

Typing it in

Plain ASCII. Each DATA line holds six chords of four numbers, the pitch values for voices 0 to 3, where 0 means silence. One wrong number gives a sour note, so the DATA deserves the most care. The drawing in lines 500–532 is a long series of PLOT and DRAWTO coordinates.

How to use it

RUN it. The picture is drawn first, then the music begins. When the final all-zero chord in line 110 is reached, the text window shows "Merry Christmas" and the program waits in an endless loop at line 540. Press BREAK to stop.

How it works

  • The picture. Lines 500–532 draw everything in GRAPHICS 8 with white lines on a dark blue background (SETCOLOR 2,8,0 and SETCOLOR 1,0,15). There is a frame, a hooded figure on the left and a star with crossed rays in a panel on the right.
  • The music. Line 10 READs four pitches and sends them to all four voices with SOUND, pure tone (distortion 10). The two upper voices (channels 2 and 3) play a little more quietly than the two lower ones. Line 20 holds each chord with a FOR X=1 TO 160 delay loop, so the tempo depends on the speed of BASIC. The many 162s in the first column are a held bass note under moving upper parts.
  • A repeat. Line 20 counts the chords in Z, and when 324 have been played it does RESTORE 52 to repeat a section. A chord of four zeros ends the piece.

Variations to try

Change the 160 in line 20 to adjust the tempo, or replace the drawing subroutine at line 500 with your own picture and keep the soundtrack.

Listing

5 Z=0
7 GOSUB 500
10 READ A,B,C,D:SOUND 0,A,10,10:SOUND 1,B,10,10:SOUND 2,C,10,8:SOUND 3,D,10,8
20 FOR X=1 TO 160:NEXT X:Z=Z+1:IF Z=324 THEN RESTORE 52
21 IF A=0 AND B=0 AND C=0 AND D=0 THEN POKE 752,1:? "          Merry Christmas":GOTO 540
25 GOTO 10
50 DATA 162,0,0,0,162,0,108,0,162,0,81,0,162,0,64,0,162,0,81,0,162,0,108,0
51 DATA 162,0,0,0,162,0,108,0,162,0,81,0,162,0,64,0,162,0,81,0,162,0,108,0
52 DATA 162,0,0,0,162,0,81,0,162,0,64,0,162,0,53,0,162,0,64,0,162,0,81,0
53 DATA 162,0,0,0,162,0,64,0,162,0,53,0,162,0,45,0,162,0,53,0,162,0,64,0
54 DATA 162,0,0,0,162,0,81,0,162,0,60,0,162,0,47,0,162,0,60,0,162,0,81,0
55 DATA 162,0,0,0,162,0,85,0,162,0,60,0,162,0,51,0,162,0,60,0,162,0,85,0
56 DATA 162,0,0,0,162,0,81,0,162,0,64,0,162,0,53,0,162,0,64,0,162,0,81,0
57 DATA 162,0,0,0,162,0,108,0,162,0,81,0,162,0,64,0,162,0,81,0,162,0,108,0
58 DATA 162,0,40,53,162,108,40,53,162,81,40,53,0,64,40,53,0,81,40,53,0,108,40,53
59 DATA 193,0,40,53,193,114,40,53,193,81,40,53,0,64,42,0,0,81,42,0,0,114,40,0
60 DATA 217,0,31,40,217,108,31,40,217,81,31,40,0,64,31,40,7,81,31,40,0,108,31,40
61 DATA 217,0,31,40,217,108,31,40,217,85,31,40,0,60,31,40,0,85,0,31,0,108,35,0
62 DATA 193,0,40,47,193,96,40,47,193,81,40,47,0,64,40,47,0,81,40,47,0,96,40,47
63 DATA 193,0,40,47,193,96,40,47,193,81,40,47,0,64,40,47,0,81,40,47,0,96,40,47
64 DATA 243,0,35,47,243,96,35,47,243,72,35,47,0,60,35,47,0,72,31,0,0,96,35,0
65 DATA 217,0,40,53,217,108,40,53,217,72,42,0,0,60,47,0,0,72,60,47,0,108,42,0
66 DATA 162,0,40,53,162,108,40,53,162,81,40,53,0,64,40,53,0,81,40,53,0,108,40,53
67 DATA 162,0,40,53,162,108,40,53,162,81,40,53,0,64,31,40,0,81,31,40,0,108,31,0
68 DATA 162,0,31,40,162,102,31,40,162,81,31,40,0,64,31,40,0,81,35,0,0,102,40,0
69 DATA 162,0,42,0,162,96,42,0,162,81,47,0,0,64,31,40,0,81,31,40,0,96,28,40
70 DATA 173,0,31,47,173,114,31,47,173,96,31,47,0,64,31,47,0,96,31,47,0,114,31,47
71 DATA 173,0,33,47,173,114,33,47,173,96,33,47,0,68,33,47,0,96,33,47,0,114,42,0
72 DATA 204,0,35,50,204,121,35,50,204,102,35,50,0,72,35,50,0,102,35,50,0,121,40,50
73 DATA 204,0,42,50,204,121,35,50,204,102,31,50,0,72,29,50,0,102,35,50,0,121,42,50
74 DATA 193,0,40,47,193,128,40,47,193,96,40,47,0,81,40,47,0,96,40,47,0,128,40,47
75 DATA 193,0,40,47,193,114,40,47,193,81,40,47,0,64,31,0,0,81,31,0,0,143,35,0
76 DATA 173,0,35,53,173,108,35,53,173,85,35,53,0,72,35,53,0,85,35,53,0,108,42,0
77 DATA 128,0,47,53,128,96,37,53,128,76,31,53,0,64,26,53,0,76,31,53,0,96,37,53
78 DATA 144,0,35,42,144,85,35,42,144,72,35,42,0,53,35,42,0,72,35,42,0,85,35,42
79 DATA 144,0,35,42,144,81,47,0,144,72,42,0,0,57,40,0,0,72,42,0,0,81,47,0
80 DATA 217,108,53,0,217,85,53,0,217,72,53,0,217,53,0,0,217,72,53,0,217,85,53,0
81 DATA 217,108,0,0,217,85,0,0,217,72,0,0,217,53,0,0,0,72,53,0,0,85,53,0
82 DATA 217,108,35,53,217,85,35,53,217,72,35,53,217,60,35,0,217,72,0,0,217,85,35,0
83 DATA 217,108,35,0,217,85,35,0,217,72,37,0,217,60,35,0,0,72,35,0,0,85,31,0
84 DATA 217,108,35,0,217,81,35,0,217,64,31,0,217,53,40,0,217,64,40,0,217,81,40,0
85 DATA 217,108,40,0,217,81,40,0,217,64,0,0,217,53,40,0,0,64,40,0,0,81,40,0
86 DATA 217,108,35,0,217,85,35,0,217,72,35,0,217,60,35,0,217,72,0,0,217,85,35,0
87 DATA 217,108,35,0,217,85,37,0,217,72,35,0,217,60,29,0,0,72,31,0,0,85,35,0
88 DATA 193,96,40,0,193,81,40,0,193,64,40,0,193,47,40,0,193,64,40,0,193,81,40,0
89 DATA 193,96,40,0,193,81,40,0,193,64,0,0,193,47,0,0,0,64,0,0,0,81,40,0
90 DATA 217,108,35,0,217,85,35,0,217,72,35,0,217,53,35,0,217,72,0,0,217,85,35,0
91 DATA 128,0,31,0,85,128,0,0,64,128,31,0,50,128,31,0,64,128,35,0,85,128,31,0
92 DATA 144,0,26,31,96,144,26,31,72,144,26,31,60,144,29,35,72,144,29,35,96,144,29,35
93 DATA 144,0,29,35,96,144,29,35,72,144,29,35,60,144,29,35,72,144,47,0,96,144,47,0
94 DATA 243,121,31,0,243,96,31,0,243,72,31,0,243,60,35,0,243,72,35,0,243,96,35,0
95 DATA 230,114,40,0,230,96,42,0,230,81,40,0,230,57,33,0,230,81,35,0,230,96,40,0
96 DATA 217,108,35,0,217,85,35,0,217,72,35,0,217,53,35,0,217,72,35,0,217,85,35,0
97 DATA 217,108,35,0,217,85,35,0,217,72,35,0,217,60,35,0,0,72,35,0,0,85,35,0
98 DATA 162,0,40,53,162,108,40,53,162,81,40,53,0,64,40,53,0,81,40,53,0,108,40,53
99 DATA 193,0,40,53,193,114,40,53,193,81,40,53,0,64,42,0,0,81,42,0,0,114,40,0
100 DATA 217,0,31,40,217,108,31,40,217,81,31,40,0,64,31,40,7,81,31,40,0,108,31,40
101 DATA 217,0,31,40,217,108,31,40,217,85,31,40,0,60,31,40,0,85,0,31,0,108,35,0
102 DATA 162,0,40,0,162,108,40,0,162,81,40,0,162,64,40,0,162,81,40,0,162,108,40,0
103 DATA 162,0,40,0,162,108,40,0,162,81,40,0,162,64,40,0,162,81,40,0,162,108,40,0
104 DATA 162,0,0,0,162,0,81,0,162,0,64,0,162,0,53,0,162,0,64,0,162,0,81,0
105 DATA 162,0,0,0,162,0,64,0,162,0,53,0,162,0,45,0,162,0,53,0,162,0,64,0
106 DATA 162,0,0,0,162,0,81,0,162,0,60,0,162,0,47,0,162,0,60,0,162,0,81,0
107 DATA 162,0,0,0,162,0,85,0,162,0,60,0,162,0,51,0,162,0,60,0,162,0,85,0
108 DATA 162,0,0,0,162,0,81,0,162,0,64,0,162,0,53,0,162,0,64,0,162,0,81,0
109 DATA 162,0,0,0,162,0,108,0,162,0,81,0,162,0,64,0,162,0,81,0,162,0,108,0
110 DATA 162,64,0,81,162,64,0,81,162,64,0,81,162,64,0,81,162,64,0,81,0,0,0,0
500 GRAPHICS 8:SETCOLOR 2,8,0:COLOR 1:SETCOLOR 1,0,15
510 PLOT 200,0:DRAWTO 200,155:PLOT 260,10:DRAWTO 260,130:PLOT 230,35:DRAWTO 290,35:PLOT 230,15:DRAWTO 290,55
515 PLOT 230,55:DRAWTO 290,15:PLOT 100,15:DRAWTO 60,70:DRAWTO 55,130:DRAWTO 60,140:DRAWTO 120,150:DRAWTO 140,145
517 DRAWTO 160,150:DRAWTO 180,145:DRAWTO 200,150:PLOT 200,135:DRAWTO 110,120:DRAWTO 95,34:DRAWTO 125,34
520 DRAWTO 123,38:DRAWTO 100,38:DRAWTO 112,116:DRAWTO 200,131:PLOT 125,35:DRAWTO 130,32:DRAWTO 122,22
522 DRAWTO 100,15:PLOT 88,34:DRAWTO 78,20:DRAWTO 112,5:DRAWTO 142,34:DRAWTO 105,55
524 PLOT 123,38:DRAWTO 112,45:DRAWTO 107,42:DRAWTO 110,38:PLOT 115,118:DRAWTO 145,90
526 DRAWTO 113,69:DRAWTO 107,72:PLOT 146,89:DRAWTO 109,106:PLOT 200,127:DRAWTO 130,102
528 PLOT 130,80:DRAWTO 140,76:DRAWTO 135,60:DRAWTO 128,60:DRAWTO 120,75
530 PLOT 135,85:DRAWTO 145,79:DRAWTO 140,57:DRAWTO 115,57:DRAWTO 113,73:PLOT 20,155:DRAWTO 317,155
532 PLOT 202,0:DRAWTO 202,155:PLOT 20,0:DRAWTO 317,0:DRAWTO 317,155:PLOT 20,0:DRAWTO 20,155
533 RETURN
540 GOTO 540

Download

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

Credits