/* L system set up to enter observed data of Mucor m41. Data rounded to nearest 5. Adapted for both lsys and Lsys2midi Fran Soddell Date: 17 Feb 04 Last Updated: 17 Feb 04 */ #define maxgen 150 #define step 0.05 #define maxLength 300 #define pause 5 START : H(0,0,-1,0,-1,0,0)f(pause*step*4) p1:G(x):x=0-> p2:G(x)->F(step*x) /* alternate 3-5 insert a pause at the end of each branch */ /* no tip data, assume */ /* p3:H(x,y,b,z,c,s,g):g=(maxgen-2)&s=1->Tf(pause*step) p4:H(x,y,b,z,c,s,g):g=(maxgen-2)&x>0->G(x)f(pause*step) p5:H(x,y,b,z,c,s,g):g=(maxgen-2)->f(pause*step) */ /* alternate 3-5 end of branch with no pause */ /* no tip data, assume */ p3:H(x,y,b,z,c,s,g):g=(maxgen-2)&s=1->T p4:H(x,y,b,z,c,s,g):g=(maxgen-2)&x>0->G(x) p5:H(x,y,b,z,c,s,g):g=(maxgen-2)-> /* frequency of interbranch distances */ p6:H(x,y,b,z,c,s,g):b=-1->(0.07407)H(x,0,5,z,c,s,g+1) ->(0.03704)H(x,0,10,z,c,s,g+1) ->(0.14815)H(x,0,15,z,c,s,g+1) ->(0.11111)H(x,0,20,z,c,s,g+1) ->(0.22222)H(x,0,25,z,c,s,g+1) ->(0.03704)H(x,0,45,z,c,s,g+1) ->(0.03704)H(x,0,80,z,c,s,g+1) ->(0.07407)H(x,0,85,z,c,s,g+1) ->(0.03704)H(x,0,100,z,c,s,g+1) ->(0.03704)H(x,0,110,z,c,s,g+1) ->(0.03704)H(x,0,115,z,c,s,g+1) ->(0.03704)H(x,0,120,z,c,s,g+1) ->(0.03704)H(x,0,140,z,c,s,g+1) ->(0.07406)H(x,0,300,z,c,s,g+1) /* frequency of distances between changes in direction */ p7:H(x,y,b,z,c,s,g):c=-1->(0.33000)H(x,y,b,0,5,s,g+1) ->(0.35000)H(x,y,b,0,10,s,g+1) ->(0.13000)H(x,y,b,0,15,s,g+1) ->(0.13000)H(x,y,b,0,20,s,g+1) ->(0.03000)H(x,y,b,0,25,s,g+1) ->(0.02000)H(x,y,b,0,30,s,g+1) ->(0.01000)H(x,y,b,0,35,s,g+1) /* branch and change direction */ p8:H(x,y,b,z,c,s,g):y=b&z=c->G(x) MB(g+1) XC H(0,0,-1,0,-1,1,g+1) /* branch */ p9:H(x,y,b,z,c,s,g):y=b->G(x) MB(g+1) H(0,0,-1,z,c,2,g+1) /* change direction */ p10:H(x,y,b,z,c,s,g):z=c->G(x) XC H(0,y,b,0,-1,1,g+1) /* draw (sound note) if step is maximum length */ p11:H(x,y,b,z,c,s,g):x=maxLength->G(x) H(0,y,b,z,c,s,g+1) /* growing between branches and changes of direction */ p12:H(x,y,b,z,c,s,g)->H(x+1,y+1,b,z+1,c,s,g+1) /* 13-15 debugging aids p13:M->[+(90)f(0.1)F(0.1)f(0.2)F(0.1)f(0.1)F(0.1)f(1)] p14:X->[-(90)f(0.1)F(0.2)f(0.1)F(0.2)f(0.1)F(0.2)f(0.1)F(0.2)f(0.1)F(0.2)f(1)] */ /* p15:Y->[+(45)f(0.1)F(0.3)f(0.3)F(0.3)f(0.1)][-(45)f(0.1)F(0.3)f(0.3)F(0.3)f(0.1)] */ /* observed branching angles and frequencies */ /* 14 branches left 13 right, equal probability assumed */ p16:B(g)->(0.01852)[+(70)H(0,0,-1,0,-1,0,g+1)] ->(0.01852)[-(70)H(0,0,-1,0,-1,0,g+1)] ->(0.05556)[+(85)H(0,0,-1,0,-1,0,g+1)] ->(0.05556)[-(85)H(0,0,-1,0,-1,0,g+1)] ->(0.14815)[+(90)H(0,0,-1,0,-1,0,g+1)] ->(0.14815)[-(90)H(0,0,-1,0,-1,0,g+1)] ->(0.07407)[+(95)H(0,0,-1,0,-1,0,g+1)] ->(0.07407)[-(95)H(0,0,-1,0,-1,0,g+1)] ->(0.11111)[+(100)H(0,0,-1,0,-1,0,g+1)] ->(0.11111)[-(100)H(0,0,-1,0,-1,0,g+1)] ->(0.03704)[+(110)H(0,0,-1,0,-1,0,g+1)] ->(0.03704)[-(110)H(0,0,-1,0,-1,0,g+1)] ->(0.01852)[+(115)H(0,0,-1,0,-1,0,g+1)] ->(0.01852)[-(115)H(0,0,-1,0,-1,0,g+1)] ->(0.03704)[+(120)H(0,0,-1,0,-1,0,g+1)] ->(0.03704)[-(120)H(0,0,-1,0,-1,0,g+1)] /* observed angles of changes of direction and frequencies */ /* 45 changes left 55 changes right, equal probability assumed */ p17:C->(0.01500)+(5) ->(0.01500 )-(5) ->(0.08000)+(10) ->(0.08000)-(10) ->(0.04000)+(15) ->(0.04000)-(15) ->(0.09500)+(20) ->(0.09500)-(20) ->(0.06500)+(25) ->(0.06500)-(25) ->(0.05500)+(30) ->(0.05500)-(30) ->(0.07500)+(35) ->(0.07500)-(35) ->(0.01500)+(40) ->(0.01500)-(40) ->(0.01500)+(45) ->(0.01500)-(45) ->(0.04000)+(50) ->(0.04000 )-(50) ->(0.00500)+(60) ->(0.00500)-(60) /* not gathered for Mucor */ /* assume length 10 */ p18:T->F(10*step)