Complementary Beatty Sequences no. 5 - 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
kenv linen iamp, iatt, idur, irel
awav2 poscil3 kenv, icps, 6
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
kenv linen iamp, iatt, idur, irel
awav3 poscil3 kenv, icps, 7
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
kenv linen iamp, iatt, idur, irel
awav22 poscil3 kenv, icps, 10
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
kenv linen iamp, iatt, idur, irel
awav23 poscil3 kenv, icps, 11
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 #1450#
#define x2 #1703#
#define x3 #2015#
#define x4 #2360#
#define x5 #2650#
#define x6 #2955#
#define x7 #3475#
#define x8 #3915#
#define x9 #4305#
#define x10 #4760#
#define x11 #5175#
#define x12 #6310#
#define x13 #7930#
#define x14 #8558#
#define x15 #9670#
#define x16 #10850#
#define x17 #13100#
#define x18 #15400#
#define x19 #21200#
#define x20 #31500#
#define x21 #24050#
#define a #.0031#
#define r #.0055#
i2 0 0.0475 $x1 389.7 $a $r 1 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0
i2 0.0475 0.0475 $x2 394.826744 $a $r 0 1 0 0 0 1 0 0 0 0.95 1 0 0 0 0 0 0 0.05
i2 0.095 0.0475 $x3 400.020934 $a $r 1 0 0 0 0 1 0 0 0 0.9 1 0 0 0 0 0 0 0.1
i2 0.1425 0.0475 $x4 405.283456 $a $r 1 0 0 0 0 1 0 0 0 0.85 1 0 0 0 0 0 0 0.15
i2 0.19 0.0475 $x5 410.61521 $a $r 0 1 0 0 0 1 0 0 0 0.8 1 0 0 0 0 0 0 0.2
i2 0.2375 0.0475 $x6 416.017107 $a $r 1 0 0 0 0 1 0 0 0 0.75 1 0 0 0 0 0 0 0.25
i2 0.285 0.0475 $x7 421.490069 $a $r 0 1 0 0 0 1 0 0 0 0.7 1 0 0 0 0 0 0 0.3
i2 0.3325 0.0475 $x8 427.035031 $a $r 1 0 0 0 0 1 0 0 0 0.65 1 0 0 0 0 0 0 0.35
i2 0.38 0.0475 $x9 432.652941 $a $r 1 0 0 0 0 1 0 0 0 0.6 1 0 0 0 0 0 0 0.4
i2 0.4275 0.0475 $x10 438.344757 $a $r 0 1 0 0 0 1 0 0 0 0.55 1 0 0 0 0 0 0 0.45
i2 0.475 0.0475 $x11 444.111453 $a $r 1 0 0 0 0 1 0 0 0 0.5 1 0 0 0 0 0 0 0.5
i2 0.5225 0.0475 $x12 449.954013 $a $r 1 0 0 0 0 1 0 0 0 0.45 1 0 0 0 0 0 0 0.55
i2 0.57 0.0475 $x13 455.873436 $a $r 0 1 0 0 0 1 0 0 0 0.4 1 0 0 0 0 0 0 0.6
i2 0.6175 0.0475 $x14 461.870733 $a $r 1 0 0 0 0 1 0 0 0 0.35 1 0 0 0 0 0 0 0.65
i2 0.665 0.0475 $x15 467.946928 $a $r 0 1 0 0 0 1 0 0 0 0.3 1 0 0 0 0 0 0 0.7
i2 0.7125 0.0475 $x16 474.103058 $a $r 1 0 0 0 0 1 0 0 0 0.25 1 0 0 0 0 0 0 0.75
i2 0.76 0.0475 $x17 480.340177 $a $r 1 0 0 0 0 1 0 0 0 0.2 1 0 0 0 0 0 0 0.8
i2 0.8075 0.0475 $x18 486.659349 $a $r 0 1 0 0 0 1 0 0 0 0.15 1 0 0 0 0 0 0 0.85
i2 0.855 0.0475 $x19 493.061653 $a $r 1 0 0 0 0 1 0 0 0 0.1 1 0 0 0 0 0 0 0.9
i2 0.9025 0.0475 $x20 499.548183 $a $r 0 1 0 0 0 1 0 0 0 0.05 1 0 0 0 0 0 0 0.95
i2 0.95 0.0475 $x21 506.120048 $a $r 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1