home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C64'er
/
C64'er.iso
/
sh6x
/
sh62b.d64
/
bassist
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
10KB
|
343 lines
10 REM *********+*
20 REM * BASSIST *
40 REM ***********
50 :
60 REM (C) 1985, ROBERT TREICHLER, FL-9497 TRIESENBERG (F.TUM LIECHTENSTEIN)
70 :
80 POKE53280,0:POKE53281,0:PRINTCHR$(14)CHR$(8)"[147]"
90 IFZ=0THENZ=1:X$="":Z$="":LOAD"BASS/IRQ",8,1:REM ASS-PROG.EINLESEN
100 :
101 REM DEFINITIONEN & INIT.
102 :
200 HM=100:DIMH$(HM),HD%(HM),HA%(HM),HS%(HM),HG%(HM),F(11),P(4,2)
205 DIMS$(12,1),SP(6),SM(11),X$(16)
210 REM FUNC.F.BIT-MUSTER (Y=BIT-MUSTER,Z=GRUNDTON,N=NR.1/2-TON UEBER GRUNDTON):
212 DEFFN BS(N)=YORSM(N+Z+(N+Z>11)*12):REM FUNCT. SET BIT
214 DEFFN BC(N)=YAND4095-SM(N+Z+(N+Z>11)*12):REM FUNCT. CLEAR BIT
216 DEFFN BT(N)=YANDSM(N+Z+(N+Z>11)*12):REM FUNCT. TEST BIT
220 F=110:FORI=0TO11:F(I)=F:F=F*1.059463094:SM(I)=2^I:NEXT:REM FREQU.+BIT-MASK.
230 FORI=0TO6:READSP(I):NEXT:REM SKALA-POINTERS (A...G)
240 FORJ=0TO1:FORI=0TO12:READS$(I,J):NEXTI,J:REM #- & B-SKALEN
250 FORI=0TO4:FORJ=0TO2:READP(I,J):NEXTJ,I:REM PARAMETER
260 C$=CHR$(13):R=54272:REM ADR.SID-REG.
265 MN$=" < MIT 'F1' ZURUECK INS [205]ENUE >"
266 M0$=" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
267 M1$=" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
268 M2$=" [167] "
269 M3$=" [167] [165]"
270 PS$=" -[219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219]+"
275 L$=" "
280 FA=.943874:FK=6.378901:F6=1.019440644:FO=1.37:F1=150:F2=300:REM FREQU.KONST
290 AP=49152:FS=AP+22:RB=251:RP=252:REM ADR.F.ASS-PROG
300 :
301 REM MENUE
302 :
310 GOSUB6950:Z=32:PRINT"[147][159]"M0$:PRINTM3$
320 PRINTM2$TAB(13)"[194] [193] [211] [211] [201] [211] [212]"TAB(Z)"[165]":PRINTM3$:PRINTM1$:PRINTM0$:PRINTM3$
321 PRINTM2$"1=[206]EUEINGABE/[197]DITIEREN"TAB(Z)"[165]":PRINTM3$
322 PRINTM2$"2=[193]BSPEICHERN AUF [196]ISK"TAB(Z)"[165]":PRINTM3$
323 PRINTM2$"3=[197]INLESEN VON [196]ISK"TAB(Z)"[165]":PRINTM3$
324 PRINTM2$"4=[208]LAY [194]ASS [211]OLO"TAB(Z)"[165]":PRINTM3$
325 PRINTM2$"5=[208]LAY [194]ASS+[211]CHLAGZEUG"TAB(Z)"[165]":PRINTM3$
326 PRINTM2$"6=[208]ARAMETER-[197]INSTELLUNG"TAB(Z)"[165]":PRINTM3$
327 PRINTM2$"7=[197]NDE"TAB(Z)"[165]":PRINTM3$:PRINTM1$
330 GETZ$:IFZ$<"1"ORZ$>"7"THEN330
340 Z=VAL(Z$):ONZGOSUB8000,2000,3000,500,505,5000,900
350 POKE198,0:GOTO300
390 END
500 :
501 REM PLAY
502 :
504 KP=1:GOTO510
505 KP=0
510 PRINT"[147] "MT$:PRINT""MN$""
520 TR%=1:AZ=1:FL=0:H=0:H$(HT+1)=H$(1):PR$=""
525 AU=HD%(HT)-A4+1:IFAU<1THENAU=1
530 GOSUB6900:GOSUB1800
540 FORW=1TOWA:HB=-1:HN=1:H4=0
550 HL=H:H=HN:HN=H+1:IFH>HTTHEN850
555 IFH<HLTHENPR$="[215]IEDERHOLUNG"
560 IFH>HL+1THENPR$="[197]NDE [215]IEDERHOLUNG"
570 IFHN=HB+1THENHN=HW:HB=-1
580 IFH$(HN)="W"THENHB=HD%(HN):HW=HN+1:HN=HG%(HN)
590 FORHD=1TOHD%(H):H4=H4+1:IFH4>A4THENH4=1
600 :
601 REM TON BESTIMMEN
602 :
605 IFH$(H)="[208]AUSE"THEN630
610 IFW<WAORH<HT ORHD<AUTHEN640
620 IFHD=AUTHENTA%=HG%(H):GOTO680:REM LETZTER TAKT BASS AUSHALTEN
630 TA%=12:FW=0:GOTO720:REM PAUSE
640 IF(H4AND1)ORHD=HD%(H)THEN650
645 IFRND(0)<P(3,0)THEN630
650 IFHD=1ANDHG%(H)<>HG%(HL)THENTA%=HG%(H):GOTO680:REM NEUE HARMONIE BEGINNT
660 IFHD<>HD%(H)ORHG%(H)=HG%(HN)THEN670:REM ES FOLGT KEINE NEUE HARMONIE
662 IFH$(HN)="[208]AUSE"THENTA%=HG%(H):GOTO680:REM PAUSE FOLGT
665 SYSAP+12,HA%(H),HA%(HN),HG%(H),HG%(HN),TR%,TA%:GOTO680:REM UEBERG.TON SUCHEN
670 IFRND(0)<P(4,0)THENSYSAP+15,HA%(H),TA%:GOTO680:REM ZUFALLS-TON
675 SYSAP+9,HA%(H),TR%,TA%:REM NAE.AKKORDEIG.TON SUCHEN
680 F=F(TA%):IFF=FLORF*FO<FLANDF+F<>FLTHENF=F+F:REM FREQU.
690 TR%=1+2*(F<FL):IFF<F1THENTR%=1:REM TREND BESTIMMEN
695 IFF>F2THENTR%=-1:REM ...DABEI ECKFREQU. BEACHTEN
700 :
701 REM TON AUSGEBEN
702 :
710 FL=F:FW=F*FU:REM FREQU.IN SID-WERT UMRECHNEN
720 IF(HD>1ORH$(H)=H$(HL))ANDH4>1THEN800
730 IFAZTHENGOSUB1500:AZ=0
740 IFPEEK(FS)THEN740:REM WARTE BIS LETZTER TON V.IRQ-ROUT.BEHANDELT ...
750 IFPR$>""THENPRINT:PRINT:PRINTPR$:PR$=""
760 PRINT:PRINTH$(H)TAB(9)": ";:REM ..ERST DANN HARMONIE-BEZ. AUSGEBEN
800 SYSAP+6,H4,FW,FW*FA,S$(TA%,HS%(H)):REM TON MIT BEZ. ->ASS-PROG
820 IFPEEK(197)=4THENHD=HD%(H):HN=HT+1:W=WA:REM ABBRUCH
830 NEXTHD:GOTO550
850 NEXTW:SYSAP+6,0,0,0,"":SYSAP+3:REM IRQ-ROUT. AUS
890 FORI=0TO1500:NEXT:RETURN
900 :
901 REM ENDE
902 :
990 END
1300 :
1301 REM WERTE ZU EINER HARMONIE GENERIEREN
1302 :
1308 Z=SP(ASC(X$)-193):Z$=MID$(X$,2,1):X=0
1310 IFZ$="#"THENZ=Z+1:GOTO1335
1320 IFZ$="B"THENZ=Z-1-(Z<1)*12:X=1:GOTO1335
1330 IFZ$<>" "THENX$=LEFT$(X$,1)+" "+MID$(X$,2)
1332 IFZ=3ORZ=8THENX=1:REM C- & F-SKALEN MIT B (NICHT #)
1335 H$(HT)=X$:HG%(HT)=Z:HS%(HT)=X:REM BEZ./GRUNDTON/SKALA (# ODER B)
1340 FORI=0TOHT-1:IFH$(I)=X$THENY=HA%(I):GOTO1400
1345 NEXTI:Y=0
1350 Y=FNBS(0)+FNBS(4)+FNBS(7):REM BIT-MUSTER F.GRUND-DREIKLANG
1355 FORI=2TOLEN(X$):Z$=MID$(X$,I,1)
1360 IFZ$="M"THENY=FNBC(4):Y=FNBS(3):GOTO1399:REM MOLL
1365 IFZ$="J"THENY=FNBC(10):Y=FNBS(11):GOTO1399:REM MAJOR
1370 IFZ$="+"THENY=FNBC(7):Y=FNBS(8):GOTO1399:REM QUINTE +
1375 IFZ$="-"THENY=FNBC(7):Y=FNBS(6):GOTO1399:REM QUINTE -
1380 IFZ$="0"ORZ$="O"THENY=FNBC(4):Y=FNBS(3):Y=FNBC(7):Y=FNBS(6):REM VERMINDERT
1382 IFZ$="6"THENY=FNBS(9):GOTO1399:REM SEXTE
1385 IFZ$="7"THEN1398
1386 IFZ$="9"THEN1397
1387 IFZ$="1"THEN1396
1388 IFZ$="3"THEN1395
1390 GOTO1399
1395 Y=FNBS(9):REM 13-ER
1396 Y=FNBS(5):REM 11-ER
1397 Y=FNBS(2):REM 9-ER
1398 IFFNBT(11)=0THENY=FNBS(10):REM 7-ER, WENN NICHT SCHON MAJOR-7
1399 NEXTI
1400 HA%(HT)=Y:PRINT:PRINTX$TAB(9)": ";
1410 FORI=0TO11:IFFNBT(I)=0THEN1450
1420 PRINTS$(I+Z+(I+Z>11)*12,X)" ";
1450 NEXTI:PRINT:RETURN
1500 :
1501 REM ANZAEHLEN
1502 :
1510 SYSAP:REM INIT.IRQ-PROG.
1511 PRINT:PRINT"[211]TIMMTON : "S$(TA%,HS%(H))
1512 POKERB,1:Z=FW:FORI=1TOA4
1514 SYSAP+6,128,Z,0,"":Z=0:NEXT
1515 IFPEEK(FS)THEN1515
1516 PRINT:PRINT"[193]NZAEHLEN:";
1520 POKERP,1:FORI=1TOA4
1530 SYSAP+6,128,0,0,STR$(I):NEXT
1540 IFKPTHENPOKERP,0
1550 PR$=" ":RETURN
1800 :
1801 REM FREQU.UMRECHN.KONST. & TEMPO RECHNEN/->ASS.PROG.
1802 :
1820 FU=FK*F6^P(0,0):T0%=0
1840 REM VORSCHLAEGE BEI TEMPI<130 ->1/16-NOTEN, WENN SCHNELLER ->1/8-TRIOLEN
1850 IFP(1,0)<130THENZ=INT(900/P(1,0)+.5):T2%=2*Z:T3%=T2%+Z:T4%=T3%+Z:GOTO1870
1860 Z=INT(1200/P(1,0)+.5):T2%=Z:T3%=T2%+Z:T4%=T3%+Z:GOTO1870
1870 POKER+5,10+T4%/50:REM BASS-DECAY AUFGRUND TEMPO
1880 SYSAP+18,T2%,T3%,T4%:RETURN
1897 :
1898 REM TON -> SID
1899 :
2000 :
2001 REM ABSPEICHERN AUF DISK
2002 :
2010 PRINT"[147][193]BSPEICHERN AUF [196]ISK"
2020 INPUT"[205]USIK-[212]ITEL";MT$
2030 GOSUB2700:IFERTHENRETURN
2040 OPEN2,8,2,MT$+",S,W":GOSUB2800:IFER=0THEN2050
2042 IFER<>63THENRETURN
2044 PRINT"[213]EBERSCHREIBEN (J/N)? ";
2046 GETZ$:IFZ$<>"J"ANDZ$<>"N"THEN2046
2048 PRINTZ$:IFZ$="N"THEN2090
2049 CLOSE2:PRINT#15,"S0:"+MT$:GOTO2040
2050 PRINT#2,HT;C$;A4;C$;WA:FORI=0TO4:PRINT#2,P(I,0):NEXT
2060 GOSUB2800:IFERTHENRETURN
2070 FORI=1TOHT:PRINT#2,H$(I);C$;HA%(I);C$;HS%(I);C$;HG%(I);C$;HD%(I):NEXTI
2090 GOSUB2800:CLOSE2:CLOSE15:RETURN
2600 :
2700 OPEN15,8,15,"I0"
2800 INPUT#15,ER,ER$,ET,ES:IFER=0THENRETURN
2820 PRINT:PRINTER;ER$;ET;ES:IFER<20ORER=63THENRETURN
2850 :
2900 CLOSE2:CLOSE15
2910 :
2950 PRINT:PRINT"<[212]ASTE DRUECKEN>":POKE198,0
2960 GETZ$:IFZ$=""THEN2960
2980 RETURN
3000 :
3001 REM EINLESEN VON DISK
3002 :
3010 PRINT"[147][212]ITEL EINGEBEN ODER '[210]ETURN' FUER":PRINT"[201]NHALTSVERZEICHNIS"
3020 MT$="":INPUTMT$:IFMT$>""THEN3040
3030 GOSUB3500:IFERORMT$=""THENRETURN
3040 GOSUB2700:OPEN2,8,2,"0:"+MT$+",S,R":GOSUB2800:IFERTHENRETURN
3050 INPUT#2,HT,A4,WA:FORI=0TO4:INPUT#2,P(I,0):IFP(I,0)<P(I,1)THENP(I,0)=P(I,1)
3055 IFP(I,0)>P(I,2)THENP(I,0)=P(I,2)
3060 NEXTI:GOSUB2800:IFERTHENRETURN
3065 PRINT"[147]"MT$" :"STR$(A4)"/4-[212]AKT":PRINT"[200]ARMONIE [196]AUER IN 1/4"
3070 FORI=1TOHT:INPUT#2,H$(I):Z=ASC(H$(I)+CHR$(0)):IFZ=87ORZ=208THEN3080:REM W+P
3075 IFZ<193ORZ>199THENPRINT:PRINT"*** [198]ILE-[198]EHLER ***":GOTO2900
3080 INPUT#2,HA%(I),HS%(I),HG%(I),HD%(I)
3090 PRINTH$(I)TAB(12)HD%(I):NEXTI:FORI=0TO500:NEXT:GOTO3900
3500 :
3510 GOSUB2700:IFERTHENRETURN
3515 OPEN2,8,2,"#":DT=18:DS=1
3520 PRINT#15,"U1";2;0;DT;DS
3522 PRINT"[147][201]NHALT:":PRINT"[206]R