8-Bit Software Online Conversion
Night Music (Model B) - Listing
10REM Mozart - The Little Night Music
20REM for 8-BS Public Domain
30REM by M.Bobrowski 9'91
40
50MODE4:VDU23,1;0;0;0;0;:HIMEM=TOP+&B
6:H%=HIMEM
60DIM ch%(3),e%(2),note%(2),K%(3)
70K%(0)=7:K%(1)=2:K%(2)=6:K%(3)=3
80ENVELOPE1,3,0,0,0,0,0,0,125,-5,-2,-
3,125,100
90OSCLI"L.S.Mozart3 5800"
100FORI%=0TO3:PROCset`up(H%):VDU19,1,K
%(I%);0;
110PROCplay:H%=ch%(3):NEXT
120END
130
140DEFPROCset`up(N%)
150ch%(0)=N%:FOR J%=1 TO 3
160REPEAT N%=N%+1:UNTIL?N%=&FF
170N%=N%+2:ch%(J%)=N%
180NEXT
190ENDPROC
200
210DEFPROCplay
220FORC%=0TO2:note%(C%)=0:e%(C%)=0:NEX
T
230REPEAT
240IF ADVAL(-6)>0 PROCsound(0)
250IF ADVAL(-7)>0 PROCsound(1)
260IF ADVAL(-8)>0 PROCsound(2)
270UNTIL e%(0) AND e%(1) AND e%(2)
280ENDPROC
290
300DEFPROCsound(C%)
310P%=ch%(C%)?(note%(C%)*2):D%=ch%(C%)
?(note%(C%)*2+1)
320IF P%=255 e%(C%)=TRUE:ENDPROC
330IF P%=0 E%=0 ELSE E%=1
340SOUND C%+1,E%,P%,D%
350note%(C%)=note%(C%)+1
360ENDPROC