Chaotic music (BBC BASIC)

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
User avatar
lurkio
Posts: 2206
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Chaotic music (BBC BASIC)

Post by lurkio » Wed Mar 27, 2019 12:16 am

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:

User avatar
flaxcottage
Posts: 3779
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: Chaotic music (BBC BASIC)

Post by flaxcottage » Wed Mar 27, 2019 10:34 am

This is bonkers! :lol: :lol: :lol:

Also works in BBCB4W using copy and paste. :D
- John

Image

Post Reply