O Holy Night

Type
Sound
Category
Christmas hymn with fading scene
Author
W. E. Parker (title pages edited by D. Bell)
Published in
Antic, December 1982 (Vol. 1, No. 5)
Year
1982
Language
Atari BASIC
Requirements
Any Atari 8-bit, Atari BASIC
A GRAPHICS 7 night scene: green hillsides, a brown tree on the left, a small town with two domed towers on the right, and a bright cross-shaped star above, with scattered white stars

About the program

Antic's December 1982 issue had a Christmas theme. Next to Jerry White's Atari Tree it printed this short program by W. E. Parker. It plays the hymn "O Holy Night" in four voices while showing a pastoral scene. The picture starts in daylight. As the music goes on the light slowly fades, and the stars come out, among them the star of Bethlehem.

The version on the Antic disk adds title pages. REMs credit the editing to D. Bell. Before the music starts you get a "O HOLY NIGHT" title and four screens of the Christmas story from Luke 2:8–11 in large GRAPHICS 1 letters.

What you need

Any Atari with Atari BASIC. Turn the volume up.

Typing it in

Most of the program is DATA: five numbers per note, the four pitches and a duration. Copy them carefully, as one wrong value gives a sour chord. {CLEAR} in lines 7040–7090 is ESC then SHIFT-CLEAR, and {inv}…{/inv} marks inverse-video words (Atari key on and off), which come out in another colour in GRAPHICS 1. Line 7080 has an inverse-video quote mark inside the string (PEOPLE."). It doesn't end the string and is printed with the words, so type it in inverse as shown.

How to use it

RUN it and listen. When the DATA runs out, the TRAP 400 in line 90 catches the "out of data" error, and line 400 simply loops, leaving the night scene on the screen. Press BREAK to stop.

How it works

  • Lines 3000–4096 draw the scene in GRAPHICS 23 (GRAPHICS 7 with no text window): three hill lines, the town with its domed towers, a tree, the star's rays and 40 random stars.
  • The background starts at full brightness (BR=15). After every note line 230 lowers it a little (BR=BR-BB), and line 6000 applies it with SETCOLOR 4,0,BR, so the daylight fades over the course of the hymn.
  • Lines 1000–1040 play each chord on all four channels. When the fourth voice's value is below 80, line 1000 switches that channel from pure tone (distortion 10) to distortion 12, which turns the small number into a low, buzzy bass note. The centre of the star blinks with every note (PLOT 133,8 in colours 3 and 0).
  • A few special durations (401–404 and 201) send the program to lines 500–590, which add an extra moving inner voice before the next chord.

Listing

30 REM {inv}  CHRISTMAS HYMN 'O HOLY NIGHT' {/inv}
31 REM **BY W.E. PARKER**
32 REM **TAKEN FROM 'ANTIC' VOL.1/ISSUE 5**
33 REM **TITLE PAGES EDITED BY D.BELL**
34 REM **
35 REM **
40 BB=0.15
50 BR=15
60 L=6
65 GOSUB 5000
75 GOSUB 7000
80 GOSUB 3000
90 TRAP 400
100 READ T1,T2,T3,T4,D
110 RTN=RTN+1
200 GOSUB 1000
210 GOSUB 1090
230 BR=BR-BB
240 GOSUB 6000
300 GOTO 100
400 FOR D=1 TO 500:NEXT D:GOTO 400
500 SOUND 0,50,10,L:SOUND 2,121,10,L:SOUND 3,173,10,L:FOR DLAY=1 TO 300:NEXT DLAY:GOTO 1080
550 SOUND 1,68,10,L:SOUND 3,173,10,L:FOR DLAY=1 TO 200:NEXT DLAY
560 SOUND 0,60,10,L:SOUND 1,76,10,L:FOR DLAY=1 TO 150:NEXT DLAY:GOTO 1080
570 SOUND 1,85,10,L:SOUND 2,121,10,L:SOUND 3,37,P,L:FOR DLAY=1 TO 150:NEXT DLAY:GOTO 1080
580 SOUND 1,68,10,L:SOUND 3,173,10,L:FOR DLAY=1 TO 200:NEXT DLAY:GOTO 1080
590 SOUND 2,102,10,L:FOR DLAY=1 TO 200:NEXT DLAY:GOTO 1080
1000 P=10:IF T4<80 THEN P=12
1005 L=4:L1=2:IF D=601 THEN L=8:L1=6
1007 COLOR 3:PLOT 133,8
1010 SOUND 0,T1,10,L
1020 SOUND 1,T2,10,L
1030 SOUND 2,T3,10,L
1040 SOUND 3,T4,P,L1
1055 COLOR 0:PLOT 133,8
1060 FOR DLAY=1 TO D:NEXT DLAY
1070 IF D=401 THEN 500
1072 IF D=402 THEN 550
1074 IF D=403 THEN 570
1076 IF D=404 THEN 580
1078 IF D=201 THEN 590
1080 RETURN
1090 FOR T=0 TO 3:SOUND T,0,0,0:NEXT T:RETURN
2000 DATA 91,114,153,230,200,91,114,153,230,150,91,114,153,230,50,76,114,128,230,500,76,114,128,182,50
2010 DATA 68,114,128,173,150,68,114,128,173,50,85,114,128,173,150,68,68,128,173,50,57,91,153,230,400
2020 DATA 76,91,114,230,100,76,114,182,230,50,91,114,153,230,150,102,102,173,230,50,114,114,182,40,200
2030 DATA 91,118,153,40,150,85,118,153,40,50,76,121,173,204,200,85,121,136,40,150,102,121,173,40,50
2040 DATA 114,114,182,230,900,91,114,153,230,200,91,114,153,230,150,91,114,153,230,50,76,114,114,182,350
2050 DATA 76,114,128,182,50,68,114,136,173,150,68,114,136,173,50,85,114,136,173,150,68,102,136,173,50
2060 DATA 57,91,153,230,400,76,91,114,230,100,76,114,182,230,50,81,128,182,230,150,91,91,153,230,50
2070 DATA 60,91,153,243,200,76,91,121,243,150,68,96,121,243,50,60,96,136,162,200,57,96,136,162,150
2080 DATA 60,96,136,243,50,91,91,153,182,800,76,121,153,182,100,76,121,173,204,200,68,121,173,40,200
2090 DATA 102,102,153,243,200,76,85,121,40,200,68,91,114,230,150,76,91,114,230,50,57,91,153,230,150,91,91,153,40
2100 DATA 50,68,91,153,230,200,76,91,114,230,150,76,114,153,182,50,76,121,173,204,200,68,121,173,40,200
2120 DATA 102,102,153,243,200,76,85,121,204,200,68,91,114,230,150,76,91,153,230,50,57,91,153,40,150,91,114,153,40
2140 DATA 50,76,114,182,230,400,57,91,114,136,601,60,91,102,136,150,68,91,114,136,50,60,76,121,182,600
2160 DATA 60,91,153,182,100,50,85,114,204,500,68,85,102,204,50,68,85,102,204,150
2180 DATA 68,85,102,204,50,57,91,114,136,400,57,91,114,136,200,57,91,114,136,100
2200 DATA 45,76,114,153,401,76,76,121,173,100,57,76,114,182,402,68,85,114,173,50,76,91,114,153,403
2210 DATA 76,85,121,40,50,68,85,121,40,150,76,85,121,40,50,76,91,114,230,600,57,76,114,182,200,50,76,121,153,400
2240 DATA 76,76,121,173,100,45,76,114,182,404,50,68,114,173,201,57,76,91,153,400,60,85,102,153,200
2260 DATA 57,85,114,153,150,50,85,121,40,50,57,91,114,230,700
3000 GRAPHICS 7+16
3001 C=0:R=0
3002 SETCOLOR 1,12,14
3003 SETCOLOR 2,8,14
3004 SETCOLOR 4,0,14
3005 C=0:R=0
3010 COLOR 2:PLOT 0,45
3020 DRAWTO 40,47:DRAWTO 50,55
3030 DRAWTO 60,60:DRAWTO 100,65:DRAWTO 120,70:DRAWTO 145,75:DRAWTO 159,80:PLOT 2,60:DRAWTO 50,70:DRAWTO 130,95
3032 PLOT 4,70:DRAWTO 52,85:DRAWTO 110,95
3035 COLOR 1
3040 PLOT 73,62:DRAWTO 83,58:DRAWTO 93,58:DRAWTO 93,53:DRAWTO 98,53:DRAWTO 98,56
3050 DRAWTO 102,56:DRAWTO 102,53:DRAWTO 106,53:DRAWTO 106,58:DRAWTO 110,58:DRAWTO 110,53:DRAWTO 114,53
3060 DRAWTO C+114,R+50:DRAWTO C+110,R+48:DRAWTO C+110,R+44:DRAWTO C+114,R+42:DRAWTO C+118,R+38:DRAWTO C+122,R+42
3065 DRAWTO C+125,R+44:DRAWTO C+125,R+48
3070 DRAWTO C+122,50:DRAWTO C+122,R+53:DRAWTO C+126,R+53:DRAWTO C+126,58:DRAWTO C+130,R+58
3080 DRAWTO C+130,R+53:DRAWTO C+136,R+53
3085 C=22
3090 DRAWTO C+114,R+50:DRAWTO C+110,R+48:DRAWTO C+110,R+44:DRAWTO C+114,R+42:DRAWTO C+118,R+38:DRAWTO C+122,R+42
4000 DRAWTO C+125,R+44:DRAWTO C+125,R+48
4010 DRAWTO C+122,50:DRAWTO C+122,R+53:DRAWTO C+126,R+53:DRAWTO C+126,58:DRAWTO C+130,R+58
4020 DRAWTO C+130,R+53:DRAWTO C+136,R+53
4030 DRAWTO C+136,R+58:DRAWTO C+137,R+58
4040 PLOT 20,45:DRAWTO 22,40:DRAWTO 19,34:PLOT 28,46:DRAWTO 25,40:DRAWTO 26,35
4050 PLOT 17,36:DRAWTO 12,33:PLOT 10,34:DRAWTO 5,32:DRAWTO 4,28:DRAWTO 7,18:DRAWTO 9,15:DRAWTO 15,20:DRAWTO 23,19
4060 DRAWTO 30,22:DRAWTO 37,25:DRAWTO 30,37
4070 COLOR 3:PLOT 133,8:PLOT 133,10:DRAWTO 133,40:PLOT 131,8:DRAWTO 125,8:PLOT 135,8:DRAWTO 141,8
4080 PLOT 133,6:DRAWTO 133,1
4090 COLOR 3:FOR Q=1 TO 40:A=INT(RND(0)*155)
4095 B=INT(RND(0)*40):COLOR 3:PLOT A,B:NEXT Q
4096 RETURN
5000 GRAPHICS 2+16
5010 POSITION 4,5
5020 ? #6;"O HOLY NIGHT"
5080 FOR D=1 TO 600:NEXT D
5090 RETURN
6000 SETCOLOR 4,0,BR
6030 RETURN
7000 REM **SCRIPTURE VERSES**
7010 GRAPHICS 1+16
7015 POSITION 0,4
7020 ? #6;"AND THERE WERE IN":? #6:? #6;"THE SAME COUNTRY":? #6:? #6;"SHEPHERDS ABIDING":? #6:? #6;"IN THE FIELD,"
7030 ? #6:? #6;"KEEPING WATCH OVER":? #6:? #6;"THEIR FLOCK":? #6:? #6;"BY NIGHT."
7035 FOR DLAY=1 TO 1200:NEXT DLAY
7040 ? #6;"{CLEAR}":POSITION 0,3:? #6;"AND, LO, THE ANGEL":? #6:? #6;"OF THE LORD":? #6:? #6;"CAME UPON THEM,":? #6
7050 ? #6;"AND THE GLORY":? #6:? #6;"OF THE LORD SHONE":? #6:? #6;"ROUND ABOUT THEM;"
7060 ? #6:? #6;"AND THEY WERE SORE":? #6:? #6;"AFRAID."
7065 FOR DLAY=1 TO 1200:NEXT DLAY
7070 ? #6;"{CLEAR}":POSITION 0,4:? #6;"AND THE ANGEL SAID":? #6:? #6;"UNTO THEM, {inv}FEAR NOT;{/inv}":? #6:? #6;"{inv}FOR, BEHOLD, {/inv}"
7079 ? #6
7080 ? #6;"{inv}I BRING YOU GOOD{/inv}":? #6:? #6;"{inv}TIDINGS OF GREAT JOY{/inv}":? #6:? #6;"{inv}WHICH SHALL BE TO{/inv}":? #6:? #6;"{inv}ALL PEOPLE."{/inv}"
7085 FOR DLAY=1 TO 1200:NEXT DLAY
7090 ? #6;"{CLEAR}":POSITION 0,3:? #6;"{inv}FOR UNTO YOU IS BORN{/inv}":? #6:? #6;"{inv}THIS DAY IN THE CITY{/inv}":? #6:? #6;"{inv}OF DAVID {/inv}"
7100 ? #6:? #6;"{inv}A SAVIOUR, WHO IS {/inv}":? #6:? #6;"CHRIST THE LORD{inv}...{/inv}"
7105 ? #6:? #6:? #6:? #6;"        +{inv}LUKE 2:8-11{/inv}"
7110 FOR DLAY=1 TO 1200:NEXT DLAY
7120 RETURN

Download

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

Credits