Simply Music

Author(s): Stan Lemke
Pub Details: Time Designs Magazine v3 n1 (Volume 3, Issue 1)
Date: November/December 1986
Pages: 28
Violinist drawing
Violinist drawing

SIMPLY MUSIC is an all Basic program that uses the three SOUND channels of the TS 2068 to create music. Each “voice” can be adjusted before and while the music is playing (although the music is interupted while the adjustment is made). Phrasing can be selected as Legato (smooth), or not smooth. A tiny metronome ticks off the beats while the music plays.

The program creates a “musical score” by READing in values from DATA statements. Each tone consists of three parts, a FINE TUNE value, a COARSE TUNE value, and the duration (in beats). See chapt.21 of the 2068 User Manual. Note durations are all relative, but in the present song, a WHOLE note gets 8 beats, a HALF note gets 4, a QUARTER note gets 2, and an EIGHTH note gets 1 beat. RESTS are input as 0 (zero). The MUSICAL SCORE begins with the DATA statement in line 8100. First is a title (in quotes). The first number is the number of notes played by this voice. Voice 1 in this case is the Soprano voice. The second number (119) is the FINE tune value, the third value (1) is the COARSE tune value, and the fourth number is the duration of the first tone, 8 beats, a whole note. The following numbers continue to define the musical score of voice one. Line 8110 starts the musical score of voice two. The first number defines the number of tones (and rests) played by this voice. This is followed by the values that define these tones. Line 8120 starts the musical score for the third voice.

This particular arrangement of “CANON IN D” starts with all three voices in harmony, and it sounds as if there is only one voice. After a few bars, the second voice appears, and a short time later, the third. Though simple, the music is effective!

Listing notes: Lines 75 and 76 each have a “?” in quotes. These are UDG “A” and “B” characters respectively. These are the tiny metronome defined in lines 8004 and 8005. Lines 80, 90, 100, 120, 400, and 8000 all have “brackets” in them. This is really the Basic SOUND command, and must be typed with the keyword SOUND. About the only way to debug this song, is to listen as it plays and seek out the “kinks”. When you INPUT data from a printed score, you can actually follow the music one voice at a time and find your errors. If the program plays too slow, it can be speeded up by deleting lines 70 to 77. If you want only Legato (smooth), delete lines 80, 90, and 100 also. SAVE the program to tape after you have typed it in by “RUNing 9999”. The program will auto-run when it loads. “PREPARING SCORE” will flash on the screen as the DATA is read. When completed, you will be able to adjust the voices by pressing “S” for Soprano (voice 1), “A” for Alto (voice 2), and “B” for Bass (voice 3). Press “P” to change the phrasing. Press “ENTER” to play the song.

  10 REM ***********************

Simply Music

(C) by S D Lemke
Lemke Software Development
2144 White Oak
Wichita, Ks. 67207

********************************
20 PAPER 1: BORDER 1: INK 7: C
LS : PRINT AT 10,7; FLASH 1;"PRE
PARING SCORE": GO SUB 8000
30 LET p=0: LET vb=13: LET vs=
13: LET va=13: LET q=0: GO SUB 5
00
40 LET b1=0: LET d1=0: LET f1=
0
50 LET b=0: LET d=0: LET f=0
60 LET b=b-1: LET d=d-1: LET f
=f-1
70 IF INKEY$<>"" THEN GO SUB
200
75 IF q THEN PRINT AT 10,15;"
?"
76 IF NOT q THEN PRINT AT 10,
15;"?"
77 LET q=NOT q
80 IF b<=0 AND p THEN )8,0
85 IF b<=0 THEN LET b1=b1+1:
LET b=s(1,3,b1): LET sv=vs: IF s
(1,1,b1)=0 THEN LET sv=0
90 IF d<=0 AND p THEN )9,0
95 IF d<=0 THEN LET d1=d1+1:
LET d=s(2,3,d1): LET av=va: IF s
(2,1,d1)=0 THEN LET av=0
100 IF f<=0 AND p THEN )10,0
105 IF f<=0 THEN LET f1=f1+1:
LET f=s(3,3,f1): LET bv=vb: IF s
(3,1,f1)=0 THEN LET bv=0
110 IF b1>n1 OR d1>n2 OR f1>n3
THEN GO TO 400
120 )0,s(1,1,b1);1,s(1,2,b1);2,
s(2,1,d1);3,s(2,2,d1);4,s(3,1,f1
);5,s(3,2,f1);8,sv;9,av;10,bv: G
O TO 60
190 REM Adjust Settings
200 LET i$=INKEY$: IF i$="" THE
N RETURN
210 IF i$="B" OR i$="b" THEN L
ET vb=vb+1: IF vb>15 THEN LET v
b=0
220 IF i$="A" OR i$="a" THEN L
ET va=va+1: IF va>15 THEN LET v
a=0
230 IF i$="S" OR i$="s" THEN L
ET vs=vs+1: IF vs>15 THEN LET v
s=0
240 IF i$="S" OR i$="s" THEN P
RINT AT 12,0;"SOPRANO ";AT 12
,8;vs;AT 12,13;: FOR i=1 TO vs:
PRINT PAPER 5;" ";: NEXT i: FOR
i=vs TO 15: PRINT PAPER 1;" ";
: NEXT i
250 IF i$="A" OR i$="a" THEN P
RINT AT 14,0;"ALTO ";AT 14
,8;va;AT 14,13;: FOR i=1 TO va:
PRINT PAPER 6;" ";: NEXT i: FOR
i=va TO 15: PRINT PAPER 1;" ";
: NEXT i
260 IF i$="B" OR i$="b" THEN P
RINT AT 16,0;"BASE ";AT 16,
8;vb;AT 16,13;: FOR i=1 TO vb: P
RINT PAPER 2;" ";: NEXT i: FOR
i=vb TO 15: PRINT PAPER 1;" ";:
NEXT i
270 IF i$="P" OR i$="p" THEN L
ET p=NOT p: PRINT AT 18,0;"Phras
ing is ";("not " AND p);"Legato.
"
280 RETURN
400 )8,0;9,0;10,0: PRINT #0;AT
1,2;"Press any Key to Continue."
: PAUSE 0: GO SUB 500: GO TO 40
500 CLS : PRINT AT 3,8;"Simply
Music": PRINT AT 6,0;t$: LET i$=
"S": GO SUB 240: LET i$="A": GO
SUB 250: LET i$="B": GO SUB 260
510 PRINT AT 20,0;"Press S for
SOPRANO, A for ALTO B for B
ASE, P for PHRASING"
520 PRINT AT 18,0;"Phrasing is
";("not " AND p);"Legato. "
530 PRINT #0; INVERSE 1;" Press
""ENTER"" to Start Song. "
540 GO SUB 200: IF i$<>CHR$ 13
THEN GO TO 540
550 PRINT #0;AT 0,0;TAB 31;" ";
TAB 31;" ": RETURN
8000 DIM s(3,3,400):)0,0;1,0;2,0
;3,0;7,56;8,0;9,0;10,0;11,50;12,
120;13,10
8001 RESTORE 8100: READ t$: READ
n1: FOR i=1 TO n1: FOR j=1 TO 3
: READ s(1,j,i): NEXT j: NEXT i
8002 RESTORE 8110: READ n2: FOR
i=1 TO n2: FOR j=1 TO 3: READ s(
2,j,i): NEXT j: NEXT i
8003 RESTORE 8120: READ n3: FOR
i=1 TO n3: FOR j=1 TO 3: READ s(
3,j,i): NEXT j: NEXT i
8004 DATA 0,192,32,16,60,60,60,2
55,0,3,4,8,60,60,60,255
8005 RESTORE 8004: FOR i=0 TO 15
: READ b: POKE USR "a"+i,b: NEXT
i
8006 RETURN
8098 REM
Canon in D
by Pachebel

8099 REM SOPRANO
8100 DATA " Canon in D
by Pacheb
el",56,119,1,8,245,1,8,190,1,8,8
4,2,8,51,2,8,239,2,8,51,2,8,245,
1,8,74,0,8,84,0,8,94,0,8,99,0,8,
112,0,8,125,0,8,112,0,8,99,0,8,7
4,0,8,84,0,8,94,0,8,99,0,8,112,0
,8,125,0,8,112,0,8,99,0,8
8101 DATA 74,0,8,84,0,8,94,0,8,9
9,0,8,112,0,8,125,0,8,112,0,8,99
,0,8,74,0,8,84,0,8,94,0,8,99,0,8
,112,0,8,125,0,8,112,0,8,99,0,8
8102 DATA 74,0,8,84,0,8,94,0,8,9
9,0,8,112,0,8,125,0,8,112,0,8,99
,0,8,74,0,8,84,0,8,94,0,8,99,0,8
,112,0,8,125,0,8,112,0,8,99,0,20
8109 REM ALTO
8110 DATA 128,119,1,8,245,1,8,19
0,1,8,84,2,8,51,2,8,239,2,8,51,2
,8,245,1,8,119,1,8,245,1,8,190,1
,8,84,2,8,51,2,8,239,2,8,51,2,8,
245,1,8,94,0,8,99,0,8,112,0,8,12
5,0,8,141,0,8,149,0,8,141,0,8,16
7,0,8
8111 DATA 94,0,4,125,0,4,99,0,4,
125,0,4,112,0,4,149,0,4,125,0,4,
149,0,4,141,0,4,188,0,4,149,0,4,
188,0,4,141,0,4,188,0,4,167,0,4,
141,0,4,74,0,2,125,0,2,94,0,2,12
5,0,2,99,0,4,125,0,4,94,0,2,149,
0,2,112,0,2,149,0,2,125,0,4,149,
0,4,112,0,2,188,0,2,141,0,2,188,
0,2,149,0,4,188,0,4,112,0,2,188,
0,2,141,0,2,188,0,2,167,0,4,141,
0,4
8112 DATA 74,0,2,125,0,2,94,0,2,
125,0,2,84,0,2,125,0,2,99,0,2,12
5,0,2,94,0,2,149,0,2,112,0,2,149
,0,2,99,0,2,149,0,2,125,0,2,149,
0,2,112,0,2,188,0,2,141,0,2,188,
0,2,125,0,2,188,0,2,149,0,2,188,
0,2,112,0,2,188,0,2,141,0,2,188,
0,2,99,0,2,167,0,2,125,0,2,141,0
,2
8113 DATA 94,0,2,125,0,2,94,0,2,
125,0,2,99,0,2,125,0,2,99,0,2,12
5,0,2,112,0,2,149,0,2,112,0,2,14
9,0,2,125,0,2,149,0,2,125,0,2,14
9,0,2,141,0,2,188,0,2,141,0,2,18
8,0,2,149,0,2,188,0,2,149,0,2,18
8,0,2,141,0,2,188,0,2,141,0,2,18
8,0,2,125,0,2,167,0,2,125,0,2,14
1,0,14
8119 REM BASE
8120 DATA 56,119,1,8,245,1,8,190
,1,8,84,2,8,51,2,8,239,2,8,51,2,
8,245,1,8,119,1,8,245,1,8,190,1,
8,84,2,8,51,2,8,239,2,8,51,2,8,2
45,1,8,119,1,8,245,1,8,190,1,8,8
4,2,8,51,2,8,239,2,8,51,2,8,245,
1,8
8121 DATA 119,1,8,245,1,8,190,1,
8,84,2,8,51,2,8,239,2,8,51,2,8,2
45,1,8,119,1,8,245,1,8,190,1,8,8
4,2,8,51,2,8,239,2,8,51,2,8,245,
1,8,119,1,8,245,1,8,190,1,8,84,2
,8,51,2,8,239,2,8,51,2,8,245,1,8
8122 DATA 119,1,8,245,1,8,190,1,
8,84,2,8,51,2,8,239,2,8,51,2,8,2
45,1,8,119,1,8,245,1,8,190,1,8,8
4,2,8,51,2,8,239,2,8,51,2,8,245,
1,8,119,1,8,245,1,8,190,1,8,84,2
,8,51,2,8,239,2,8,51,2,8,245,1,2
0
9999 SAVE "Simply M" LINE 1

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.