home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG124.ARC
/
12TONE.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
4KB
|
117 lines
1 REM ****************************************************
2 REM 12 TONE ROW GENERATOR
3 REM BY DANIEL KAAN
4 REM NEW VERSION 1.2 WITH IMPROVED INPUT AND OUTPUT
5 REM ****************************************************
10 CL$=CHR$(26) :REM ******* CLEARSCREEN *******
20 BEL$=CHR$(7) :REM ******* SOUND BUZZER *******
30 CR$=CHR$(13) :REM ******* CARRIAGE RETURN *****
40 DIM A(12) :REM ******* TONE ROW *******
50 DIM NOTE$(12) :REM ******* INPUT STRINGS *******
60 DIM B(11)
70 GOSUB 3000
100 REM ******* CALCULATE MATRIX *******
110 FOR N=1 TO 11:B(N)=A(N)-A(N+1):NEXT N
120 GOSUB 1000
130 FOR F=1 TO 11
140 K=A(1)+B(F)
150 FOR M=1 TO 11
160 GOSUB 2000
170 A(M)=K
180 K=A(M)-B(M)
190 NEXT M
200 GOSUB 2000
210 A(12)=K
220 GOSUB 1000
230 NEXT F
240 PRINT TAB(77);"^"
250 PRINT TAB(77);"|"
260 PRINT TAB(63);"<--- Retrogrades"
270 PRINT:PRINT
280 IF P=1 THEN LPRINT TAB(77);"^"
290 IF P=1 THEN LPRINT TAB(77);"|"
300 IF P=1 THEN LPRINT TAB(63);"<--- Retrogrades"
310 PRINT "More? ([Y]/N)";
320 Y$=INKEY$:IF Y$="" OR (Y$<>"Y" AND Y$<>"y" AND Y$<>"N" AND Y$<>"n" AND Y$<>CR$) THEN GOTO 320
330 IF Y$="Y" OR Y$="y" OR Y$=CR$ THEN RUN
340 END
1000 REM ******* print A(1-12) *******
1010 IF P=1 THEN LPRINT:LPRINT TAB(15);
1020 PRINT TAB(15)
1030 FOR N=1 TO 12
1040 FOR M=1 TO A(N)
1050 READ C$,DUMMY$
1060 NEXT M
1070 RESTORE
1080 PRINT C$;" ";:IF P=1 THEN LPRINT C$;" ";
1090 NEXT N
1100 PRINT:IF P=1 THEN LPRINT
1110 RETURN
2000 REM ******* convert number (K) to range 1 - 12 *******
2010 IF K<1 THEN LET K=K+12
2020 IF K>12 THEN LET K=K-12
2030 IF K<1 OR K>12 THEN GOTO 2000
2040 RETURN
3000 REM ******* Initialise *******
3010 PRINT CL$
3020 PRINT "This programme prints tone-rows."
3030 PRINT
3040 PRINT "Enter the prime row by entering the notes in order."
3050 PRINT "The programme will then calculate a matrix which is read"
3060 PRINT "left to right for the prime row and its transpositions,"
3070 PRINT "right to left for retrograde and its transpositions,"
3080 PRINT "top to bottom for inversion and its transpositions, and"
3090 PRINT "bottom to top for retrograde inversion and its transpositions."
3100 PRINT
3110 PRINT "Please enter the 12 notes, following each with RETURN."
3120 PRINT
3130 PRINT "Use RETURN only to see notes available."
3140 PRINT
3150 PRINT "Use only # signs as no flat is available."
3160 PRINT
3170 FOR N=1 TO 12
3180 PRINT "NOTE"N"IS";:INPUT NOTE$(N)
3190 IF NOTE$(N)="" THEN PRINT:GOSUB 4000:GOTO 3180
3200 IF LEN(NOTE$(N))=1 THEN LET NOTE$(N)=NOTE$(N)+" "
3210 A(N)=0
3220 RESTORE
3230 FOR P=1 TO 12
3240 READ ROW$,LOW$
3250 IF (NOTE$(N)=ROW$ OR NOTE$(N)=LOW$) THEN LET A(N)=P
3260 NEXT P
3270 IF A(N)=0 THEN PRINT:PRINT BEL$;"Note not recognised":PRINT "Please try again.":GOSUB 4000:GOTO 3180
3280 RESTORE
3290 IF N=1 THEN GOTO 3330
3300 FOR M=1 TO N-1
3310 IF A(M)=A(N) THEN PRINT:PRINT BEL$;"You have already used ";NOTE$(N):PRINT "Please try again.":GOSUB 4000:GOTO 3180
3320 NEXT M
3330 NEXT N
3340 PRINT
3350 PRINT "Do you want output to Printer or Terminal? (P/[T])";
3360 P$=INKEY$:IF P$="" OR (P$<>CR$ AND P$<>"P" AND P$<>"p" AND P$<>"T" AND P$<>"t") THEN GOTO 3360
3370 IF P$="P" OR P$="p" THEN LET P=1 ELSE LET P=0
3380 PRINT CL$
3390 IF P=1 THEN LPRINT TAB(29);"TONE ROW GENERATOR":LPRINT:LPRINT
3400 IF P=1 THEN LPRINT "Row & Transpositions --->"
3410 IF P=1 THEN LPRINT "Inversion & Transpositions":LPRINT "|":LPRINT "v"
3420 PRINT TAB(29);"TONE ROW GENERATOR":PRINT:PRINT "Row & Transpositions --->"
3430 PRINT "Inversion & Transpositions":PRINT "|":PRINT "v"
3440 RETURN
4000 REM ******* Input error routine *******
4010 PRINT "The following notes are available:"
4020 RESTORE
4030 FOR Q=1 TO 12
4040 READ Q$,DUMMY$
4050 S=0
4060 FOR R=1 TO 12
4070 IF A(R)=Q THEN GOTO 4090
4080 S=S+1
4090 NEXT R
4100 IF S=12 THEN PRINT Q$;" ";
4110 NEXT Q
4120 PRINT
4130 RETURN
5000 DATA "A ","a ","A#","a#","B ","b ","C ","c ","C#","c#","D ","d "
5010 DATA "D#","d#","E ","e ","F ","f ","F#","f#","G ","g ","G#","g#"
"a ","A#","a#","B ","b ","C ","c ","C#","c#","D ","d "
5010 DATA "D#","d#