Page 1 of 1

Chaotic music (BBC BASIC)

Posted: Wed Mar 27, 2019 12:16 am
by lurkio
From Mathematical Spectrum magazine, volume 27, number 1, 1994/5:

IMG_4179.jpg
IMG_4180.jpg

Code: Select all

10 MODE7:INPUT'"MU = "MU
20 X=0.4137
30 PRINT;X
40 pitch = 41+96*X
50 SOUND1,-15,pitch,5
60 X=MU*X*(1-X)
70 GOTO30

My crude attempt at adding a graphical representation of the function:

Code: Select all

 10 MODE7:INPUT'"mu = "mu
 20 MODE2:VDU23,1,0;0;0;0;:Y%=1027
 30 X=0.4137
 40 REPEAT:Y%=Y%-4:IFY%<0Y%=1023:CLS
 50 x=X*1279:C%=7:IFx<183C%=1ELSEIFx<366C%=3ELSEIFx<549C%=2ELSEIFx<732C%=4ELSEIFx<915C%=5ELSEIFx<1098C%=6
 60 GCOL0,C%:MOVE0,Y%:DRAWx,Y%
 70 pitch=41+96*X
 80 SOUND1,-15,pitch,5
 90 X=mu*X*(1-X)
100 UNTIL FALSE
:idea:

Re: Chaotic music (BBC BASIC)

Posted: Wed Mar 27, 2019 10:34 am
by flaxcottage
This is bonkers! :lol: :lol: :lol:

Also works in BBCB4W using copy and paste. :D