10REM *** JOLLY JINGLES ***
20REM *** by L Knight ***
30MODE7:PRINTTAB(12,3)CHR$141;"JOLLY
JINGLES"'TAB(12)CHR$141;"JOLLY JINGLES"
40PRINTTAB(1,9)" In a moment I will s
tart to compose"'" and play for you a s
election of"'" jolly little tunes."''
50PRINT" Once I get started I am lia
ble to"'" go on for ever - so when you
have"'" heard enough press SPACE."'''"
I will then complete the current"'" tu
ne - and shut up."
60FORX=0TO12500:NEXT:MODE4
70PROCinit:VDU5
80PROCchoose`rhythm:PROCchoose`notes:
CLS
90PROCplay
100IFINKEY200<>32GOTO80
110X=INKEY400:MODE7:PRINTTAB(1,8)" I h
ope you enjoyed my little"'" recital an
d had your soul"'" uplifted by it."''''
120PRINT" Available for parties, wedd
ings,"'" funerals etc."''" Rates very
reasonable."'''
130END
140DEFPROCinit
150ENVELOPE1,0,0,0,0,0,0,0,126,-4,-3,-
3,126,100
160ENVELOPE2,0,0,0,0,0,0,0,126,-4,-2,-
4,80,63
170ENVELOPE3,2,-1,2,-1,1,1,1,120,-2,0,
-5,120,30
180ENVELOPE4,2,-1,2,-1,1,1,1,70,-2,0,-
5,70,30
190ENVELOPE5,1,0,0,0,0,0,0,126,-1,0,-1
,126,63
200ENVELOPE6,1,0,0,0,0,0,0,126,-1,0,-1
,90,50
210ENVELOPE7,3,0,0,0,0,0,0,126,-1,0,-2
,126,100
220ENVELOPE8,3,0,0,0,0,0,0,126,-1,0,-2
,100,80
230ENVELOPE9,1,0,0,0,0,0,0,60,-2,-1,-1
,120,50
240ENVELOPE10,1,0,0,0,0,0,0,60,-2,-1,-
1,80,30
250ENVELOPE11,1,0,0,0,0,0,0,60,0,0,-60
,110,80
260ENVELOPE12,1,0,0,0,0,0,0,40,0,0,-40
,70,50
270ENVELOPE13,1,0,0,0,0,0,0,63,20,0,-6
3,75,120
280ENVELOPE14,1,0,0,0,0,0,0,63,30,0,-6
3,50,80
290Z%=0:XO%=0:YO%=0
300e%=RND(7):e2%=RND(7):c%=RND(7)
310VDU23,240,1,1,1,1,1,1,1,1,23,241,1,
1,61,127,255,255,126,60
320DIMD%(3,12):DIMP%(3,12):DIMN%(15):D
IMK%(6)
330FORL%=1TO15:READN%(L%):NEXT
340FORL%=1TO6:READK%(L%):NEXT
350DATA 5,13,21,25,33,41,45,53,61,69,7
3,81,89,93,101,0,16,28,48,64,76
360ENDPROC
370DEFPROCchoose`rhythm
380T%=2+RND(2):B%=2+RND(2)
390FORL%=0TO1:FORN%=0TO8STEP4:J%=0:R%=
B%:FORS%=0TO3:R%=R%-J%:IFR%>1 J%=RND(R%)
ELSEJ%=R%
400D%(L%,N%+S%)=J%*T%:D%(L%+2,N%+S%)=J
%*T%:NEXT:NEXT:NEXT
410FORL%=0TO3:D%(L%,12)=B%*T%:NEXT:END
PROC
420DEFPROCchoose`notes
430K%=4*RND(9)-4
440FORL%=1TO3:FORN%=0TO12:IFD%(L%,N%)<
>0PROCpitch
450P%(L%,N%)=N%(Q%)+K%:NEXT:NEXT
460FORN%=0TO12:P%(0,N%)=P%(2,N%):NEXT
470e%=(e%+RND(5))MOD6+1:e2%=(e2%+RND(5
))MOD7+1
480E%=2*e%:E2%=(RND(2)DIV2)*2*e2%
490I1%=48*(RND(2)-1):I2%=I1%+48*(RND(2
)-1)
500ENDPROC
510DEFPROCplay
515c%=(c%+RND(4))MOD7+1
520VDU19,1,c%,0,0,0
530FORL%=0TO3:FORN%=0TO12:D%=D%(L%,N%)
:IF(N%MOD4)=0 E1%=E%-1ELSEE1%=E%
540IFD%=0GOTO600
550P%=P%(L%,N%):P1%=P%+I1%:P2%=P%+I2%
560REPEATUNTILTIME>Z%
570SOUND&101,E1%,P1%,D%*0.75:SOUND&102
,E2%,P2%,D%
580IFT%=3 Z%=TIME+D%*6.5ELSEZ%=TIME+D%
*5.5
590PROCgraphics
600NEXT:NEXT:ENDPROC
610DEFPROCpitch
620IFN%=0PROCnote0:GOTO680
630IFL%<3ANDN%=12PROCnote12:GOTO680
640IFN%=12PROCfinalnote:GOTO680
650IF(N%>7ANDN%<12ANDD%(L%,N%+1)=0)ORN
%=11PROCpenultnote:GOTO680
660Q%=Q%+(RND(4)*(2*RND(2)-3)):IFQ%<1
Q%=Q%+5
670IFQ%>15 Q%=Q%-5
680ENDPROC
690DEFPROCnote0:Q%=2*RND(5):IFQ%>9 Q%=
Q%+1
700IFQ%=2 Q%=1
710ENDPROC
720DEFPROCnote12:H%=3-2*RND(2):I%=RND(
3)-1:REPEATI%=I%+1:H%=-H%:Q%=Q%+H%*I%:UN
TILQ%=1ORQ%=4ORQ%=6ORQ%=8ORQ%=11ORQ%=13:
ENDPROC
730DEFPROCpenultnote:Q%=Q%+RND(9)-5:H%
=3-2*RND(2):I%=0:REPEATI%=I%+1:H%=-H%:Q%
=Q%+H%*I%:UNTILQ%=3ORQ%=5ORQ%=10ORQ%=12:
ENDPROC
740DEFPROCfinalnote:IFQ%>4ANDQ%<11 Q%=
4+7*(RND(2)-1):ENDPROC
750IFQ%>11 Q%=11ELSEQ%=4:ENDPROC
760DEFPROCgraphics
770X%=N%*100:Y%=9*(P%+10-K%)
780GCOL0,0:MOVEXO%,YO%:VDU240,8,10,241
790GCOL0,1:MOVEX%,Y%:VDU240,8,10,241:X
O%=X%:YO%=Y%:ENDPROC