jhs@MITRE-BEDFORD.ARPA.UUCP (02/09/87)
OK, Dan Fleysher, you're right that I shouldn't have uuencoded this program, I should have just sent it as a .LST file in ASCII. It's a simple little random music generator that illustrates some principles of music theory. The music it makes is not slated for eternal fame, but it is fun to listen to, for awhile at least. Enjoy! -John Sangster, jhs@mitre-bedford.arpa ------------c-u-t---h-e-r-e---f-o-r---MUSIC.LST---demo-program---------------- 100 REM ALEATORIC MUSIC EXPERIMENT 110 REM J. SANGSTER 26 JULY 1986 120 REM 122 REM SET UP RATIOS (4 OCTAVES) 130 DIM T(48) 140 R=2^(-1/12) 150 T(0)=4 160 FOR I=1 TO 48:T(I)=T(I-1)*R:NEXT I 200 REM SET UP ACTUAL NOTES 205 CENTER=63 210 FOR I=0 TO 48:T(I)=T(I)*CENTER:T(I)=INT(T(I)+0.5):NEXT I 300 REM 301 REM PICK RANDOM BASE NOTE T0 AND 302 REM NOTES T1 T2 T3 TO MAKE CHORD 310 TSTART=24:T0=TSTART 320 I=INT(8*RND(0)-3.5) 322 IF RND(0)>0.8 THEN I=I*2 330 T0=T0+I 332 IF T0<TSTART-5 THEN T0=T0+2 334 IF T0>TSTART+5 THEN T0=T0-2 340 T1=T0+INT(2*RND(0)+0.5)+2 350 T2=T1+3*INT(RND(0)+0.5) 360 T3=T2+5*INT(RND(0)+0.5) 369 VOL=8 370 IF T3<=48 THEN 400 371 T3=T3-12:T2=T2-12:T1=T1-12 400 GOSUB 430 410 GOTO 500 430 SOUND 0,T(T0),10,VOL 440 SOUND 1,T(T1),10,VOL 450 SOUND 2,T(T2),10,VOL 460 SOUND 3,T(T3),10,VOL 470 RETURN 500 FOR J=1 TO 10:VOL=VOL*0.895:GOSUB 430:NEXT J 505 IF VOL<0.1 THEN 320 510 IF RND(0)>0.75 THEN GOTO 500 520 GOTO 320