Beatty Sequence no. 3b - Casey Mongoven
sr = 96000
kr = 96000
ksmps = 1
nchnls = 2
gisin ftgen 1,0,2048,10,1
gitri ftgen 2,0,2048,9,1,1,0,3,.111111,180,5,.04,0,7,.020408,180,9,.012346,0,11,.008264,180,13,.005917,0,15,.004444,180,17,.00346,0,19,.002770,180,21,.002268,0,23,.001890,180,25,.0016,0,27,.001372,180,29,.001189,0,31,.001041,180,33,.000918,0,35,.000816,180,37,.00073,0,39,.000657,180,41,.000595,0,43,.000541,180,45,.000494,0,47,.000453,180,49,.000416,0,51,.000384,180,53,.000356,0,55,.000331,180,57,.000308,0,59,.000287,180,61,.000269,0,63,.000252,180,65,.000237,0,67,.000223,180,69,.00021,0,71,.000198,180,73,.000188,0,75,.000178,180,77,.000169,0,79,.000160,180,81,.000152,0,83,.000145,180,85,.000138,0,87,.000132,180,89,.000126,0,91,.000121,180,93,.000116,0,95,.000111,180,97,.000106,0,99,.000102,180,101,.000098,0,103,.000094,180,105,.000091,0,107,.000087,180,109,.000084,0,111,.000081,180,113,.000078,0,115,.000076,180,117,.000073,0,119,.000071,180,121,.000068,0,123,.000066,180,125,.000064,0,127,.000062,180
gisqu ftgen 3,0,2048,10,1,0,.333333,0,.2,0,.142857,0,.111111,0,.090909,0,.076923,0,.066667,0,.058824,0,.052632,0,.047619,0,.043478,0,.04,0,.037037,0,.034483,0,.032258,0,.030303,0,.028571,0,.027027,0,.025641,0,.02439,0,.023256,0,.022222,0,.021277,0,.020408,0,.019608,0,.018868,0,.018182,0,.017544,0,.016949,0,.016393,0,.015873,0,.015385,0,.014925,0,.014493,0,.014085,0,.013699,0,.013333,0,.012987,0,.012658,0,.012346,0,.012048,0,.011765,0,.011494,0,.011236,0,.010989,0,.010753,0,.010526,0,.010309,0,.010101,0,.009901,0,.009709,0,.009524,0,.009346,0,.009174,0,.009009,0,.00885,0,.008696,0,.008547,0,.008403,0,.008264,0,.00813,0,.008,0,.007874
gisaw ftgen 4,0,2048,10,1,.5,.333333,.25,.2,.166667,.142857,.125,.111111,.1,.090909,.083333,.076923,.071429,.066667,.0625,.058824,.055556,.052632,.05,.047619,.045455,.043478,.041667,.04,.038462,.037037,.035714,.034483,.033333,.032258,.03125,.030303,.029412,.028571,.027778,.027027,.026316,.025641,.025,.02439,.02381,.023256,.022727,.022222,.021739,.021277,.020833,.020408,.02,.019608,.019231,.018868,.018519,.018182,.017857,.017544,.017241,.016949,.016667,.016393,.016129,.015873,.015625,.015385,.015152,.014925,.014706,.014493,.014286,.014085,.013889,.013699,.013514,.013333,.013158,.012987,.012821,.012658,.0125,.012346,.012195,.012048,.011905,.011765,.011628,.011494,.011364,.011236,.011111,.010989,.01087,.010753,.010638,.010526,.010417,.010309,.010204,.010101,.01,.009901,.009804,.009709,.009615,.009524,.009434,.009346,.009259,.009174,.009091,.009009,.008929,.00885,.008772,.008696,.008621,.008547,.008475,.008403,.008333,.008264,.008197,.00813,.008065,.008,.007937,.007874,.007813
instr 2
idur = p3
iamp = p4
icps = p5
iatt = p6
irel = p7
ipvall = p8
ipvalr = p9
iwav1str = p17
iwav2str = p25
if (p10 == 0) goto addtri
if (p10 == 1) then
kenv linen iamp, iatt, idur, irel
awav1 poscil3 kenv, icps, 1
else
awav1 = 0
endif
addtri:
if (p11 == 0) goto addsqu
if (p11 == 1) then
ilastp = (sr/2)/p5-((sr/2)%p5)/p5
gitbl ftgen 6,0,2048,30,2,1,ilastp
gitbl ftgen 21,0,2048,31,6,1,1,.5
kenv linen iamp, iatt, idur, irel
awav2 poscil3 kenv, icps, 21
else
awav2 = 0
endif
addsqu:
if (p12 == 0) goto addsaw
if (p12 == 1) then
ilastp = (sr/2)/p5-((sr/2)%p5)/p5
gitbl ftgen 7,0,2048,30,3,1,ilastp
gitbl ftgen 20,0,2048,31,7,1,1,.25
kenv linen iamp, iatt, idur, irel
awav3 poscil3 kenv, icps, 20
else
awav3 = 0
endif
addsaw:
if (p13 == 0) goto sum
if (p13 == 1) then
ilastp = (sr/2)/p5-((sr/2)%p5)/p5
gitbl ftgen 8,0,2048,30,4,1,ilastp
kenv linen iamp, iatt, idur, irel
awav4 poscil3 kenv, icps, 8
else
awav4 = 0
endif
sum:
inumwav = (p10 + p11 + p12 + p13 + p14 + p15 + p16)
asigwav1l = (awav1 + awav2 + awav3 + awav4)/inumwav
asigwav1r = (awav1 + awav2 + awav3 + awav4)/inumwav
if (p18 == 0) goto addtri2
if (p18 == 1) then
kenv linen iamp, iatt, idur, irel
awav21 poscil3 kenv, icps, 1
else
awav21 = 0
endif
addtri2:
if (p19 == 0) goto addsqu2
if (p19 == 1) then
ilastp = (sr/2)/p5-((sr/2)%p5)/p5
gitbl ftgen 10,0,2048,30,2,1,ilastp
gitbl ftgen 22,0,2048,31,10,1,1,.5
kenv linen iamp, iatt, idur, irel
awav22 poscil3 kenv, icps, 22
else
awav22 = 0
endif
addsqu2:
if (p20 == 0) goto addsaw2
if (p20 == 1) then
ilastp = (sr/2)/p5-((sr/2)%p5)/p5
gitbl ftgen 11,0,2048,30,3,1,ilastp
gitbl ftgen 23,0,2048,31,11,1,1,.25
kenv linen iamp, iatt, idur, irel
awav23 poscil3 kenv, icps, 23
else
awav23 = 0
endif
addsaw2:
if (p21 == 0) goto sum2
if (p21 == 1) then
ilastp = (sr/2)/p5-((sr/2)%p5)/p5
gitbl ftgen 12,0,2048,30,4,1,ilastp
kenv linen iamp, iatt, idur, irel
awav24 poscil3 kenv, icps, 12
else
awav24 = 0
endif
sum2:
inumwav2 = (p18 + p19 + p20 + p21 + p22 + p23 + p24)
asigwav2l = (awav21 + awav22 + awav23 + awav24)/inumwav2
asigwav2r = (awav21 + awav22 + awav23 + awav24)/inumwav2
il gauss 0.005
il = il+1
ir gauss 0.005
ir = ir+1
asigl = ((iwav1str*asigwav1l)+(iwav2str*asigwav2l))*il*ipvall
asigr = ((iwav1str*asigwav1r)+(iwav2str*asigwav2r))*ir*ipvalr
outs asigl, asigr
endin
#define x1 #11000#
#define x2 #10097#
#define x3 #10087#
#define x4 #10120#
#define x5 #10142#
#define x6 #10250#
#define x7 #10356#
#define x8 #10467#
#define x9 #10535#
#define x10 #10531#
#define x11 #10525#
#define x12 #10522#
#define x13 #10518#
#define x14 #10509#
#define x15 #10501#
#define x16 #10493#
#define x17 #10482#
#define x18 #10520#
#define x19 #10575#
#define x20 #10608#
#define x21 #10650#
#define x22 #10700#
#define x23 #10745#
#define x24 #10789#
#define x25 #10828#
#define x26 #10844#
#define x27 #10879#
#define x28 #10891#
#define x29 #10910#
#define x30 #10935#
#define x31 #10960#
#define x32 #10980#
#define x33 #10998#
#define x34 #10995#
#define r #.02#
i2 0 0.121 $x2 130.458577 0 $r 0.05714 0.94286 0 1 0 0 0 0 0 0.9697 0 0 1 0 0 0 0 0.0303
i2 0.121 0.121 $x5 153.507242 0 $r 0.14286 0.85714 0 1 0 0 0 0 0 0.87879 0 0 1 0 0 0 0 0.12121
i2 0.242 0.121 $x7 171.093308 0 $r 0.2 0.8 0 1 0 0 0 0 0 0.81818 0 0 1 0 0 0 0 0.18182
i2 0.363 0.121 $x10 201.321081 0 $r 0.28571 0.71429 0 1 0 0 0 0 0 0.72727 0 0 1 0 0 0 0 0.27273
i2 0.484 0.121 $x13 236.889322 0 $r 0.37143 0.62857 0 1 0 0 0 0 0 0.63636 0 0 1 0 0 0 0 0.36364
i2 0.605 0.121 $x15 264.02779 0 $r 0.42857 0.57143 0 1 0 0 0 0 0 0.57576 0 0 1 0 0 0 0 0.42424
i2 0.726 0.121 $x18 310.674688 0 $r 0.51429 0.48571 0 1 0 0 0 0 0 0.48485 0 0 1 0 0 0 0 0.51515
i2 0.847 0.121 $x20 346.266139 0 $r 0.57143 0.42857 0 1 0 0 0 0 0 0.42424 0 0 1 0 0 0 0 0.57576
i2 0.968 0.121 $x23 407.442433 0 $r 0.65714 0.34286 0 1 0 0 0 0 0 0.33333 0 0 1 0 0 0 0 0.66667
i2 1.089 0.121 $x26 479.427 0 $r 0.74286 0.25714 0 1 0 0 0 0 0 0.24242 0 0 1 0 0 0 0 0.75758
i2 1.21 0.121 $x28 534.351019 0 $r 0.8 0.2 0 1 0 0 0 0 0 0.18182 0 0 1 0 0 0 0 0.81818
i2 1.331 0.121 $x31 628.757058 0 $r 0.88571 0.11429 0 1 0 0 0 0 0 0.09091 0 0 1 0 0 0 0 0.90909
i2 1.452 0.121 $x34 739.842208 0 $r 0.97143 0.02857 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1