print_off() // no printing needed here reset(44100) // RESETS CONTROL RATE TO AUDIO RATE. THIS OVERRIDES DEFAULT OF 1000. LOWER IF NEEDED FOR PERFORMANCE ISSUES. tempo = 80 // SET TEMPO <-- dur4 = 60/tempo; dur8 = 30/tempo; dur12 = 20/tempo; dur16 = 15/tempo; st = 0; //definitions of rhythmic values maxVol = 20000 // SET MAXIMUM VOLUME <-- dynFF = maxVol*6/7; dynF = maxVol*5/7; dynMF = maxVol*4/7; dynMP = maxVol*3/7; dynP = maxVol*2/7; dynPP = maxVol/7; dynPPP = maxVol/10; dynPPPP = maxVol/20; // definitions of dynamic levels // DATA FROM TETHER CONTROLLER pullLRough = makeconnection("inlet", 1, 0) // all GameTrak values are clamped to 0.0 - 1.0 before inlet sideLRough = makeconnection("inlet", 2, 0) // input values have zipper noise ... forwardLRough = makeconnection("inlet", 3, 0) pullL = makefilter(pullLRough, "smooth", 80) // ... so input values should be smoothed sideL = makefilter(sideLRough, "smooth", 80) forwardL = makefilter(forwardLRough, "smooth", 80) pullRRough = makeconnection("inlet", 4, 0) // and the same for the right side (with cord facing outward) of the controller sideRRough = makeconnection("inlet", 5, 0) forwardRRough = makeconnection("inlet", 6, 0) pullR = makefilter(pullRRough, "smooth", 80) // "pull" refers to amount of string pulled out sideR = makefilter(sideRRough, "smooth", 80) // "side" refers to lateral angle (with cord facing outward) forwardR = makefilter(forwardRRough, "smooth", 80) // "forward" refers to back-and-forth angle sideLbool = makeconnection("inlet", 7, 0) // if sideL exceeds 0.5, toggle is on (1), otherwise toggle off (0) forwardLbool = makeconnection("inlet", 8, 0) // use these Boolean values for discontinuous transformations] sideRbool = makeconnection("inlet", 9, 0) forwardRbool = makeconnection("inlet", 10, 0) // Must initialize outputs (can override later as needed): bus_config("AMINST", "out0-1") bus_config("FMINST", "out0-1") bus_config("WAVETABLE", "out0-1") bus_config("VWAVE", "out0-1") bus_config("STEREO", "in0-1", "out0-1") bus_config("TRANS", "in0-1", "out0-1") bus_config("MMODALBAR", "in0-1", "out0-1") bus_config("MSITAR", "in0-1", "out0-1") // TABLES: // ENVELOPES for amplitude and other control parameters: envSoftPerc = maketable("curve", 1000, 0,0,-2, 1,1,0, 9,1,0, 10,0 ) envPerc = maketable("curve", 1000, 0,0,0, 5,1,0, 95,1,0, 100,0 ) envSuperPerc = maketable("line", 1000, 0,1, 10,1, 99,0 ) envCurveUp = maketable("curve", 1000, 0,0,3, 1,1 ) envCurveDown = maketable("curve", 1000, 0,1,-3, 1,0 ) envCurveUpAmp = maketable("curve", 1000, 0,0,1, 508,1,20, 511,0 ) envRev = maketable("line", 1000, 0,0, 95,1, 100,0 ) envSoftRev = maketable("curve", 1000, 0,0,0, 95,1,-2, 100,0 ) envSharpRev = maketable("curve", 1000, 0,0,3, 95,1,0, 100, 0 ) envDown = maketable("line", 1000, 0,1, 1,0 ) envFade = maketable("line", 1000, 0,0, 5,1, 100,0 ) envLongFade = maketable("curve", 1000, 0,0,0, 5,1,-5, 100,0 ) envUp = maketable("line", 1000, 0,0, 1,1 ) envHalfUp = maketable("line", 1000, 0,0, 1,0, 2,1 ) envFlat = maketable("line", 1000, 0,1, 1,1 ) envSharp = maketable("curve", 1000, 0,0,0, 500,0,1, 999,1 ) envTri = maketable("line", 1000, 0,0, 1,1, 2,0 ) env2Tri = maketable("line", 1000, 0,0, 1,1, 2,0, 3,1, 4,0 ) envHann = maketable("window", 1000, "hanning") envZero = maketable("line", 1000, 0,0, 1,0 ) envOctMod = maketable("line", 1000, 0,0, 3,0, 4,1, 5,0, 6,0 ) envSwoop = maketable("curve", 1000, 0,0,0, 500,0,1, 999,1 ) // WAVETABLES: waveSaw8 = maketable("wave", 1000, "saw8") waveSaw32 = maketable("wave", 1000, "saw32") waveSaw = maketable("wave", 1000, "saw") waveTri17 = maketable("wave", 1000, "tri17") waveSine = maketable("wave", 1000, "sine") waveSquare = maketable("wave", 1000, "square") waveSquare5 = maketable("wave", 1000, "square5") waveSquare9 = maketable("wave", 1000, "square9") waveTransUp = maketable("wave", 1000, 0, 1, 0, 0.4, 0, 0.2, 0, 0.1, 0, 0.05, 0, 0.025, 0, 0.0125) // simulates 8va transposition waveCello = maketable("wave3", 1000, 1,0.003689,0, 2.0167,0.206561,0, 3.0234,0.038787,0, 4.03,0.094815,0, 5.039,0.247546,0, 6.0454,0.049762,0, 7.054,0.046767,0, 8.0624,0.036586,0, 9.067,0.038633,0, 10.077,0.058350,0, 11.0926,0.025122,0, 12.0972,0.009955,0, 13.1005,0.042133,0, 14.1079,0.041724,0, 15.1214,0.008821,0, 16.1241,0.017887,0, 19.1457,0.014579,0) waveBassoon = maketable("wave3", 1000, 1,0.926994,0, 3,0.645786,0, 6,0.412348,0, 7,0.436233,0, 8,0.547544,0, 12,0.690852,0, 16,0.485354,0, 18,0.191528,0, 19,0.410545,0, 21,0.735466,0, 24,0.229833,0, 25,0.305543,0) waveBrass = maketable("wave3", 1000, 1,0.021460,0, 3,0.009213,0, 6,0.001567,0, 7,0.392916,0, 8,0.001070,0, 10,0.022249,0, 12,0.002323,0, 14,1.000000,0, 15,0.003873,0, 16,0.357763,0, 17,0.018961,0, 19,0.003503,0, 20,0.358359,0, 22,0.002245,0, 23,0.039743,0, 24,0.015839,0, 26,0.000723,0, 27,0.022608,0, 30,0.001054,0, 32,0.034359,0, 34,0.032466,0, 38,0.000480,0, 41,0.002036,0, 46,0.007188,0, 49,0.002422,0, 61,0.008005,0, 65,0.005335,0, 68,0.009941,0, 69,0.036334,0, 75,0.002278,0, 81,0.005031,0, 92,0.000706,0, 103,0.168356,0, 106,0.000419,0, 116,0.000348,0, 137,0.042452,0, 138,0.059201,0, 139,0.001026,0, 170,0.001716,0, 171,0.016539,0, 172,0.026519,0, 186,0.000932,0, 204,0.000215,0, 205,0.032372,0, 206,0.115786,0, 208,0.000337,0, 224,0.000756,0, 233,0.000463,0, 240,0.088098,0, 242,0.000596,0, 266,0.000182,0, 274,0.016054,0, 275,0.032858,0, 308,0.001219,0, 342,0.003095,0, 343,0.016319,0, 344,0.008005,0, 376,0.004551,0, 378,0.000392,0, 410,0.003349,0, 412,0.003288,0, 445,0.004292,0, 446,0.007608,0, 479,0.001330,0) waveFlute = maketable("wave3", 1000, 1,1.000000,0, 2,0.030521,0, 3,0.032712,0, 4,0.038703,0, 5,0.008928,0, 6,0.004686,0, 7,0.005373,0) waveOoh = maketable("wave3", 1000, 1,0.042801,0, 2,0.467034,0, 3,0.638080,0, 4,1.000000,0, 5,0.272017,0, 6,0.050774,0, 7,0.101915,0, 8,0.109992,0, 9,0.130291,0, 10,0.097299,0, 11,0.197535,0, 12,0.039706,0, 13,0.013795,0, 14,0.006137,0, 41,0.001783,0, 125,0.002308,0, 126,0.002413,0) waveAah = maketable("wave3", 1000, 1,0.010773,0, 2,0.057991,0, 3,0.041118,0, 4,0.062368,0, 5,0.086318,0, 6,0.077835,0, 7,0.143379,0, 8,0.648062,0, 9,1.000000,0, 10,0.502688,0, 11,0.235956,0, 12,0.395029,0, 13,0.588234,0, 14,0.222031,0, 15,0.075454,0, 16,0.024471,0, 17,0.011476,0, 18,0.001066,0, 19,0.001451,0, 26,0.001860,0, 27,0.005284,0, 28,0.006396,0, 29,0.004989,0, 30,0.002472,0, 31,0.002948,0, 32,0.001633,0, 33,0.002018,0, 34,0.001701,0, 35,0.001860,0, 36,0.002223,0, 37,0.006033,0, 38,0.011657,0, 39,0.018280,0, 40,0.024380,0, 41,0.019368,0, 42,0.013222,0, 43,0.011362,0, 44,0.004989,0, 45,0.006123,0, 46,0.005693,0, 47,0.001089,0, 48,0.000862,0, 49,0.001633,0, 50,0.001814,0, 51,0.002676,0, 52,0.002132,0, 53,0.001678,0, 54,0.000975,0, 121,0.003220,0, 122,0.005375,0, 123,0.006963,0, 124,0.006577,0, 125,0.006668,0, 126,0.002495,0) waveA = maketable("wave3", 1000, 1,0.031915,0, 2,0.147343,0, 3,0.215481,0, 4,0.108111,0, 5,0.222239,0, 6,0.142233,0, 7,0.190143,0, 8,0.380830,0, 9,0.661169,0, 10,1.000000,0, 11,0.295321,0, 12,0.498843,0, 13,0.449890,0, 14,0.279416,0, 15,0.110424,0, 16,0.036979,0, 17,0.017069,0, 18,0.011384,0, 19,0.003024,0, 20,0.003825,0, 21,0.001482,0, 22,0.002207,0, 24,0.000741,0, 38,0.001149,0, 39,0.000695,0, 40,0.000711,0, 41,0.003024,0, 42,0.002343,0, 43,0.004793,0, 44,0.002389,0, 45,0.003674,0, 46,0.001361,0) waveO = maketable("wave3", 1000, 1,0.031676,0, 2,0.187254,0, 3,0.249382,0, 4,0.374980,0, 5,1.000000,0, 6,0.438673,0, 7,0.266758,0, 8,0.223726,0, 9,0.517757,0, 10,0.303980,0, 11,0.024263,0, 12,0.048078,0, 13,0.017967,0, 14,0.015036,0, 15,0.001682,0, 16,0.001459,0, 36,0.001669,0, 37,0.001183,0) waveU = maketable("wave3", 1000, 1,0.047903,0, 2,0.308088,0, 3,0.587261,0, 4,1.000000,0, 5,0.503784,0, 6,0.212012,0, 7,0.171947,0, 8,0.188534,0, 9,0.446146,0, 10,0.076238,0, 11,0.030987,0, 12,0.021600,0, 13,0.007800,0, 14,0.007897,0) waveE = maketable("wave3", 1000, 1,0.028477,0, 2,0.160635,0, 3,0.166984,0, 4,0.231120,0, 5,0.223117,0, 6,0.347286,0, 7,1.000000,0, 8,0.577105,0, 9,0.362470,0, 10,0.096260,0, 11,0.137006,0, 12,0.084698,0, 13,0.119953,0, 14,0.070712,0, 15,0.062053,0, 16,0.039887,0, 17,0.058910,0, 18,0.060260,0, 19,0.082564,0, 20,0.105386,0, 21,0.043876,0, 22,0.032869,0, 23,0.010704,0, 24,0.013746,0, 25,0.003080,0, 26,0.010578,0, 27,0.001401,0, 28,0.019628,0, 29,0.006703,0, 30,0.003358,0, 31,0.002853,0, 33,0.000707,0) waveI = maketable("wave3", 1000, 1,0.039745,0, 2,0.347017,0, 3,0.574496,0, 4,1.000000,0, 5,0.152662,0, 6,0.127256,0, 7,0.072661,0, 8,0.057565,0, 9,0.026106,0, 10,0.017044,0, 11,0.007548,0, 12,0.006810,0, 13,0.003954,0, 15,0.002365,0, 16,0.005278,0, 18,0.002970,0, 19,0.004143,0, 20,0.002686,0, 21,0.005240,0, 22,0.004521,0, 23,0.008210,0, 24,0.013866,0, 25,0.017877,0, 26,0.007813,0, 27,0.002440,0, 28,0.001721,0, 31,0.001135,0, 33,0.001116,0, 34,0.003462,0, 35,0.004275,0, 36,0.006829,0, 37,0.020431,0) waveGna = maketable("wave3", 1000, 1,1,0, 2,1/2,0, 3,1/3,0, 4,0.1/4,0, 5,1/5,0, 6,1/6,0, 7,0.426667,0, 8,0.226667,0, 9,0.086667,0, 11,0.333333,0, 12,0.280000,0, 14,0.266667,0, 16,0.233333,0, 18,0.226667,0, 19,0.293333,0, 20,0.466667,0, 21,0.433333,0, 22,0.420000,0, 23,0.486667,0, 24,0.540000,0, 25,0.106667,0, 26,0.260000,0, 29,0.100000,0, 30,0.246667,0, 31,0.086667,0, 33,0.093333,0, 48,0.113333,0, 49,0.120000,0, 50,0.306667,0, 51,0.320000,0, 52,0.366667,0, 53,0.280000,0, 98,0.220000,0, 99,0.266667,0, 101,0.226667,0, 110,0.313333,0, 111,0.386667,0, 112,0.413333,0, 113,0.106667,0, 114,0.893333,0, 115,0.980000,0, 116,0.720000,0, 117,0.360000,0, 119,0.326667,0, 120,0.393333,0, 121,0.306667,0) waveGneh = maketable("wave3", 1000, 1,1,0, 2,1/2,0, 3,1/3,0, 4,0.1/4,0, 5,1/5,0, 6,1/6,0, 7,0.035824,0, 8,0.012606,0, 9,0.007596,0, 10,0.016808,0, 11,0.005656,0, 12,0.004471,0, 13,0.026289,0, 14,0.090449,0, 15,0.066961,0, 16,0.064106,0, 17,0.008081,0, 18,0.016592,0, 19,0.027905,0, 20,0.019286,0, 21,0.013899,0, 22,0.012444,0, 23,0.007650,0, 24,0.003609,0, 25,0.004148,0, 26,0.007326,0, 27,0.002424,0, 29,0.002532,0, 30,0.003717,0, 31,0.002155,0, 32,0.002316,0, 79,0.002370,0, 80,0.002424,0, 81,0.001939,0, 82,0.002640,0, 101,0.003286,0, 102,0.003825,0, 103,0.004794,0, 104,0.005010,0, 105,0.001939,0, 113,0.001832,0, 114,0.002101,0, 115,0.002855,0, 116,0.003286,0, 117,0.003986,0, 118,0.004202,0, 119,0.003771,0, 120,0.003340,0, 121,0.004256,0, 122,0.004902,0, 123,0.004687,0, 124,0.003933,0, 125,0.003178,0, 126,0.002747,0) wavePrime = maketable("wave3", 1000, 1,1,0, 2,1/2,0, 3,1/3,0, 5,1/5,0, 7,1/7,0, 11,1/11,0, 13,1/13,0, 17,1/17,0, 19,1/19,0, 23,1/23,0, 29,1/29,0, 31,1/31,0, 37,1/37,0, 41,1/41,0, 43,1/43,0, 47,1/47,0, 53,1/53,0, 59,1/59,0, 61,1/61,0, 67,1/67,0, 71,1/71,0, 73,1/73,0, 83,1/83,0, 97,1/97,0, 101,1/101,0 ) waveBachC1 = maketable("wave3", 1000, 1,0.716272,0, 2,1.000000,0, 3,0.057700,0, 4,0.821584,0, 5,0.133527,0, 6,0.339026,0, 7,0.043224,0, 8,0.378311,0, 9,0.015617,0, 11,0.208122,0, 12,0.031667,0, 13,0.127467,0, 14,0.073500,0, 15,0.127323,0, 16,0.034009,0, 17,0.316307,0, 18,0.044623,0, 19,0.127604,0, 20,0.068687,0, 21,0.069790,0, 22,0.049390,0, 23,0.040715,0, 24,0.026383,0, 25,0.015959,0, 26,0.031796,0, 27,0.066064,0, 28,0.029303,0, 29,0.034990,0, 30,0.057442,0, 31,0.010325,0, 32,0.019289,0, 33,0.013929,0) waveBachC2 = maketable("wave3", 1000, 1,0.956580,0, 2,1.000000,0, 3,0.164718,0, 4,0.174879,0, 5,0.084874,0, 6,0.097082,0, 7,0.180957,0, 8,0.192282,0, 9,0.032071,0, 10,0.106455,0, 11,0.032082,0, 12,0.089975,0, 13,0.024051,0, 14,0.109549,0, 15,0.040360,0, 16,0.190723,0, 17,0.006742,0, 18,0.027582,0, 19,0.021680,0, 20,0.059440,0, 21,0.027158,0, 22,0.022204,0, 23,0.006295,0, 24,0.006695,0, 25,0.010449,0, 26,0.027570,0, 27,0.002906,0, 28,0.031153,0, 29,0.008460,0, 30,0.028440,0, 31,0.005689,0, 32,0.004507,0) waveBachCG2 = maketable("wave3", 1000, 1,0.771031,0, 2,0.820874,0, 3,1.000000,0, 4,0.450498,0, 5,0.086630,0, 6,0.659385,0, 7,0.124122,0, 8,0.351184,0, 9,0.249694,0, 10,0.110070,0, 11,0.264098,0, 12,0.262544,0, 13,0.124308,0, 14,0.101034,0, 15,0.121075,0, 16,0.429773,0, 17,0.072931,0, 18,0.018549,0, 19,0.174421,0, 20,0.084496,0, 21,0.078071,0, 22,0.251995,0, 23,0.073221,0, 25,0.294564,0, 26,0.026756,0, 27,0.018798,0, 28,0.066797,0, 29,0.067563,0, 31,0.083273,0, 32,0.024455,0, 33,0.012041,0, 34,0.013906,0, 35,0.024683,0, 36,0.014798,0, 37,0.092040,0, 38,0.007875,0, 39,0.019709,0, 40,0.018777,0, 41,0.008497,0, 42,0.005865,0, 43,0.011295,0, 44,0.006839,0, 45,0.007772,0, 46,0.039046,0, 47,0.004062,0, 48,0.004062,0, 49,0.017803,0, 50,0.003192,0, 52,0.002819,0, 54,0.003523,0, 55,0.003005,0, 56,0.004601,0, 57,0.007627,0, 58,0.002508,0, 59,0.001658,0, 60,0.003751,0, 61,0.006508,0, 62,0.016269,0, 63,0.003606,0, 64,0.003834,0, 65,0.006342,0, 66,0.001865,0, 67,0.001658,0, 68,0.003482,0) waveBachCmaj = maketable("wave3", 1000, 1,0.618192,0, 2,0.827942,0, 3,0.445414,0, 4,1.000000,0, 5,0.216809,0, 6,0.601771,0, 7,0.105825,0, 8,0.456770,0, 9,0.174338,0, 10,0.123179,0, 12,0.620901,0, 13,0.138493,0, 14,0.252426,0, 15,0.325495,0, 16,0.847683,0, 17,0.092346,0, 18,0.620133,0, 19,0.054249,0, 20,0.237857,0, 21,0.108674,0, 22,0.075004,0, 23,0.029543,0, 24,0.866063,0, 25,0.141260,0, 26,0.095225,0, 27,0.037739,0, 28,0.243491,0, 29,0.017460,0, 30,0.294509,0, 32,0.172931,0, 33,0.032744,0, 34,0.043626,0, 35,0.089743,0, 36,0.299006,0, 37,0.016979,0, 38,0.042734,0, 39,0.044265,0, 40,0.329393,0, 42,0.020174,0, 43,0.008038,0, 44,0.019465,0, 45,0.066561,0, 46,0.015027,0, 48,0.461144,0, 50,0.055985,0, 51,0.024032,0, 52,0.020321,0, 54,0.029561,0, 56,0.115657,0, 57,0.005669,0, 59,0.007581,0, 60,0.207839,0, 61,0.007821,0, 62,0.009246,0, 63,0.012629,0, 64,0.297159,0, 65,0.035300,0, 67,0.007780,0, 68,0.014540,0, 69,0.018128,0, 70,0.068801,0, 72,0.062586,0, 73,0.007200,0, 75,0.006267,0, 76,0.021616,0, 78,0.021294,0, 80,0.124627,0, 83,0.009656,0, 84,0.022502,0, 86,0.019893,0, 87,0.001812,0, 88,0.022977,0, 89,0.005318,0, 90,0.055697,0, 92,0.010723,0, 94,0.006150,0, 96,0.084578,0, 97,0.004708,0, 99,0.005411,0, 100,0.012353,0, 102,0.007024,0, 103,0.004931,0, 104,0.025046,0, 105,0.003025,0, 107,0.007534,0, 109,0.002146,0, 111,0.005406,0, 112,0.010747,0, 113,0.001436,0, 115,0.002380,0, 116,0.004743,0, 117,0.001817,0, 119,0.001747,0, 120,0.036397,0, 121,0.004919,0, 123,0.005071,0, 125,0.003465,0, 127,0.177059,0, 129,0.005816,0, 130,0.003125,0) waveBachCmin = maketable("wave3", 1000, 1,0.113596,0, 2,0.096073,0, 3,0.174775,0, 6,0.080855,0, 8,0.112290,0, 12,0.068788,0, 16,0.262317,0, 20,0.299285,0, 21,0.031666,0, 25,0.198678,0, 29,0.012835,0, 33,0.561679,0, 36,0.026516,0, 39,0.933210,0, 42,0.045807,0, 49,0.818538,0, 52,0.043117,0, 54,0.009761,0, 59,0.019522,0, 61,0.025594,0, 63,0.049189,0, 65,0.236492,0, 67,0.189993,0, 71,0.012144,0, 74,0.048190,0, 78,0.364077,0, 81,0.023672,0, 87,0.009761,0, 89,0.003459,0, 91,0.017754,0, 95,0.028284,0) waveBachG1 = maketable("wave3", 1000, 1,0.942364,0, 2,0.515670,0, 3,0.369457,0, 4,1.000000,0, 5,0.114058,0, 6,0.669328,0, 7,0.503165,0, 8,0.256059,0, 9,0.129968,0, 10,0.109561,0, 11,0.176387,0, 12,0.300987,0, 13,0.095574,0, 14,0.111680,0, 15,0.127435,0, 16,0.071159,0, 18,0.036089,0, 19,0.075778,0, 20,0.029474,0, 21,0.074263,0, 22,0.016309,0, 23,0.061090,0, 24,0.011633,0, 25,0.097106,0, 26,0.014321,0, 27,0.025914,0, 29,0.018468,0, 30,0.007250,0, 31,0.081619,0, 32,0.006012,0, 33,0.041881,0, 35,0.063803,0) waveBachG2 = maketable("wave3", 1000, 1,1.000000,0, 2,0.732535,0, 3,0.154319,0, 4,0.777765,0, 5,0.303915,0, 6,0.137581,0, 7,0.177671,0, 8,0.418014,0, 9,0.122435,0, 10,0.144848,0, 11,0.225953,0, 12,0.070317,0, 13,0.044551,0, 14,0.260942,0, 15,0.033541,0, 16,0.445788,0, 17,0.003131,0, 18,0.022634,0, 19,0.016842,0, 20,0.076187,0, 21,0.009341,0, 22,0.045256,0, 23,0.033045,0, 24,0.038368,0, 25,0.012850,0, 26,0.036672,0, 27,0.009941,0, 28,0.014089,0, 29,0.004827,0, 30,0.039268,0, 31,0.003666,0, 32,0.016594,0) waveOrganInharm = maketable("wave3", 1000, 1.000,0.131367,0, 1.530,0.013376,0, 2.215,1.000000,0, 3.716,0.109732,0, 4.432,0.086594,0, 5.094,0.007702,0, 6.095,0.002679,0, 6.698,0.037853,0, 7.480,0.130564,0, 8.698,0.002614,0, 9.976,0.181136,0, 11.255,0.010404,0, 12.167,0.002735,0, 13.330,0.052966,0, 14.290,0.000779,0, 15.588,0.005962,0, 16.802,0.000287,0, 18.671,0.003159,0, 19.881,0.003280,0, 21.179,0.000436,0, 22.413,0.001108,0, 23.498,0.000287,0, 24.277,0.000344,0, 26.246,0.002140,0, 28.097,0.000246,0, 28.991,0.000462,0, 29.858,0.004045,0, 30.597,0.000326,0, 32.452,0.000362,0, 33.648,0.001387,0, 34.665,0.000338,0, 35.749,0.000886,0, 36.451,0.000557,0, 38.643,0.000391,0, 39.927,0.000273,0, 42.238,0.000827,0, 44.071,0.000308,0, 45.109,0.000249,0, 47.276,0.001046,0, 48.521,0.001031,0, 49.767,0.001609,0, 51.000,0.000255,0, 52.486,0.000255,0, 54.498,0.000264,0, 55.405,0.000243,0, 57.995,0.000258,0, 59.745,0.000584,0, 61.613,0.000190,0, 63.201,0.000658,0, 66.021,0.000255,0, 67.627,0.000219,0, 69.927,0.000655,0, 71.171,0.000370,0, 73.128,0.000157,0, 79.118,0.000110,0, 80.337,0.000116,0, 88.535,0.000133,0, 90.655,0.000107,0, 97.807,0.000130,0, 146.661,0.000228,0) waveOrganHarm = maketable("wave3", 1000, 1,0.131367,0, 2,1.000000,0, 4,0.109732,0, 5,0.007702,0, 6,0.002679,0, 7,0.130564,0, 9,0.002614,0, 10,0.181136,0, 11,0.010404,0, 12,0.002735,0, 13,0.052966,0, 14,0.000779,0, 16,0.005962,0, 17,0.000287,0, 19,0.003159,0, 20,0.003280,0, 21,0.000436,0, 22,0.001108,0, 23,0.000287,0, 24,0.000344,0, 26,0.002140,0, 28,0.000246,0, 29,0.000462,0, 30,0.004045,0, 31,0.000326,0, 32,0.000362,0, 34,0.001387,0, 35,0.000338,0, 36,0.000886,0, 39,0.000391,0, 40,0.000273,0, 42,0.000827,0, 44,0.000308,0, 45,0.000249,0, 47,0.001046,0, 49,0.001031,0, 50,0.001609,0, 51,0.000255,0, 52,0.000255,0, 54,0.000264,0, 55,0.000243,0, 58,0.000258,0, 60,0.000584,0, 62,0.000190,0, 63,0.000658,0, 66,0.000255,0, 68,0.000219,0, 70,0.000655,0, 71,0.000370,0, 73,0.000157,0, 79,0.000110,0, 80,0.000116,0, 89,0.000133,0, 91,0.000107,0, 98,0.000130,0, 147,0.000228,0) waveOrganGrinder = maketable("wave3", 1000, 1,0.207474,0, 2,1.000000,0, 3,0.686530,0, 4,0.016429,0, 5,0.007605,0, 6,0.019165,0, 7,0.003728,0, 8,0.023688,0, 9,0.001344,0, 10,0.001007,0, 11,0.001661,0, 12,0.001261,0, 13,0.001841,0, 14,0.001454,0, 15,0.000772,0, 16,0.000261,0, 17,0.000429,0, 18,0.000624,0, 19,0.000523,0, 20,0.000546,0, 21,0.000552,0, 22,0.000650,0, 23,0.000505,0, 24,0.000682,0, 25,0.000353,0, 26,0.000397,0, 27,0.000443,0, 28,0.000337,0, 29,0.000327,0, 30,0.000361,0, 31,0.000160,0, 32,0.000166,0, 33,0.000255,0, 34,0.000205,0, 35,0.000120,0, 36,0.000223,0, 37,0.000187,0, 38,0.000275,0, 39,0.000130,0, 40,0.000090,0, 41,0.000148,0, 42,0.000191,0, 43,0.000168,0, 44,0.000096,0, 45,0.000154,0, 46,0.000205,0, 47,0.000142,0, 48,0.000140,0, 49,0.000180,0, 50,0.000174,0, 51,0.000213,0, 52,0.000265,0, 53,0.000106,0, 54,0.000072,0, 55,0.000195,0, 56,0.000158,0, 57,0.000279,0, 58,0.000112,0, 59,0.000215,0, 60,0.000253,0, 61,0.000245,0, 62,0.000209,0, 63,0.000333,0, 64,0.000261,0, 65,0.000263,0, 66,0.000305,0, 67,0.000265,0, 68,0.000114,0, 69,0.000156,0, 70,0.000197,0, 71,0.000140,0, 72,0.000233,0, 73,0.000255,0, 74,0.000205,0, 75,0.000128,0, 76,0.000209,0, 77,0.000187,0, 78,0.000309,0, 79,0.000164,0, 80,0.000090,0, 81,0.000754,0, 82,0.000150,0, 83,0.000152,0, 84,0.000154,0, 85,0.000168,0, 86,0.000219,0, 88,0.000080,0, 89,0.000108,0, 91,0.000221,0, 92,0.000116,0) waveCello = maketable("wave3", 1000, 1,0.003689,0, 2.0167,0.206561,0, 3.0234,0.038787,0, 4.03,0.094815,0, 5.039,0.247546,0, 6.0454,0.049762,0, 7.054,0.046767,0, 8.0624,0.036586,0, 9.067,0.038633,0, 10.077,0.058350,0, 11.0926,0.025122,0, 12.0972,0.009955,0, 13.1005,0.042133,0, 14.1079,0.041724,0, 15.1214,0.008821,0, 16.1241,0.017887,0, 19.1457,0.014579,0) waveA = maketable("wave3", 1000, 1,0.031915,0, 2,0.147343,0, 3,0.215481,0, 4,0.108111,0, 5,0.222239,0, 6,0.142233,0, 7,0.190143,0, 8,0.380830,0, 9,0.661169,0, 10,1.000000,0, 11,0.295321,0, 12,0.498843,0, 13,0.449890,0, 14,0.279416,0, 15,0.110424,0, 16,0.036979,0, 17,0.017069,0, 18,0.011384,0, 19,0.003024,0, 20,0.003825,0, 21,0.001482,0, 22,0.002207,0, 24,0.000741,0, 38,0.001149,0, 39,0.000695,0, 40,0.000711,0, 41,0.003024,0, 42,0.002343,0, 43,0.004793,0, 44,0.002389,0, 45,0.003674,0, 46,0.001361,0) waveO = maketable("wave3", 1000, 1,0.031676,0, 2,0.187254,0, 3,0.249382,0, 4,0.374980,0, 5,1.000000,0, 6,0.438673,0, 7,0.266758,0, 8,0.223726,0, 9,0.517757,0, 10,0.303980,0, 11,0.024263,0, 12,0.048078,0, 13,0.017967,0, 14,0.015036,0, 15,0.001682,0, 16,0.001459,0, 36,0.001669,0, 37,0.001183,0) waveU = maketable("wave3", 1000, 1,0.047903,0, 2,0.308088,0, 3,0.587261,0, 4,1.000000,0, 5,0.503784,0, 6,0.212012,0, 7,0.171947,0, 8,0.188534,0, 9,0.446146,0, 10,0.076238,0, 11,0.030987,0, 12,0.021600,0, 13,0.007800,0, 14,0.007897,0) waveE = maketable("wave3", 1000, 1,0.028477,0, 2,0.160635,0, 3,0.166984,0, 4,0.231120,0, 5,0.223117,0, 6,0.347286,0, 7,1.000000,0, 8,0.577105,0, 9,0.362470,0, 10,0.096260,0, 11,0.137006,0, 12,0.084698,0, 13,0.119953,0, 14,0.070712,0, 15,0.062053,0, 16,0.039887,0, 17,0.058910,0, 18,0.060260,0, 19,0.082564,0, 20,0.105386,0, 21,0.043876,0, 22,0.032869,0, 23,0.010704,0, 24,0.013746,0, 25,0.003080,0, 26,0.010578,0, 27,0.001401,0, 28,0.019628,0, 29,0.006703,0, 30,0.003358,0, 31,0.002853,0, 33,0.000707,0) waveI = maketable("wave3", 1000, 1,0.039745,0, 2,0.347017,0, 3,0.574496,0, 4,1.000000,0, 5,0.152662,0, 6,0.127256,0, 7,0.072661,0, 8,0.057565,0, 9,0.026106,0, 10,0.017044,0, 11,0.007548,0, 12,0.006810,0, 13,0.003954,0, 15,0.002365,0, 16,0.005278,0, 18,0.002970,0, 19,0.004143,0, 20,0.002686,0, 21,0.005240,0, 22,0.004521,0, 23,0.008210,0, 24,0.013866,0, 25,0.017877,0, 26,0.007813,0, 27,0.002440,0, 28,0.001721,0, 31,0.001135,0, 33,0.001116,0, 34,0.003462,0, 35,0.004275,0, 36,0.006829,0, 37,0.020431,0) waveGna = maketable("wave3", 1000, 1,1,0, 2,1/2,0, 3,1/3,0, 4,0.1/4,0, 5,1/5,0, 6,1/6,0, 7,0.426667,0, 8,0.226667,0, 9,0.086667,0, 11,0.333333,0, 12,0.280000,0, 14,0.266667,0, 16,0.233333,0, 18,0.226667,0, 19,0.293333,0, 20,0.466667,0, 21,0.433333,0, 22,0.420000,0, 23,0.486667,0, 24,0.540000,0, 25,0.106667,0, 26,0.260000,0, 29,0.100000,0, 30,0.246667,0, 31,0.086667,0, 33,0.093333,0, 48,0.113333,0, 49,0.120000,0, 50,0.306667,0, 51,0.320000,0, 52,0.366667,0, 53,0.280000,0, 98,0.220000,0, 99,0.266667,0, 101,0.226667,0, 110,0.313333,0, 111,0.386667,0, 112,0.413333,0, 113,0.106667,0, 114,0.893333,0, 115,0.980000,0, 116,0.720000,0, 117,0.360000,0, 119,0.326667,0, 120,0.393333,0, 121,0.306667,0) waveGneh = maketable("wave3", 1000, 1,1,0, 2,1/2,0, 3,1/3,0, 4,0.1/4,0, 5,1/5,0, 6,1/6,0, 7,0.035824,0, 8,0.012606,0, 9,0.007596,0, 10,0.016808,0, 11,0.005656,0, 12,0.004471,0, 13,0.026289,0, 14,0.090449,0, 15,0.066961,0, 16,0.064106,0, 17,0.008081,0, 18,0.016592,0, 19,0.027905,0, 20,0.019286,0, 21,0.013899,0, 22,0.012444,0, 23,0.007650,0, 24,0.003609,0, 25,0.004148,0, 26,0.007326,0, 27,0.002424,0, 29,0.002532,0, 30,0.003717,0, 31,0.002155,0, 32,0.002316,0, 79,0.002370,0, 80,0.002424,0, 81,0.001939,0, 82,0.002640,0, 101,0.003286,0, 102,0.003825,0, 103,0.004794,0, 104,0.005010,0, 105,0.001939,0, 113,0.001832,0, 114,0.002101,0, 115,0.002855,0, 116,0.003286,0, 117,0.003986,0, 118,0.004202,0, 119,0.003771,0, 120,0.003340,0, 121,0.004256,0, 122,0.004902,0, 123,0.004687,0, 124,0.003933,0, 125,0.003178,0, 126,0.002747,0) // LFOs lfoEnvSquare = maketable("line", 1000, 0,-1, 9,1, 40,1, 49,-1, 99,-1 ) // used as "waveform" in synchronized LFOs lfoForwardL = makeLFO(lfoEnvSquare, tempo/60 + forwardL * (tempo/15 - tempo/60), 0, 1 ) // frequency of LFO on forwardL, with lowest freq = quarter note and highest freq = 16th lfoForwardR = makeLFO(lfoEnvSquare, tempo/60 + forwardR * (tempo/15 - tempo/60), 0, 1 ) lfoSideL = makeLFO(lfoEnvSquare, tempo/60 + sideL * (tempo/15 - tempo/60), 0, 1 ) lfoSideR = makeLFO(lfoEnvSquare, tempo/60 + sideR * (tempo/15 - tempo/60), 0, 1 ) lfoForwardLSmooth = makeLFO("sine", tempo/60 + forwardL * (tempo/15 - tempo/60), 0, 1 ) // use sine waveform if concerned about noise lfoForwardRSmooth = makeLFO("sine", tempo/60 + forwardR * (tempo/15 - tempo/60), 0, 1 ) lfoSideLSmooth = makeLFO("sine", tempo/60 + sideL * (tempo/15 - tempo/60), 0, 1 ) lfoSideRSmooth = makeLFO("sine", tempo/60 + sideR * (tempo/15 - tempo/60), 0, 1 ) lfoFreqAmpL = makeLFO("sine", tempo/60 + sideL * (tempo/15 - tempo/60), forwardL, 1 ) // control frequency of LFO on sideL and depth on forwardL lfoFreqAmpR = makeLFO("sine", tempo/60 + sideR * (tempo/15 - tempo/60), forwardR, 1 ) lfoDur4 = makeLFO(lfoEnvSquare, tempo/60, 0, 1 ) // fixed LFO synchronized to quarter note lfoDur8 = makeLFO(lfoEnvSquare, tempo/30, 0, 1 ) // fixed LFO synchronized to 8th note lfoDur12 = makeLFO(lfoEnvSquare, tempo/20, 0, 1 ) // fixed LFO synchronized to triplet lfoDur16 = makeLFO(lfoEnvSquare, tempo/15, 0, 1 ) // fixed LFO synchronized to 16th note print_off() srand() st = 0 MAXMESSAGE(st, 1) // just plays whole track all the way through bus_config("STEREO", "in0-1", "out2-3") // send to spectdelay rtinput("MMBUF", "piano"); STEREO(st, 0, 270, envUp, 0, 1) // INST 1 <-- piano (spectdelayed and fading in) // cross-fade with unprocessed sound bus_config("STEREO", "in0-1", "out0-1") // no processing rtinput("MMBUF", "piano"); STEREO(st, 0, 270, envDown, 0, 1) // INST 1 <-- piano (not processed and fading out)