180 N = NN +R: HOME : VTAB 23: POKE MS,W: PRINT "READY TO EDIT": GOSUB 740: POKE FS,W: GOTO 200
190 HOME : VTAB 22: PRINT "PRESS <ESC> TO END SONG": HGR : CALL H:N = R:A$ = "":V = FI: GOSUB 380
200 FOR ZY = W TO R STEP W: GET G$:Q = VAL(G$): IF Q THEN V = Q: NEXT
210 IF G$ = "0" THEN TF = G: NEXT
220 IF G$ = M$ THEN GOSUB 390: NEXT
230 IF G$ < CHR$(TT) OR G$ > CHR$(96) THEN Q = FRE(W): NEXT
240 IF G$ = E$ OR N >1395 THEN N = N -R:ZY = R: NEXT : RETURN
250 L%(N) = B%(V -R *(TF >W)):TF = TF -R *(TF >W):J = W: IF G$ = S$ THEN J = NI:P%(N) = R:C = W
260 IF NOT J THEN X = A%( ASC(G$) -TT):P%(N) = C%(X):O = Y%(X):C = J%(X)
270 GOSUB 90: POKE P,P%(N): POKE L,L%(N): CALL M: GOSUB 130:N = N +R:I = I +R: NEXT
280 GOSUB 350
290 HOME : VTAB 21: PRINT A$: PRINT : PRINT "PRESS ANY KEY TO STOP THE MUSIC": HGR : CALL H: GOSUB 380: FOR X = R TO N:V = G%(L%(X)):J = NI *(P%(X) = R):C = W: IF NOT J THEN Q = F%(P%(X)):O = Y%(Q):C = J%(Q)
300 GOSUB 90: ON A AND I GOSUB 120: POKE P,P%(X): POKE L,L%(X): CALL M: ON FL GOSUB 130:I = I +R: IF PEEK(K) >HF THEN GOSUB 140: IF FL THEN NEXT : GOTO 180
310 NEXT :NN = N: ON FL GOTO 180: IF PF THEN GOSUB 150: PRINT : PRINT D$"PR#1": POKE 36,40 - LEN(A$)/2: PRINT A$: PRINT D$"PR#0":PF = 0: RETURN
320 HOME : VTAB 21: POKE MS,W
330 PRINT : PRINT "PRESS ANY KEY TO CONTINUE";: POKE CS,W:Q = FRE(W): FOR Q = R TO P: IF PEEK(K) >HF THEN Q = P
340 NEXT : POKE FS,W: GET G$: PRINT : HOME : RETURN
350 PF = 0: IF NOT FL THEN PRINT "DO YOU WANT A PRINTOUT";: GOSUB 160: IF G$ = "Y" THEN PF = 1: GOSUB 430
360 PRINT "DELAY FACTOR = "A: POKE CS,W: INPUT "TYPE NEW DELAY FACTOR, THEN <RETURN>, OR<RETURN> ALONE FOR SAME DELAY: ";G$: IF ( VAL(G$) >W OR G$ = "0") THEN A = VAL(G$)
370 RETURN
380 TF = W:Z = S:B = W:C = W: FOR X = W TO 30:I%(X) = W: NEXT :O = 16: GOSUB 740:I = W: POKE FS,W: RETURN
390 IF NOT I THEN PRINT B$: RETURN
400 I = I -R:N = N -R:Z = INT(H%(I)/HF):V = G%(L%(N)):J = NI *(P%(N) = R):C = H%(I) -HF *Z:Y = K%(I):B = U *(Y >92):O = (Y -TW -B)/G:Z = Z +S: XDRAW V +J AT Z,Y: IF C THEN Z = Z -E: XDRAW C AT Z,Y: IF C = T THEN I%(O) = C
410 IF NOT I THEN CALL H
420 Q = FRE(W): RETURN
430 IF A$ >"" THEN PRINT "USE '"A$"' AS NAME";: GOSUB 160: IF G$ = "Y" THEN RETURN
440 VTAB 18: HTAB 1: CALL -958: PRINT "TYPE SONG NAME (<16 LETTERS):": INPUT "";A$
450 NF = 1: IF LEN(A$) >0 THEN FOR NC = 1 TO LEN(A$):NA = ASC( MID$ (A$,NC,1)):NF = ((NA >64 AND NA <91) OR (NA = 46) OR (NA >47 AND NA <58 AND NC >1)) AND NF = 1: NEXT : IF LEN(A$) >15 OR NF = 0 THEN PRINT B$"INVALID NAME!": FOR NC = 1 TO 1000: NEXT : GOTO 440
460 RETURN
470 TEXT : HOME : HTAB 13: PRINT "NIBBLE MAESTRO": HTAB 11: PRINT "BY DAVID L. SMITH": PRINT "** COPYRIGHT 1985 BY MICROSPARC, INC. **";: PRINT : PRINT "CHOOSE ONE NUMBER:": PRINT : PRINT "1. LISTEN TO A COMPUTER-MADE TUNE"
480 PRINT "2. CREATE A SONG ON THE APPLE ORGAN": PRINT "3. SAVE YOUR SONG ON DISK": PRINT "4. LISTEN TO THE SONG IN MEMORY": PRINT "5. LOAD A SONG FROM DISK": PRINT "6. EDIT THE SONG IN MEMORY"
490 PRINT "7. INSTRUCTIONS": PRINT "8. CATALOG": PRINT "9. QUIT": POKE CS,W: PRINT : IF NOT F THEN HTAB 5: INVERSE : PRINT " MAKE SURE CAPS LOCK IS DOWN ": NORMAL : PRINT : HTAB 13: PRINT "PLEASE WAIT...": GOSUB 750: VTAB PEEK(37): CALL -868
500 HTAB 1: VTAB 17: CALL -958: PRINT "YOUR CHOICE: ";: GOSUB 170: IF G$ = "9" THEN PRINT "QUIT? (Y/N)";: GET G$: PRINT : IF G$ = "Y" THEN TEXT : HOME : END
510 Q = VAL(G$): IF Q <1 OR Q >8 THEN 500
520 IF Q = 1 OR Q = 2 OR Q = 5 THEN VTAB 17: CALL -958: PRINT : PRINT "ANY SONG IN MEMORY WILL BE LOST.": PRINT "OKAY? (Y/N)";: GET G$: PRINT : IF G$ < >"Y" THEN 500
560 PRINT D$"OPEN"A$: PRINT D$"CLOSE": PRINT D$"DELETE"A$: PRINT D$"OPEN"A$: PRINT D$"WRITE"A$: PRINT N: FOR X = R TO N: PRINT P%(X): PRINT L%(X): NEXT : PRINT D$"CLOSE": RETURN
570 A$ = "": GOSUB 430: ONERR GOTO 600
580 IF A$ = "" THEN POKE EF,W: RETURN
590 PRINT D$"VERIFY"A$: PRINT D$"OPEN"A$: PRINT D$"READ"A$: INPUT N: FOR X = R TO N: INPUT P%(X): INPUT L%(X): NEXT : PRINT D$"CLOSE": POKE EF,W: RETURN
600 CALL 818: PRINT D$"CLOSE":Q = PEEK(222): IF Q = 6 OR Q = TT THEN PRINT B$"SORRY, I DON'T KNOW THAT ONE.": FOR NC = 1 TO 1000: NEXT : GOSUB 440: GOTO 580
610 PRINT B$"ERROR #"Q", LINE " PEEK(218) +F * PEEK(219): POKE EF,W: PRINT "PRESS ANY KEY FOR MENU": WAIT -16384,128: POKE -16368,0: GOTO 470
620 TEXT : HOME : HTAB 15: PRINT "INSTRUCTIONS": POKE 34,2: HOME
630 PRINT "THIS PROGRAM ALLOWS YOU TO PLAY THE KEY-BOARD LIKE A 4 OCTAVE ORGAN (1 NOTE AT ATIME).": PRINT : PRINT "BEFORE PLAYING ANY NOTES, SELECT A NOTE LENGTH BY PRESSING ANY NUMBER KEY 1-9."
640 PRINT "IF A TRIPLET IS TO BE PLAYED, ALSO PRESS<0>. THIS SHORTENS THE LENGTH OF THE NEXT 3 NOTES. EXCEPT FOR TRIPLETS, A NOTE DURATION REMAINS IN EFFECT UNTIL ANOTHER NUMBER KEY IS PRESSED."
650 PRINT : PRINT "THE DURATIONS AVAILABLE ARE AS FOLLOWS:": PRINT " 1-16TH","2-DOTTED 16TH": PRINT " 3-EIGHTH","4-DOTTED EIGHTH": PRINT " 5-QUARTER","6-DOTTED QUARTER": PRINT " 7-HALF","8-DOTTED HALF": PRINT " 9-WHOLE": GOSUB 330
660 PRINT : PRINT "IF YOU TYPE FASTER THAN THE ORGAN CAN PLAY, NOTES WILL BE LOST. PLEASE WAIT FOR THE NOTE TO SOUND BEFORE TYPING IN ANOTHER NOTE.": PRINT
670 PRINT "IF YOU MAKE A MISTAKE, YOU CAN ERASE BACK TO THE TOP OF THE DISPLAYED SCORE WITH THE (<--) LEFT-ARROW KEY.": GOSUB 330: PRINT "THE 4 OCTAVES ARE ARRANGED FROM TOP TO BOTTOM OF KEYBOARD:": PRINT
680 PRINT " C C# D E- E F F# G A- A B- B": PRINT " -----------------------------": PRINT "SOPRANO: ! "; CHR$(34);" # $ % & ' ( ) : * -": PRINT " ALTO: Q W E R T Y U I O P @ RET": REM 29 HYPHENS
690 PRINT " TENOR: A S D F G H J K L ; + -> ";: PRINT " BASS: Z X C V B N M , < . > /": PRINT "LOW B-: ? REST: <SPACE BAR>": PRINT
700 PRINT "PRESSING OTHER KEYS WILL PRODUCE LOW B FLAT OR NO NOTE AT ALL.": PRINT : PRINT "WHEN YOUR SONG IS ENDED, PRESS <ESC> TO RETURN TO MENU.": GOTO 330
710 X = RND( - PEEK(78) -F * PEEK(79)): PRINT : FLASH : PRINT " COMPOSING ": NORMAL : FOR N = W TO 41:Q = W:A = TW: FOR X = W TO 6: IF N/TW ^X = INT(N/TW ^X) THEN D%(X) = FI * RND(R):E%(X) = TW * RND(R)
720 Q = Q +D%(X):A = A +E%(X): NEXT :P%(N +R) = C%(N%(Q)):L%(N +R) = B%(A): NEXT :A = W:A$ = "": GOTO 290
770 DIM N%(28),I%(30),C%(F8),Y%(F8),J%(F8),A%(83),G%(192),F%(242),P%(1400),L%(1400),H%(41),K%(41): FOR X = R TO F8:C%(X) = F/TW ^(X/W2) +HA:F%(F/TW ^(X/W2) +HA) = X: READ Q:A%(Q -TT) = X: PRINT ".";: NEXT
780 G%(W) = NI:G%(W2) = R:B%(W) = W2:Q = FJ: FOR X = R TO SE STEP TW:B%(X) = TW ^Q:G%(TW ^Q) = X:G%((TW ^Q) *G/TW) = X +R:B%(X +R) = G *B%(X)/TW:Q = Q +R: NEXT
790 B$ = CHR$(SE):E$ = CHR$(27):M$ = CHR$(E):S$ = " ": HCOLOR= G: SCALE= R: ROT= W: FOR X = M TO 827: READ Z: POKE X,Z: NEXT : FOR X = R TO SE: READ N%(X): FOR N = R TO G:N%(X +SE *N) = N%(X) +W2 *N: NEXT : PRINT ".";: NEXT
800 FOR X = W TO W2: READ Y%(X): NEXT : FOR X = TW TO 11: READ J%(X): NEXT : FOR N = R TO G: FOR X = R TO W2:Y%(X +W2 *N) = Y%(X) -SE *N:J%(X +W2 *N) = J%(X): NEXT : PRINT ".";: NEXT : RETURN
810 DATA 90,88,67,86,66,78,77,44,60,46,62,47,65,83,68,70,71,72,74,75,76,59,43,21,81,87,69,82,84,89,85,73,79,80,64,13,33,34,35,36,37,38,39,40,41,58,42,45
820 DATA 173,48,192,136,208,5,206,1,3,240,9,202,208,245,174,0,3,76,2,3,96
830 DATA 169,64,133,61,169,247,133,62,169,95,133,63,169,32,133,67,169,0,133,60,133,66,160,0,76,44,254: DATA 104,168,104,166,223,154,72,152,72,96: DATA 1,3,5,6,8,10,12: DATA 30,29,29,28,27,27,26,26,25,24,24,23,23