desc:Saike ToneStacks (BETA) tags: parametric eq equalization tonestack tone guitar version: 0.07 author: Joep Vanlier changelog: Minor optimization. Add wah filter. Add bone ray. license: MIT This plugin is based on the work of jatalahd and ~arph from diystompboxes.com forum. See their plugin here: http://www.guitarscience.net/tsc/info.htm All I did was take their models, convert them with the BLT and generate code with common subexpression elimination. The models are simulated using the transposed direct II form for stability. slider1:ToneStack=0<0,7,{Marshall,Fender,Vox,James,E-Series,Bench,Big Muff,Hiwatt,Crate,Dumble Rock (incorrect model),Dumble Jazz,Aria,BoneRay,Wah>Type slider2:slider_Bass=.5<0,1,.001>Bass slider3:slider_Mid=.5<0,1,.001>Mid slider4:slider_Treble=.5<0,1,.001>Treble slider5:sVol=1<0,1,.001>-Vol slider6:compensateGain=1<0,2,1{No,Peak,RMS}>Normalize gain slider7:Kstar=.95<0.2,1,.00001>-Magic factor slider8:non_legacy=1<0,1,1{No,Yes}>-Use the correct frequency scaling @init init = 0; fftSize = 8192; bufferDist = 65536; impulseLoc = 4*bufferDist; impulseLocGainEs = 5*bufferDist; currentModel = -1; // Pot A function logA(r) instance() local() global() ( (r < .5) ? r = 0.6*r : r = r*1.4 - .4 ); // Pot B function logB(r) instance() local() global() ( r < .5 ? r = 0.2*r : r = r*1.8 - .8 ); function initFender(K) instance(a0, a1, a2, a3, b0, b1, b2, b3, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, Bass, Mid, Treble ) global(sBass, sMid, sTreble) ( Bass = logA(sBass); Mid = sMid; Treble = logA(sTreble); coeffs = 4; x0 = Bass*Mid; x1 = Bass*Treble; x2 = Mid*Treble; x3 = -Treble + 1.0; x4 = 15.625000000000002*x3; x5 = Mid*x3; x6 = K*(Bass*x4 + 30136.375*Bass + 1675.4549999999999*Mid + Treble*x4 + 5073.875*Treble + 117.5*x0 + 6250.0*x1 + 367.5*x2 + 0.625*x5 + 20358.0); x13 = K*K; x7 = x13*K; x8 = Treble*x0; x9 = Bass*x3; x10 = Bass*x5; x11 = x1*x3; x12 = x7*(0.0011162499999999998*Bass + 0.00030491250000000002*x0 + 0.00018359375*x1*x5 + 0.010413437499999999*x1 + 0.00083571874999999998*x10 + 0.0025335937499999998*x11 + 0.00076228125000000005*x8 + 0.010134374999999999*x9); x14 = x13*(163.21528749999999*Bass + 0.0381465*Mid + 0.31696874999999997*Treble*x3 + 0.02296875*Treble*x5 + 0.034912500000000013*Treble + 13.40199125*x0 + 42.159374999999997*x1 + 0.0073437499999999996*x10 + 0.39062500000000006*x11 + 0.09536625*x2 + 0.10455375*x5 + 2.9375*x8 + 1.87946875*x9 + 1.4075249999999999); x15 = 250000*Bass + 10000*Mid + 250000*Treble + x14 + 1000000; x16 = 3*x12; x17 = 750000*Bass + 30000*Mid + 750000*Treble - x14 + 3000000; x18 = -x6; x19 = K*(25062.5*Bass + 1472.5*Mid + 62.500000000000007*Treble); x20 = x7*(0.00029375000000000001*x0 + 0.0073437499999999996*x1 + 0.000734375*x10 + 0.000734375*x8); x21 = x13*(0.91874999999999996*Bass + 0.036750000000000005*Mid + 0.91874999999999996*Treble + 11.779375*x0 + 1.5625000000000002*x1 + 0.091874999999999998*x2 + 0.091874999999999998*x5 + 1.5625000000000002*x9); x22 = 3*x20; x23 = -x21; x24 = -x19; a0 = (x12 + x15 + x6); a1 = (-x16 + x17 + x6)/a0; a2 = (x16 + x17 + x18)/a0; a3 = (-x12 + x15 + x18)/a0; b0 = (x19 + x20 + x21)/a0; b1 = (x19 - x22 + x23)/a0; b2 = (x22 + x23 + x24)/a0; b3 = (-x20 + x21 + x24)/a0; ); function initMarshall(K) instance(a0, a1, a2, a3, b0, b1, b2, b3, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, K, Bass, Mid, Treble ) global(sBass, sMid, sTreble) ( Bass = logB(sBass); Mid = sMid; Treble = sTreble; coeffs = 4; x0 = 284.34999999999997*Mid; x1 = Bass*Mid; x2 = Bass*Treble; x3 = Mid*Treble; x4 = -Treble + 1.0; x5 = Bass*x4; x6 = -Mid + 1.0; x7 = Mid*x6; x8 = 2.585*x4; x9 = Treble*x6; x10 = Treble*x4; x11 = K*(13126.800999999999*Bass + Mid*x8 + 332.15841999999998*Treble + x0 + 550.0*x1 + 22.748000000000001*x10 + 4840.0*x2 + 241.99999999999997*x3 + 103.40000000000001*x5 + x6*x8 + 13.749999999999998*x7 + 120.99999999999999*x9 + 1162.200112); x21 = K*K; x12 = x21*K; x13 = Treble*x1; x14 = x1*x4; x15 = x2*x4; x16 = Treble*x7; x17 = x4*x6; x18 = x4*x7; x19 = x10*x6; x20 = x12*(.0000050453471639999994*Bass - .0000001261336791*Mid + 0.0002752508*x1*x10 + .000097269879299999992*x1 + .0000068812699999999984*x10*x7 + 0.0006484658619999999*x13 + 0.00068975348200000001*x14 + 0.00037764409759999992*x15 + .000016211646550000002*x16 + .000022186590733999997*x17 + .000017243837050000003*x18 + .000009441102439999998*x19 + 0.0008896105855999999*x2 + 0.00088746362936*x5 + .0000024317469824999996*x7 + .000022240264639999998*x9 + .0000001261336791); x22 = Mid*x4; x23 = x21*(8.9434785659999996*Bass + 0.025022799999999998*Mid*x10 - 0.21474424784999999*Mid + 0.00019517784000000482*Treble + 6.8047105499999994*x1 + 0.034331281599999999*x10 + 2.6619999999999995*x13 + 0.056869999999999997*x14 + 0.50045600000000001*x15 + 0.066549999999999998*x16 + 0.033303072000000003*x17 + 0.0014217500000000001*x18 + 0.012511399999999999*x19 + 4.8312928399999997*x2 + 0.062704862*x22 + 0.058951441999999993*x3 + 1.33212288*x5 + 0.17011776374999996*x7 + 0.12078232099999998*x9 + 0.30472414383399998); x24 = 1000000*Bass + 220000*Treble + x23 + 542000.0; x25 = 3*x20; x26 = 3000000*Bass + 660000*Treble - x23 + 1626000.0; x27 = -x11; x28 = K*(11616.99*Bass + 53.457800000000006*Treble + x0 + 290.42474999999996); x29 = x12*(.000097025906999999995*x1 + 0.00064683938000000007*x13 + 0.00064683938000000007*x14 + .000016170984499999999*x16 + .000016170984499999999*x18 + 0.0008538279816*x2 + .0000024256476749999995*x7 + .000021345699539999996*x9); x30 = x21*(0.35282148000000002*Bass + 0.077620725599999996*Treble + 6.3893445*x1 + 0.029401789999999997*x17 + 1.1760716*x2 + 0.058803579999999994*x22 + 0.058803579999999994*x3 + 1.1760716*x5 + 0.15973361249999996*x7 + 0.029401789999999997*x9 + 0.0088205369999999998); x31 = 3*x29; x32 = -x30; x33 = -x28; a0 = (x11 + x20 + x24); a1 = (x11 - x25 + x26)/a0; a2 = (x25 + x26 + x27)/a0; a3 = (-x20 + x24 + x27)/a0; b0 = (x28 + x29 + x30)/a0; b1 = (x28 - x31 + x32)/a0; b2 = (x31 + x32 + x33)/a0; b3 = (-x29 + x30 + x33)/a0; ); function initVox(K) instance(a0, a1, a2, a3, b0, b1, b2, b3, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27 Bass, Treble ) global(sBass, sTreble) ( coeffs = 4; Bass = logA(sBass); Treble = logA(sTreble); x0 = Bass*Treble; x1 = -Bass + 1.0; x2 = Bass*x1; x3 = -Treble + 1.0; x4 = 470000.0*x3; x5 = Treble*x1; x6 = Treble*x2; x7 = x1*x3; x8 = 47000000.0*x7; x9 = K*(Bass*x4 + Bass*x8 - 4251979200.0*Bass + Treble*x4 + Treble*x8 + 68666320.0*Treble + 219999999.99999997*x0 + 20314831999.999996*x2 + 7334831999.999999*x5 + 22000000000.0*x6 + 28670000.0*x7 + 4494409312.0); x16 = K*K; x10 = x16*K; x11 = Bass*x3; x12 = x0*x3; x13 = Bass*x7; x14 = x0*x7; x15 = x10*(0.76433279999999992*Bass + 22.566015999999994*x0 + 21.292127999999995*x11 + 35.486879999999999*x12 + 2301.18768*x13 + 3776.1679999999997*x14 + 91.35596799999999*x2 + 2405.8284799999997*x6); x17 = x16*(446422.94399999996*Bass + 3226.0799999999999*Treble*x3 + 343288.0*Treble*x7 + 115.80799999999965*Treble + 761823.03999999992*x0 + 9430.0799999999981*x11 + 10340.0*x12 + 953348.0*x13 + 1033999.9999999999*x14 + 49138626.239999995*x2 + 218711.67999999999*x5 + 81022304.0*x6 + 209198.87999999998*x7 + 10310.220799999999); x18 = -600000000000*Bass + 10000000000*Treble + x17 + 1000000000000*x2 + 1000000000000*x5 + 616000000000.0; x19 = 3*x15; x20 = -1800000000000*Bass + 30000000000*Treble - x17 + 3000000000000*x2 + 3000000000000*x5 + 1848000000000.0; x21 = -x9; x22 = K*(-131999999.99999999*Bass + 282000.0*Treble + 13228200000.0*x2 + 28200000.0*x5 + 264281999.99999997); x23 = x10*(13.6488*x0 + 136.48799999999997*x13 + 13.6488*x2 + 1501.3679999999997*x6); x24 = x16*(1240.8*Treble + 6204.0*x0 + 6204.0*x11 + 620400.0*x13 + 3034283.9999999995*x2 + 136487.99999999997*x5 + 620400.0*x6 + 12408.0*x7 + 1240.8); x25 = 3*x23; x26 = -x24; x27 = -x22; a0 = (x15 + x18 + x9); a1 = (-x19 + x20 + x9)/a0; a2 = (x19 + x20 + x21)/a0; a3 = (-x15 + x18 + x21)/a0; b0 = (x22 + x23 + x24)/a0; b1 = (x22 - x25 + x26)/a0; b2 = (x25 + x26 + x27)/a0; b3 = (-x23 + x24 + x27)/a0; ); function initJames(K) instance(a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34 Bass, Treble ) global(sBass, sTreble) ( coeffs = 5; Bass = logB(sBass); Treble = logB(sTreble); x0 = Bass*Treble; x1 = -Bass + 1.0; x2 = Bass*x1; x3 = -Treble + 1.0; x4 = Bass*x3; x5 = Treble*x1; x6 = Treble*x2; x7 = x1*x3; x8 = Bass*x7; x9 = K*(1185253200.0*Bass + 245706318.0*Treble + 2044217999.9999998*x0 + 9855000000.0*x2 + 204421800.0*x4 + 1845689999.9999998*x5 + 1551000000.0*x6 + 184569000.0*x7 + 155100000.0*x8 + 917754734.0); x15 = K*K; x10 = x15*K; x18 = x10*K; x11 = Treble*x4; x12 = Treble*x7; x13 = x0*x7; x14 = x10*(3.6409538879999999*Bass + 77.533482470399989*x0 + 199.01392736940002*x11 + 19.90139273694*x12 + 1494.4699988459997*x13 + 270.15238588799997*x2 + 67.404940019999998*x4 + 7.7533482470399999*x5 + 1238.8343618639999*x6 + 6.7404940020000002*x7 + 593.86955251799998*x8 + 0.40455043200000002); x16 = Treble*x3; x17 = x15*(439845.97535999998*Bass + 2155.0090320000018*Treble + 1431891.2651999998*x0 + 317058.21179999999*x11 + 286266.51899999997*x12 + 240560.09999999998*x13 + 42343.388801999994*x16 + 4280232.6639999999*x2 + 291075.23940000002*x4 + 248705.95199999999*x5 + 10166805.0*x6 + 110079.02993999999*x7 + 1475382.5459999999*x8 + 71522.757239999992); x19 = x18*(0.093536545863617995*x13 + 0.0019013870304000001*x2 + 0.036440736761088*x6 + 0.031680321809399996*x8); x20 = 1000000000000*Bass; x21 = 128000000000*Bass + x1*x20 + x17 + x19 + 1366020000000.0; x22 = 2*x14; x23 = 2*x9; x24 = 4000000000000*Bass; x25 = 512000000000*Bass + x1*x24 - 4*x19 + 5464080000000.0; x26 = 6000000000000*Bass; x27 = K*(72000000.0*Bass + 13958999.999999998*Treble + 1551000000.0*x0 + 800000000.0*x2 + 155100000.0*x4 + 75815000.0); x28 = x10*(50.036500799999999*x0 + 11.306324699999999*x11 + 1.1306324700000001*x12 + 113.06324699999999*x13 + 15.162576*x2 + 5.0036500799999999*x5 + 558.68260799999996*x6 + 3.4261590000000002*x8); x29 = x15*(29034.720000000001*Bass + 10646.063999999998*Treble + 216209.39999999999*x0 + 240560.09999999998*x11 + 2405.6009999999997*x16 + 360207.99999999994*x2 + 7289.6999999999998*x4 + 104537.39999999999*x5 + 1240800.0*x6 + 728.97000000000003*x7 + 72897.0*x8 + 3226.0799999999999); x30 = x18*(0.0053139726089999999*x13 + 0.023517155375999996*x6); x31 = x20 + x29 + x30 + 10000000000; x32 = 2*x28; x33 = 2*x27; x34 = x24 - 4*x30 + 40000000000; a0 = (x14 + x21 + x9); a1 = (-x22 + x23 + x25)/a0; a2 = (768000000000*Bass + x1*x26 - 2*x17 + 6*x19 + 8196120000000.0)/a0; a3 = (x22 - x23 + x25)/a0; a4 = (-x14 + x21 - x9)/a0; b0 = (x27 + x28 + x31)/a0; b1 = (-x32 + x33 + x34)/a0; b2 = (x26 - 2*x29 + 6*x30 + 60000000000)/a0; b3 = (x32 - x33 + x34)/a0; b4 = (-x27 - x28 + x31)/a0; ); function initESeries(K) instance(a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, Bass, Treble) global(sBass, sTreble) ( coeffs = 5; Bass = logA(sBass); Treble = logA(sTreble); x0 = Bass*Treble; x1 = -Bass + 1.0; x2 = Bass*x1; x3 = -Treble + 1.0; x4 = Bass*x3; x5 = K*(27665.325*Bass + 3120.0*Treble + 10000.0*x0 + 5000.0*x2 + 250.0*x4 + 4643.304); x16 = K*K; x6 = x16*K; x18 = x6*K; x7 = Treble*x1; x8 = Treble*x3; x9 = Treble*x2; x10 = x0*x3; x11 = x1*x3; x12 = x2*x3; x13 = x3*x7; x14 = x2*x8; x15 = x6*(0.0000228799999999994*Bass + 0.00000715000000000004*Treble + 0.1306692*x0 + 0.059325*x10 + 0.003682*x11 + 0.0344125*x12 + 0.004*x13 + 0.0125*x14 + 0.364370775*x2 + 0.0214575*x4 + 0.1129652*x7 + 0.005604*x8 + 1.11326625*x9 + 0.026513212); x17 = x16*(72.874155*Bass + 21.85664*Treble + 238.65325*x0 + 2.5*x10 + 0.4*x11 + 1.25*x12 + 138.326625*x2 + 7.2825*x4 + 16.0*x7 + 0.8*x8 + 50.0*x9 + 20.6086718); x19 = x18*(0.00000620015*x0 + 0.00002802*x10 + 0.0000061644*x11 + 0.0000888775*x12 + 0.00002802*x13 + 0.000276625*x14 + 0.0000001144*x2 + 0.0000061644*x4 + 0.00000620015*x7 + 0.00008852*x9 + 0.000000007865); x20 = 1000000*Bass + x17 + x19 + 320000; x21 = 2*x15; x22 = 2*x5; x23 = 4000000*Bass - 4*x19 + 1280000; x24 = K*(22135.0*Bass + 17.6); x25 = x6*(0.00121*Treble + 0.01848*x0 + 0.055*x10 + 0.0275*x12 + 0.0088*x2 + 0.00088*x7 + 1.10675*x9 + 0.000605); x26 = x16*(1.76*Bass + 0.176*Treble + 221.35*x0 + 110.675*x2 + 5.5*x4 + 0.209); x27 = x18*(0.00000605*x0 + 0.000275*x14 + 0.00000605*x7 + 0.000088*x9); x28 = x26 + x27; x29 = 2*x24; x30 = -4*x27; x31 = 2*x25; a0 = (x15 + x20 + x5); a1 = (-x21 + x22 + x23)/a0; a2 = (6000000*Bass - 2*x17 + 6*x19 + 1920000)/a0; a3 = (x21 - x22 + x23)/a0; a4 = (-x15 + x20 - x5)/a0; b0 = (x24 + x25 + x28)/a0; b1 = (x29 + x30 - x31)/a0; b2 = (-2*x26 + 6*x27)/a0; b3 = (-x29 + x30 + x31)/a0; b4 = (-x24 - x25 + x28)/a0; ); function initBench(K) instance(a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x90, x91, x92, x93, x94, x95, x96, x97, x98, x99, x100, x101, x102, x103, x104, x105, x106, x107, x108, x109, x110, x111, x112 , K, Bass, Mid, Treble ) global(sBass, sMid, sTreble) ( coeffs = 5; Bass = logB(sBass); Mid = logB(sMid); Treble = logB(sTreble); x0 = 145860000000000000000.0*Bass; x1 = 145860000000000000000.0*Mid; x2 = Bass*Mid; x3 = Treble*x2; x4 = -Mid + 1.0; x5 = -Treble + 1.0; x6 = -Bass + 1.0; x7 = 145860000000000000000.0*Treble; x8 = 97381440000000000000.0*x6; x9 = 74388600000000000000.0*x4; x10 = x2*x5; x11 = Bass*x8; x12 = Treble*x4; x13 = Bass*x12; x14 = 22992840000000000000.0*Treble; x15 = Bass*x5; x16 = Mid*x6; x17 = Treble*x16; x18 = Mid*x9; x19 = x14*x5; x20 = x3*x6; x21 = x3*x4; x22 = x3*x5; x23 = 145860000000000000000.0*x6; x24 = x4*x5; x25 = Bass*x24; x26 = x16*x5; x27 = Mid*x24; x28 = x12*x6; x29 = x2*x4*x6; x30 = x10*x6; x31 = x2*x24; x32 = x13*x6; x33 = Treble*x6; x34 = x15*x33; x35 = Treble*x25; x36 = x12*x16; x37 = 221952000000000000000.0*Treble; x38 = x20*x4; x39 = x20*x5; x40 = x24*x6; x41 = Bass*x40; x42 = x27*x6; x43 = x2*x40; x44 = Treble*x41; x45 = K*(Mid*x0 + Mid*x19 + Treble*x0 + Treble*x1 + Treble*x11 + Treble*x18 + x0*x4 + x0*x5 + x1*x5 + x1*x6 + 1404992840000000000000.0*x10 + x11*x4 + x11*x5 + 1456388600000000000000.0*x13 + x14*x15 + x14*x24 + 1479381440000000000000.0*x17 + x18*x6 + x19*x6 + x2*x8 + x2*x9 + 2658528000000000000000.0*x20 + 2030820000000000000000.0*x21 + 627708000000000000000.0*x22 + x23*x4 + x23*x5 + 145860000000000000000.0*x24 + 1479381440000000000000.0*x25 + x26*x37 + 1456388600000000000000.0*x26 + 74388600000000000000.0*x27 + 1404992840000000000000.0*x28 + 1604460000000000000000.0*x29 + 1382000000000000000000.0*x3 + 2252772000000000000000.0*x30 + 2030820000000000000000.0*x31 + 1345788000000000000000.0*x32 + 495924000000000000000.0*x34 + 627708000000000000000.0*x35 + 718080000000000000000.0*x36 + x37*x40 + 15202000000000000000000.0*x38 + 4698800000000000000000.0*x39 + x4*x7 + 1382000000000000000000.0*x40 + 940032000000000000000.0*x41 + 718080000000000000000.0*x42 + 15202000000000000000000.0*x43 + 4698800000000000000000.0*x44 + x6*x7); x63 = K*K; x46 = x63*K; x75 = x75*K; x47 = 19253520000000.0*Bass; x48 = 19253520000000.0*Mid; x49 = 19253520000000.0*Treble; x50 = 3035054880000.0*x6; x51 = 10116849600000.0*x4; x52 = Bass*x50; x53 = 13151904480000.0*Treble; x54 = Mid*x12; x55 = x5*x53; x56 = 19253520000000.0*x6; x57 = Treble*x26; x58 = Treble*x27; x59 = x24*x3; x60 = Treble*x40; x61 = x27*x33; x62 = x46*(Mid*x47 + Mid*x55 + Treble*x47 + Treble*x48 + Treble*x52 + 195575904480000.0*x10 + 192540849600000.0*x13 + x15*x50 + x15*x53 + x16*x51 + 185459054880000.0*x17 + x2*x50 + x2*x51 + 82857456000000.0*x20 + 276191520000000.0*x21 + 359048976000000.0*x22 + x24*x53 + 19253520000000.0*x24 + 185459054880000.0*x25 + 192540849600000.0*x26 + 10116849600000.0*x27 + 195575904480000.0*x28 + 182424000000000.0*x3 + 29297664000000.0*x30 + 97658880000000.0*x31 + 82857456000000.0*x32 + 65461968000000.0*x34 + 180516336000000.0*x35 + 276191520000000.0*x36 + 620241600000000.0*x39 + x4*x47 + x4*x49 + x4*x52 + x4*x56 + 182424000000000.0*x40 + 29297664000000.0*x41 + 97658880000000.0*x42 + 620241600000000.0*x44 + x47*x5 + x48*x5 + x48*x6 + x49*x6 + x5*x56 + 10116849600000.0*x54 + x55*x6 + 305489184000000.0*x57 + 218206560000000.0*x58 + 2067472000000000.0*x59 + 126956544000000.0*x60 + 2067472000000000.0*x61); x64 = 23939604000000000.0*Bass; x65 = 23939604000000000.0*Mid; x66 = 23939604000000000.0*Treble; x67 = 96267600000000000.0*x6; x68 = 320892000000000000.0*x4; x69 = Bass*x67; x70 = 99184800000000000.0*Treble; x71 = x5*x70; x72 = 23939604000000000.0*x6; x73 = x3*x40; x74 = x63*(Mid*x64 + Mid*x71 + Treble*x64 + Treble*x65 + Treble*x69 + 572403600000000000.0*x10 + 391006800000000000.0*x13 + x15*x67 + x15*x70 + x16*x68 + 574790400000000000.0*x17 + x2*x67 + x2*x68 + 912120000000000000.0*x20 + 3040400000000000000.0*x21 + 939760000000000000.0*x22 + x24*x70 + 23939604000000000.0*x24 + 309855600000000000.0*x25 + 493639200000000000.0*x26 + 320892000000000000.0*x27 + 312242400000000000.0*x28 + 50584248000000000.0*x29 + 653554800000000000.0*x3 + 962704248000000000.0*x30 + 3090984248000000000.0*x31 + 962704248000000000.0*x32 + 50584248000000000.0*x34 + 990344248000000000.0*x35 + 3090984248000000000.0*x36 + 1380957600000000000.0*x38 + 1380957600000000000.0*x39 + x4*x64 + x4*x66 + x4*x69 + x4*x72 + 231091200000000000.0*x40 + 912120000000000000.0*x41 + 3040400000000000000.0*x42 + 488294400000000000.0*x43 + 488294400000000000.0*x44 + x5*x64 + x5*x65 + x5*x72 + 320892000000000000.0*x54 + 990344248000000000.0*x57 + 50584248000000000.0*x58 + 1380957600000000000.0*x59 + x6*x65 + x6*x66 + x6*x71 + 939760000000000000.0*x60 + 488294400000000000.0*x61 + 10337360000000000000.0*x73); x76 = 607010976.0*Bass; x77 = 607010976.0*Mid; x78 = 607010976.0*Treble; x79 = 13092393600.0*Treble; x80 = x5*x79; x81 = 607010976.0*x6; x82 = x75*(Mid*x76 + Mid*x80 + Treble*x76 + Treble*x77 + 5859532800.0*x10 + 16571491200.0*x13 + x15*x79 + 16571491200.0*x17 + 124048320000.0*x22 + x24*x79 + 607010976.0*x24 + 5859532800.0*x25 + 5859532800.0*x26 + 16571491200.0*x28 + 16571491200.0*x3 + 124048320000.0*x35 + x4*x76 + x4*x78 + x4*x81 + 5859532800.0*x40 + x5*x76 + x5*x77 + x5*x81 + 124048320000.0*x57 + x6*x77 + x6*x78 + x6*x80 + 124048320000.0*x60); x83 = 33813000000000000000000*Bass; x84 = 33813000000000000000000*Mid; x85 = 33813000000000000000000*Treble; x86 = 33813000000000000000000*x6; x87 = 729300000000000000000000*x6; x88 = Bass*x87; x89 = Mid*x83 + Treble*x83 + Treble*x84 + Treble*x88 + 923100000000000000000000*x10 + 923100000000000000000000*x13 + x15*x87 + 326400000000000000000000*x17 + x2*x87 + 6910000000000000000000000*x20 + 33813000000000000000000*x24 + 923100000000000000000000*x25 + 326400000000000000000000*x26 + 326400000000000000000000*x28 + 923100000000000000000000*x3 + 6910000000000000000000000*x30 + 6910000000000000000000000*x32 + x4*x83 + x4*x85 + x4*x86 + x4*x88 + 326400000000000000000000*x40 + 6910000000000000000000000*x41 + x5*x83 + x5*x84 + x5*x86 + x6*x84 + x6*x85 + x74 + x82; x90 = 2*x62; x91 = 2*x45; x92 = 135252000000000000000000*Bass; x93 = 135252000000000000000000*Mid; x94 = 135252000000000000000000*Treble; x95 = 135252000000000000000000*x6; x96 = 2917200000000000000000000*x6; x97 = Bass*x96; x98 = Mid*x92 + Treble*x92 + Treble*x93 + Treble*x97 + 3692400000000000000000000*x10 + 3692400000000000000000000*x13 + x15*x96 + 1305600000000000000000000*x17 + x2*x96 + 27640000000000000000000000*x20 + 135252000000000000000000*x24 + 3692400000000000000000000*x25 + 1305600000000000000000000*x26 + 1305600000000000000000000*x28 + 3692400000000000000000000*x3 + 27640000000000000000000000*x30 + 27640000000000000000000000*x32 + x4*x92 + x4*x94 + x4*x95 + x4*x97 + 1305600000000000000000000*x40 + 27640000000000000000000000*x41 + x5*x92 + x5*x93 + x5*x95 + x6*x93 + x6*x94 - 4*x82; x99 = 202878000000000000000000*Bass; x100 = 202878000000000000000000*Mid; x101 = 202878000000000000000000*Treble; x102 = 4375800000000000000000000*x6; x103 = Bass*x102; x104 = 202878000000000000000000*x6; x105 = K*(102000000000000000000.0*x10 + 102000000000000000000.0*x13 + 102000000000000000000.0*x17 + 749088000000000000000.0*x20 + 572220000000000000000.0*x21 + 176868000000000000000.0*x22 + 102000000000000000000.0*x25 + 102000000000000000000.0*x26 + 102000000000000000000.0*x28 + 102000000000000000000.0*x3 + 572220000000000000000.0*x30 + 572220000000000000000.0*x31 + 176868000000000000000.0*x32 + 176868000000000000000.0*x35 + 1122000000000000000000.0*x38 + 346800000000000000000.0*x39 + 102000000000000000000.0*x40 + 1122000000000000000000.0*x43 + 346800000000000000000.0*x44); x106 = x46*(13464000000000.0*x10 + 13464000000000.0*x13 + 13464000000000.0*x17 + 23346576000000.0*x20 + 77821920000000.0*x21 + 101168496000000.0*x22 + 13464000000000.0*x25 + 13464000000000.0*x26 + 13464000000000.0*x28 + 13464000000000.0*x3 + 23346576000000.0*x32 + 23346576000000.0*x35 + 77821920000000.0*x36 + 45777600000000.0*x39 + 13464000000000.0*x40 + 45777600000000.0*x44 + 77821920000000.0*x57 + 152592000000000.0*x59 + 152592000000000.0*x61); x107 = x63*(148777200000000000.0*x10 + 69706800000000000.0*x13 + 149817600000000000.0*x17 + 67320000000000000.0*x20 + 224400000000000000.0*x21 + 69360000000000000.0*x22 + 34333200000000000.0*x25 + 114444000000000000.0*x26 + 35373600000000000.0*x28 + 184150800000000000.0*x3 + 67320000000000000.0*x30 + 224400000000000000.0*x31 + 67320000000000000.0*x32 + 69360000000000000.0*x35 + 224400000000000000.0*x36 + 389109600000000000.0*x38 + 389109600000000000.0*x39 + 67320000000000000.0*x41 + 224400000000000000.0*x42 + 69360000000000000.0*x57 + 389109600000000000.0*x59 + 69360000000000000.0*x60 + 762960000000000000.0*x73); x108 = x75*(4669315200.0*x13 + 4669315200.0*x17 + 9155520000.0*x22 + 4669315200.0*x28 + 4669315200.0*x3 + 9155520000.0*x35 + 9155520000.0*x57 + 9155520000.0*x60); x109 = 260100000000000000000000*x10 + x107 + x108 + 260100000000000000000000*x13 + 510000000000000000000000*x20 + 260100000000000000000000*x25 + 260100000000000000000000*x3 + 510000000000000000000000*x30 + 510000000000000000000000*x32 + 510000000000000000000000*x41; x110 = 2*x106; x111 = 2*x105; x112 = 1040400000000000000000000*x10 - 4*x108 + 1040400000000000000000000*x13 + 2040000000000000000000000*x20 + 1040400000000000000000000*x25 + 1040400000000000000000000*x3 + 2040000000000000000000000*x30 + 2040000000000000000000000*x32 + 2040000000000000000000000*x41; a0 = (x45 + x62 + x89); a1 = (-x90 + x91 + x98)/a0; a2 = (Mid*x99 + Treble*x100 + Treble*x103 + Treble*x99 + 5538600000000000000000000*x10 + x100*x5 + x100*x6 + x101*x4 + x101*x6 + x102*x15 + x102*x2 + x103*x4 + x104*x4 + x104*x5 + 5538600000000000000000000*x13 + 1958400000000000000000000*x17 + 41460000000000000000000000*x20 + 202878000000000000000000*x24 + 5538600000000000000000000*x25 + 1958400000000000000000000*x26 + 1958400000000000000000000*x28 + 5538600000000000000000000*x3 + 41460000000000000000000000*x30 + 41460000000000000000000000*x32 + x4*x99 + 1958400000000000000000000*x40 + 41460000000000000000000000*x41 + x5*x99 - 2*x74 + 6*x82)/a0; a3 = (x90 - x91 + x98)/a0; a4 = (-x45 - x62 + x89)/a0; b0 = (x105 + x106 + x109)/a0; b1 = (-x110 + x111 + x112)/a0; b2 = (1560600000000000000000000*x10 - 2*x107 + 6*x108 + 1560600000000000000000000*x13 + 3060000000000000000000000*x20 + 1560600000000000000000000*x25 + 1560600000000000000000000*x3 + 3060000000000000000000000*x30 + 3060000000000000000000000*x32 + 3060000000000000000000000*x41)/a0; b3 = (x110 - x111 + x112)/a0; b4 = (-x105 - x106 + x109)/a0; ); function initBigMuff(K) instance(a0, a1, a2, a3, b0, b1, b2, b3, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, Mid ) global(sMid) ( coeffs = 4; Mid = sMid; x0 = Mid*(-Mid + 1.0); x1 = K*(521200.0*Mid + 4920000.0*x0 + 61959032.0); x2 = K*K; x3 = x2*(3.43200000000024*Mid + 367.6*x0 + 3710.32); x4 = -1800000000*Mid + 10000000000*x0 + x3 + 166880000000.0; x5 = -5400000000*Mid + 30000000000*x0 - x3 + 500640000000.0; x6 = -x1; x7 = 12232000.0*K; x8 = 3432.0*Mid*x2; x9 = -100000000000*Mid + x8 + 122000000000.0; x10 = -300000000000*Mid - x8 + 366000000000.0; x11 = -x7; a0 = (x1 + x4); a1 = (x1 + x5)/a0; a2 = (x5 + x6)/a0; a3 = (x4 + x6)/a0; b0 = (x7 + x9)/a0; b1 = (x10 + x7)/a0; b2 = (x10 + x11)/a0; b3 = (x11 + x9)/a0; ); function initHiwatt(K) instance(a0, a1, a2, a3, a4, a5, b0, b1, b2, b3, b4, b5, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, Bass, Mid, Treble ) global(sBass, sMid, sTreble) ( coeffs = 6; Bass = logB(sBass); Mid = sMid; Treble = sTreble; x0 = Bass*Mid; x1 = Bass*Treble; x2 = Mid*Treble; x3 = -Treble + 1.0; x4 = Bass*x3; x5 = Mid*x3; x6 = Treble*x3; x7 = K*(12650.708*Bass + 1477.24*Mid + 3143.448*Treble + 2256.0*x0 + 4985.948*x1 + 48.84*x2 + 22.748*x4 + 4.84*x5 + 10.648*x6 + 3784.4312); x13 = K*K; x17 = x13*K; x21 = x17*K; x8 = x21*K; x9 = Treble*x0; x10 = x0*x3; x11 = x0*x6; x12 = x8*(0.0000000000103909726923411*x0 + 0.0000000000537020956455315*x10 + 0.0000000000450525180584512*x11 + 0.0000000000554434907507923*x9); x14 = 0.24021888*x1; x15 = Treble*x5; x16 = x13*(45.689775736*Bass + 1.13605448*Mid + 0.991584352*Treble + 17.9067932*x0 + 37.120781984*x1 + 0.1091904*x10 + x14*x3 + 0.0021296*x15 + 0.69143536*x2 + 0.611193264*x4 + 0.07126416*x5 + 0.15162752*x6 + 1.0914904*x9 + 1.3656180032); x18 = x1*x3; x19 = x17*(0.0131456117286208*Bass + 0.000136909734368*Mid + 0.00000157663658239999*Treble + 0.01296643204912*x0 + 0.0130673879990368*x1 + 0.00086140397552*x10 + 0.00004754332*x11 + 0.00003001628608*x15 + 0.001755921941664*x18 + 0.000135892288928*x2 + 0.0021820456123488*x4 + 0.000051587387808*x5 + 0.0000407899665536*x6 + 0.00787845471952*x9 + 0.00005802903425792); x20 = x16 + x19; x22 = x21*(0.000000103909726923411*Bass + 0.000000000940785214336*Mid + 0.00000151934534585504*x0 + 0.000000554434907507923*x1 + 0.00000058704601814144*x10 + 0.00000033964947808*x11 + 0.00000000407899665536*x15 + 0.000000450525180584512*x18 + 0.000000005019781869696*x2 + 0.000000537020956455315*x4 + 0.000000004862118211456*x5 + 0.00000151152297289664*x9); x23 = 470000*Bass + 100000*Mid + 220000*Treble + x22 + 264000; x24 = 5*x12; x25 = 3*x7; x26 = x16 - x19; x27 = 2350000*Bass + 500000*Mid + 1100000*Treble - 3*x22 + 1320000; x28 = 2*x19; x29 = 2*x7; x30 = 10*x12; x31 = 4700000*Bass + 1000000*Mid + 2200000*Treble - 2*x16 + 2*x22 + 2640000; x32 = K*(4963.2*Bass + 22.0*Mid + 4.84); x33 = 0.000000024321160688*Bass; x34 = 0.00000000022020064*Mid; x35 = x21*(0.000000166022820304*x0 + 0.000000267532767568*x1 + 0.000000120947203344*x10 + 0.00000000242220704*x2 + x3*x33 + x3*x34 + x33 + x34 + 0.000000120947203344*x9); x36 = 0.0000000000024321160688*x0; x37 = x8*(x3*x36 + x36 + 0.0000000000267532767568*x9); x38 = x13*(2.38825048*Bass + 0.2083488*Mid + 0.00234256*Treble + 0.9823*x0 + x14 + 0.0010648*x2 + 0.24021888*x4 + 0.0010648*x5 + 0.045964512); x39 = x17*(0.00055472089904*Bass + 0.0000145821456*Mid + 0.000022020064*Treble + 0.00254645248*x0 + 0.00010396472944*x1 + 0.00004754332*x10 + 0.0000102668016*x2 + 0.00010396472944*x4 + 0.0000100325456*x5 + 0.00004754332*x9 + 0.0000044040128); x40 = x38 + x39; x41 = 5*x37; x42 = -3*x35; x43 = 3*x32; x44 = x38 - x39; x45 = 2*x39; x46 = 2*x32; x47 = 10*x37; x48 = 2*x35 - 2*x38; a0 = (x12 + x20 + x23 + x7); a1 = (-x24 + x25 + x26 + x27)/a0; a2 = (-x28 + x29 + x30 + x31)/a0; a3 = (x28 - x29 - x30 + x31)/a0; a4 = (x20 + x24 - x25 + x27)/a0; a5 = (-x12 + x23 + x26 - x7)/a0; b0 = (x32 + x35 + x37 + x40)/a0; b1 = (-x41 + x42 + x43 + x44)/a0; b2 = (-x45 + x46 + x47 + x48)/a0; b3 = (x45 - x46 - x47 + x48)/a0; b4 = (x40 + x41 + x42 - x43)/a0; b5 = (-x32 + x35 - x37 + x44)/a0; ); function initCrate(K) instance(a0, a1, a2, a3, a4, a5, b0, b1, b2, b3, b4, b5, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, Bass, Mid, Treble ) global(sBass, sMid, sTreble) ( coeffs = 6; Bass = logA(sBass); Mid = logA(sMid); Treble = sTreble; x0 = Mid*Treble; x1 = 250000*Bass; x2 = x1 + 10000; x3 = Mid*x2; x4 = Treble*x2; x5 = 250000*Treble; x6 = -x5 + 272000.0; x7 = Treble*x6; x8 = x2*x6; x9 = K*(16410.805*Bass + 5443.76288659794*Mid + 4605.805*Treble + 1360.94072164948*x0 + 0.00544376288659794*x3 + 0.01175*x4 + 0.000055*x7 + 0.00000000022*x8 + 19139.4922); x10 = K*K; x17 = x10*K; x21 = x17*K; x11 = Mid*x6; x12 = Mid*x4; x13 = Mid*x7; x14 = x3*x6; x15 = x4*x6; x16 = x10*(179.37667858*Bass + 19.3838062360825*Mid + 0.000998579999999971*Treble + 5.1453585177835*x0 + 0.00000119762783505155*x11 + 0.0000639642139175258*x12 + 0.000000299406958762887*x13 + 0.00000000000119762783505155*x14 + 0.000000000002585*x15 + 0.000276438289741237*x3 + 0.000180952585*x4 + 0.000001013265*x7 + 0.00000000001439306*x8 + 8.2814937832); x18 = x11*x4; x19 = x17*(0.0000386716*Bass + 0.00000420237427216495*Mid + 0.00106709406702165*x0 + 0.00000000426417389381443*x11 + 0.0000000343959046012887*x12 + 0.00000000106604347345361*x13 + 0.0000000000000605526821412371*x14 + 0.0000000000000392403*x15 + 0.0000000000000140721270618557*x18 + 0.0000000854509094093237*x3 + 0.0000000392789716*x4 + 0.0000000000001569612*x8 + 0.000001546864); x20 = x16 + x19; x22 = x21*(0.0000000000044725385703299*x12 + 0.0000000000000000178725407628866*x14 + 0.00000000000000000446813519072165*x18 + 0.0000000000000176135184329897*x3); x23 = x1 + x22 + x5 + 1010000; x24 = 3*x9; x25 = x16 - x19; x26 = 1250000*Bass + 1250000*Treble - 3*x22 + 5050000; x27 = 2*x19; x28 = 2*x9; x29 = 2500000*Bass + 2500000*Treble - 2*x16 + 2*x22 + 10100000; x30 = K*(11805.0*Bass + 55.0*Treble + 472.2); x31 = x12*x21; x32 = 0.00000000000440337960824742*x31; x33 = x10*(0.99858*Bass + 0.99858*Treble + 0.299406958762887*x0 + 0.000257054483505155*x3 + 0.000002585*x4 + 0.00000000001034*x8 + 0.0399432); x34 = x17*(0.00105059356804124*x0 + 0.0000000140721270618557*x12 + 0.0000000000000562885082474227*x14 + 0.00000000420237427216495*x3 + 0.0000000386716*x4); x35 = x33 + x34; x36 = 3*x30; x37 = -0.0000000000132101388247423*x31; x38 = x33 - x34; x39 = 2*x34; x40 = 2*x30; x41 = 0.00000000000880675921649484*x31 - 2*x33; a0 = (x20 + x23 + x9); a1 = (x24 + x25 + x26)/a0; a2 = (-x27 + x28 + x29)/a0; a3 = (x27 - x28 + x29)/a0; a4 = (x20 - x24 + x26)/a0; a5 = (x23 + x25 - x9)/a0; b0 = (x30 + x32 + x35)/a0; b1 = (x36 + x37 + x38)/a0; b2 = (-x39 + x40 + x41)/a0; b3 = (x39 - x40 + x41)/a0; b4 = (x35 - x36 + x37)/a0; b5 = (-x30 + x32 + x38)/a0; ); function initDumbleRock(K) instance(a0, a1, a2, a3, a4, a5, a6 b0, b1, b2, b3, b4, b5, b6, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x90, x91, x92, x93, x94, x95, x96, x97, x98, x99, x100, x101, x102, x103, x104, x105, x106, x107, x108, x109, x110, x111, x112, x113, x114, x115, x116, x117, x118, x119, x120, x121, x122, x123, x124, x125, x126, x127, x128, x129, x130, x131, x132, x133, x134, x135, x136, x137, x138, x139, x140, x141, x142, x143, x144, x145, x146, x147, x148, x149, x150, x151, x152, x153, x154, x155, Bass, Mid, Treble, Vol ) global(sBass, sMid, sTreble, sVol) ( coeffs = 7; Bass = logB(sBass); Mid = logB(sMid); Treble = logA(sTreble); Vol = logA(sVol); x0 = Bass*Mid; x1 = Bass*Treble; x2 = Bass*Vol; x3 = Mid*Treble; x4 = Mid*Vol; x5 = Treble*Vol; x6 = Vol*x0; x7 = Vol*x1; x8 = Vol*x3; x9 = -Bass + 1.0; x10 = Bass*x9; x11 = -Treble + 1.0; x12 = Bass*x11; x13 = -Vol + 1.0; x14 = Bass*x13; x15 = Mid*x13; x16 = Treble*x9; x17 = Treble*x11; x18 = Treble*x13; x19 = Vol*x9; x20 = Vol*x11; x21 = Vol*x13; x22 = Vol*x10; x23 = Vol*x12; x24 = Vol*x14; x25 = Vol*x15; x26 = Vol*x16; x27 = Vol*x17; x28 = Vol*x18; x29 = x13*x9; x30 = x11*x13; x31 = Vol*x29; x32 = Vol*x30; x33 = K*(9741576000.0*Bass + 25000000.0*Mid + 8966457000.0*Treble + 79982500.0*Vol + 780000000.0*x0 + 8508240000.0*x1 + 9734400000.0*x10 + 32853600.0*x12 + 7925580000.0*x14 + 625000000.0*x15 + 8424000000.0*x16 + 28431000.0*x17 + 41175000.0*x18 + 7878000000.0*x19 + 10421814000.0*x2 + 26588250.0*x20 + 2089943750.0*x21 + 2433600000.0*x22 + 8213400.0*x23 + 1981395000.0*x24 + 156250000.0*x25 + 2106000000.0*x26 + 7107750.0*x27 + 10293750.0*x28 + 7800000000.0*x29 + 675000000.0*x3 + 26325000.0*x30 + 1950000000.0*x31 + 6581250.0*x32 + 631250000.0*x4 + 2268202500.0*x5 + 195000000.0*x6 + 2127060000.0*x7 + 168750000.0*x8 + 8939958000.0); x128 = K*K; x34 = x128*K; x130 = x34*K; x112 = x130*K; x132 = x112*K; x35 = Treble*x0; x36 = x0*x5; x37 = Mid*x9; x38 = Mid*x11; x39 = x0*x9; x40 = Mid*x12; x41 = x0*x13; x42 = Treble*x10; x43 = Treble*x12; x44 = Bass*x18; x45 = x3*x9; x46 = Mid*x17; x47 = Mid*x18; x48 = x4*x9; x49 = Mid*x20; x50 = x0*x16; x51 = x12*x3; x52 = x0*x18; x53 = x0*x19; x54 = x12*x4; x55 = x0*x21; x56 = x10*x5; x57 = x12*x5; x58 = x18*x2; x59 = x19*x3; x60 = x17*x4; x61 = x18*x4; x62 = x16*x6; x63 = x23*x3; x64 = x18*x6; x65 = x11*x9; x66 = x12*x9; x67 = x10*x13; x68 = x12*x13; x69 = x38*x9; x70 = x15*x9; x71 = Mid*x30; x72 = x17*x9; x73 = x18*x9; x74 = Treble*x30; x75 = x20*x9; x76 = x12*x37; x77 = x0*x29; x78 = x12*x15; x79 = x12*x16; x80 = x10*x18; x81 = x12*x18; x82 = x12*x19; x83 = x10*x21; x84 = x12*x21; x85 = x17*x37; x86 = x18*x37; x87 = x3*x30; x88 = x20*x37; x89 = x15*x19; x90 = x30*x4; x91 = x17*x19; x92 = x18*x19; x93 = x30*x5; x94 = x12*x48; x95 = x29*x6; x96 = x15*x23; x97 = x16*x23; x98 = x18*x22; x99 = x18*x23; x100 = x4*x72; x101 = x18*x48; x102 = x3*x32; x103 = x30*x9; x104 = x12*x29; x105 = x30*x37; x106 = x16*x30; x107 = x19*x30; x108 = x23*x29; x109 = x30*x48; x110 = x16*x32; x111 = x34*(-5250.1539792*Bass + 5369.341*Mid + 6279.54066*Treble - 123.881087*Vol + 167759.8806*x0 + 203050.6925616*x1 + 211640.165568*x10 + 554.4045*x100 + 802.9125*x101 + 0.977315625*x102 + 9348.656148*x103 + 312.6348576*x104 + 2053.35*x105 + 48.787596*x106 + 2382.337737*x107 + 78.1587144*x108 + 513.3375*x109 + 12.196899*x110 + 6507.76593168*x12 + 195807.3690612*x14 + 141415.250375*x15 + 182037.08016*x16 + 5946.62796*x17 + 9210.459699*x18 + 170584.56012*x19 + 192121.0157412*x2 + 5558.202585*x20 + 4995.72517425*x21 + 95875.492752*x22 + 11231.52717492*x23 + 54813.5485443*x24 + 36430.33103125*x25 + 54856.11924*x26 + 1486.65699*x27 + 2348.04924225*x28 + 169125.76668*x29 + 152608.482*x3 + 5507.8964577*x30 + 47951.49177*x31 + 1422.408431925*x32 + 244846.2978*x35 + 63285.45795*x36 + 8824.14*x37 + 74.9736*x38 + 275556.528*x39 + 142715.90525*x4 + 2339.99766*x40 + 230177.0562*x41 + 34727.569344*x42 + 10372.95254736*x43 + 15880.3153236*x44 + 238251.78*x45 + 2095.3647*x46 + 3102.647625*x47 + 222885.585*x48 + 1958.8959*x49 + 7128.08775*x5 + 6570.72*x50 + 2239.79418*x51 + 3243.7665*x52 + 77345.892*x53 + 2658.882915*x54 + 58631.6718*x55 + 8938.150416*x56 + 2593.23813684*x57 + 4015.7042679*x58 + 61616.295*x59 + 270816.16965*x6 + 523.841175*x60 + 779.28159375*x61 + 1642.68*x62 + 559.948545*x63 + 810.941625*x64 + 373.873968*x65 + 11675.1181248*x66 + 50044.939776*x67 + 9659.49884172*x68 + 82.134*x69 + 60367.2588324*x7 + 220722.45*x70 + 1940.2972875*x71 + 10094.597136*x72 + 15468.69636*x73 + 49.0690629*x74 + 9440.317692*x75 + 2562.5808*x76 + 9795.24*x77 + 2078.40087*x78 + 276.7587264*x79 + 40092.273*x8 + 400.81392*x80 + 49.27547196*x81 + 3175.0376112*x82 + 12697.283664*x83 + 2460.50014743*x84 + 2217.618*x85 + 3211.65*x86 + 3.9092625*x87 + 2073.8835*x88 + 56253.1125*x89 + 488.694009375*x90 + 2523.649284*x91 + 3912.34779*x92 + 12.267265725*x93 + 640.6452*x94 + 2448.81*x95 + 519.6002175*x96 + 69.1896816*x97 + 100.20348*x98 + 12.31886799*x99 + 13231.242507); x113 = x12*x45; x114 = x18*x39; x115 = x18*x40; x116 = x12*x59; x117 = x18*x53; x118 = x18*x54; x119 = x12*x70; x120 = x12*x73; x121 = x30*x45; x122 = x18*x76; x123 = x12*x89; x124 = x12*x92; x125 = x30*x59; x126 = x48*x81; x127 = x112*(0.00001715688*x0 + 0.0000185294304*x1 + 0.00002141178624*x10 + 0.001113079968*x101 + 0.0001849863015*x102 + 0.00003248892504*x103 + 0.00562759041693888*x104 + 0.0000428246676*x105 + 0.00087720097608*x106 + 0.00082034535726*x107 + 0.00156728953650672*x108 + 0.0010813228569*x109 + 0.00021930024402*x110 + 0.00655918181568*x113 + 0.0101617170408*x114 + 0.001192222483452*x115 + 0.00163979545392*x116 + 0.0025756647462*x117 + 0.000298055620863*x118 + 0.00741085554456*x119 + 0.00017322328685376*x120 + 0.0011562660252*x121 + 0.00003805432488*x122 + 0.00188794937214*x123 + 0.00004330582171344*x124 + 0.0002890665063*x125 + 0.00000951358122*x126 + 0.000017572076496*x14 + 0.00000302445*x15 + 0.000003266406*x18 + 0.00001715688*x2 + 0.00000302445*x21 + 0.00071129650176*x22 + 0.000147676932*x23 + 0.000203890726104*x24 + 0.00009543105*x25 + 0.000026849394*x28 + 0.0000037745136*x29 + 0.0001253888064*x31 + 0.0000260327925*x32 + 0.000494118144*x35 + 0.004010110416*x36 + 0.0000356863104*x39 + 0.000147676932*x40 + 0.00072356583156*x41 + 0.00057811822848*x42 + 0.00015949108656*x43 + 0.00036091949868*x44 + 0.00008710416*x47 + 0.0009635303808*x50 + 0.0041975073504*x51 + 0.00667519554312*x52 + 0.0011260169856*x53 + 0.003923500113*x54 + 0.00320164896909*x55 + 0.00475204983552*x56 + 0.00003987277164*x57 + 0.00099693831159*x58 + 0.00054135432*x6 + 0.00070691049*x61 + 0.0063141990912*x62 + 0.0010493768376*x63 + 0.00277270859268*x64 + 0.000184300811136*x66 + 0.0009394030571328*x67 + 0.0001512507137544*x68 + 0.0001523092896*x7 + 0.000006290856*x70 + 0.0000260327925*x71 + 0.0001019118672*x73 + 0.0000281154159*x74 + 0.00024293265984*x76 + 0.0014647923576*x77 + 0.004700090552976*x78 + 0.004976121900672*x79 + 0.0077312765739456*x80 + 0.0009792451118736*x81 + 0.004653595481184*x82 + 0.0040717270921392*x83 + 0.0009445211153586*x84 + 0.000169853112*x86 + 0.000739945206*x87 + 0.000198496584*x89 + 0.000691642648125*x90 + 0.0008377010928*x92 + 0.000007028853975*x93 + 0.00613404966096*x94 + 0.0053902162314*x95 + 0.002278932345144*x96 + 0.001244030475168*x97 + 0.0020932110757584*x98 + 0.0002448112779684*x99); x129 = x128*(69683786.64*Bass + 757825.0*Mid + 67319331.66*Treble + 572873.69999999*Vol + 23651940.0*x0 + 114104175.12*x1 + 128717971.2*x10 + 821340.0*x103 + 205335.0*x107 + 998420.904*x12 + 107129424.48*x14 + 19574437.5*x15 + 111306312.0*x16 + 892164.78*x17 + 1319291.55*x18 + 104122434.0*x19 + 125028038.46*x2 + 834076.035*x20 + 16059150.5375*x21 + 35562196.8*x22 + 1079158.626*x23 + 27217319.22*x24 + 4927984.375*x25 + 28647918.0*x26 + 223041.195*x27 + 331270.7625*x28 + 103108980.0*x29 + 21136275.0*x3 + 826136.415*x30 + 26206245.0*x31 + 207981.97875*x32 + 21270600.0*x35 + 5317650.0*x36 + 780000.0*x37 + 2632.5*x38 + 24336000.0*x39 + 19762518.75*x4 + 82134.0*x40 + 19813950.0*x41 + 2628288.0*x42 + 895917.672*x43 + 1297506.6*x44 + 21060000.0*x45 + 71077.5*x46 + 102937.5*x47 + 19695000.0*x48 + 66470.625*x49 + 17663908.95*x5 + 6084000.0*x53 + 20533.5*x54 + 4953487.5*x55 + 657072.0*x56 + 223979.418*x57 + 324376.65*x58 + 5265000.0*x59 + 25684035.0*x6 + 17769.375*x60 + 25734.375*x61 + 32853.6*x65 + 1025032.32*x66 + 3918096.0*x67 + 831360.348*x68 + 29355597.18*x7 + 19500000.0*x70 + 65812.5*x71 + 887047.2*x72 + 1284660.0*x73 + 1563.705*x74 + 829553.4*x75 + 5349881.25*x8 + 256258.08*x82 + 979524.0*x83 + 207840.087*x84 + 4875000.0*x89 + 16453.125*x90 + 221761.8*x91 + 321165.0*x92 + 390.92625*x93 + 67516482.19); x131 = x130*(-0.0610784928*Bass + 0.05499*Mid + 0.0593892*Treble - 0.001330758*Vol + 3.390922392*x0 + 3.877137576*x1 + 4.24471821696*x10 + 5.25575466*x100 + 8.255335725*x101 + 0.028811264625*x102 + 14.78825626824*x103 + 3.558348447264*x104 + 19.47027537*x105 + 0.55520284248*x106 + 4.21114077306*x107 + 0.903681306216*x108 + 4.9805030925*x109 + 0.13880071062*x110 + 0.691896816*x113 + 1.0020348*x114 + 0.1231886799*x115 + 0.172974204*x116 + 0.2505087*x117 + 0.030797169975*x118 + 0.781587144*x119 + 0.06497785008*x12 + 0.015221729952*x120 + 0.12196899*x121 + 0.195396786*x123 + 0.003805432488*x124 + 0.0304922475*x125 + 3.709288841544*x14 + 2.016676255*x15 + 1.85294304*x16 + 0.51118938*x17 + 0.830152665*x18 + 2.27979648*x19 + 3.6291182928*x2 + 0.4733235*x20 + 0.351050917*x21 + 70.82256733344*x22 + 16.50185240652*x23 + 11.473463624766*x24 + 8.27971541375*x25 + 15.23092896*x26 + 0.127797345*x27 + 0.51037570125*x28 + 2.6334558744*x29 + 1.583712*x3 + 0.4847779287*x30 + 9.9478107066*x31 + 0.424032017175*x32 + 50.702084784*x35 + 32.746606776*x36 + 0.1143792*x37 + 0.4733235*x38 + 6.32176272*x39 + 1.73511*x4 + 14.7910849632*x40 + 64.149657273*x41 + 56.79556900992*x42 + 17.80445657952*x43 + 27.653396034888*x44 + 3.0882384*x45 + 13.4535492*x46 + 20.85045651*x47 + 3.6090288*x48 + 12.575320875*x49 + 0.4881708*x5 + 74.33455536*x50 + 21.6767724264*x51 + 33.537631959*x52 + 92.92622508*x53 + 23.7688568208*x54 + 28.62560529075*x55 + 17.11510920288*x56 + 4.45111414488*x57 + 7.441601221782*x58 + 20.2378176*x59 + 55.770594438*x6 + 3.3633873*x60 + 5.319322515*x61 + 19.22428404*x62 + 5.4191931066*x63 + 8.49847158225*x64 + 0.590707728*x65 + 18.546729791616*x66 + 81.40159688544*x67 + 16.8435350702424*x68 + 0.77863032*x69 + 17.454892338*x7 + 4.0657617*x70 + 12.461113548*x71 + 15.949108656*x72 + 24.7797326088*x73 + 0.3270645378*x74 + 14.915370132*x75 + 24.318891792*x76 + 106.50139344*x77 + 20.1997854513*x78 + 3.149514306432*x79 + 12.852918*x8 + 4.82623326432*x80 + 0.5705123901048*x81 + 7.552899398304*x82 + 22.71349904616*x83 + 4.7391359806206*x84 + 21.02301864*x85 + 32.5696059*x86 + 0.1152450585*x87 + 19.66041558*x88 + 13.153815675*x89 + 3.2219867745*x90 + 3.987277164*x91 + 6.7090098582*x92 + 0.08176613445*x93 + 6.720368148*x94 + 27.09047016*x95 + 5.164009955325*x96 + 0.787378576608*x97 + 1.22065251048*x98 + 0.1426280975262*x99 + 0.124948278); x133 = x132*(0.00000001013654461248*x104 + 0.00000025594775146512*x108 + 0.000000052994170944*x114 + 0.000000230862904272*x115 + 0.000000347280950016*x117 + 0.000000057715726068*x118 + 0.0000000133612962912*x119 + 0.00000027368670453696*x120 + 0.0000003607549998624*x122 + 0.0000003373727313528*x123 + 0.00000006842167613424*x124 + 0.0000000901887499656*x126 + 0.0000000009436284*x24 + 0.0000000009436284*x41 + 0.000000001019118672*x44 + 0.00000002717649792*x52 + 0.0000000297744876*x55 + 0.000000008377010928*x58 + 0.00000022055607288*x64 + 0.0000000011776482432*x67 + 0.000000001962747072*x77 + 0.00000000812223126*x78 + 0.0000000317965025664*x80 + 0.0000000087720097608*x81 + 0.0000000391213075968*x83 + 0.00000000812223126*x84 + 0.000000061930934208*x95 + 0.000000215792506215*x96 + 0.0000002613627409536*x98 + 0.0000000021930024402*x99); x134 = 312000000000*Bass + 270000000000*Treble + 2500000000*Vol + x129 + x131 + x133 + 78000000000*x2 + 62500000000*x21 + 67500000000*x5 + 260000000000.0; x135 = 4*x127; x136 = 4*x33; x137 = 1872000000000*Bass + 1620000000000*Treble + 15000000000*Vol + 2*x129 - 2*x131 - 6*x133 + 468000000000*x2 + 375000000000*x21 + 405000000000*x5 + 1560000000000.0; x138 = 3*x111; x139 = 5*x33; x140 = 5*x127; x141 = 4680000000000*Bass + 4050000000000*Treble + 37500000000*Vol - x129 - x131 + 15*x133 + 1170000000000*x2 + 937500000000*x21 + 1012500000000*x5 + 3900000000000.0; x142 = K*(250000000.0*Vol + 7800000000.0*x2); x143 = x34*(151.2225*Vol + 285.948*x19 + 5597.17548*x2 + 247.455*x20 + 154.957825*x21 + 8921.5776*x22 + 7728.8094*x23 + 4838.97414*x24 + 34.375*x25 + 7720.596*x26 + 13.610025*x28 + 1.447875*x32 + 7043.5375*x4 + 65.8125*x49 + 4330.4625*x5 + 2053.35*x54 + 1072.5*x55 + 219953.37*x6 + 7797.80196*x7 + 618.6375*x8 + 45.1737*x84); x144 = x112*(0.00106158195*x101 + 0.000133823664*x22 + 0.0000025949781*x24 + 0.0000189028125*x25 + 0.0000204150375*x28 + 0.00002359071*x31 + 0.0030882384*x36 + 0.00022303944*x53 + 0.0001930149*x54 + 0.0007106348535*x55 + 0.003613238928*x56 + 0.0007112599065*x58 + 0.0001072305*x6 + 0.000544401*x61 + 0.00602206488*x62 + 0.0010721977695*x64 + 0.00011580894*x7 + 0.00074093701968*x83 + 0.0000042463278*x84 + 0.00003931785*x89 + 0.0000340250625*x90 + 0.00063694917*x92 + 0.00122671692*x95 + 0.0010627112925*x96 + 0.00013248542736*x98); x145 = x128*(2817415.0*Vol + 87981348.0*x2 + 26325.0*x20 + 13750.0*x21 + 821340.0*x23 + 429000.0*x24 + 625000.0*x4 + 247455.0*x5 + 19500000.0*x6); x146 = x130*(0.428922*x19 + 0.04718142*x2 + 0.0083172375*x21 + 13.471582176*x22 + 0.07720596*x23 + 0.3078446514*x24 + 0.3873945625*x25 + 11.580894*x26 + 0.2381754375*x28 + 0.01572714*x31 + 0.013610025*x32 + 19.4945049*x36 + 0.3436875*x4 + 0.71487*x48 + 0.6186375*x49 + 0.3711825*x5 + 22.303944*x53 + 19.3220235*x54 + 12.09743535*x55 + 2.408825952*x56 + 0.4288791078*x58 + 19.30149*x59 + 12.9206337*x6 + 0.0340250625*x61 + 12.9319983*x7 + 9.8982*x8 + 0.490686768*x83 + 0.425084517*x84 + 0.0036196875*x90 + 0.42463278*x92 + 0.11293425*x96); x147 = x132*(0.0000003312135684*x117 + 0.0000000058976775*x55 + 0.0000000063694917*x58 + 0.000000169853112*x64 + 0.00000000736030152*x83 + 0.0000000122671692*x95 + 0.0000000106158195*x96 + 0.00000019872814104*x98); x148 = x145 + x146 + x147; x149 = 4*x144; x150 = 4*x142; x151 = 2*x145 - 2*x146 - 6*x147; x152 = 3*x143; x153 = 5*x142; x154 = 5*x144; x155 = -x145 - x146 + 15*x147; a0 = (x111 + x127 + x134 + x33); a1 = (-x135 + x136 + x137)/a0; a2 = (-x138 + x139 + x140 + x141)/a0; a3 = (6240000000000*Bass + 5400000000000*Treble + 50000000000*Vol - 4*x129 + 4*x131 - 20*x133 + 1560000000000*x2 + 1250000000000*x21 + 1350000000000*x5 + 5200000000000.0)/a0; a4 = (x138 - x139 - x140 + x141)/a0; a5 = (x135 - x136 + x137)/a0; a6 = (-x111 - x127 + x134 - x33)/a0; b0 = (x142 + x143 + x144 + x148)/a0; b1 = (-x149 + x150 + x151)/a0; b2 = (-x152 + x153 + x154 + x155)/a0; b3 = (-4*x145 + 4*x146 - 20*x147)/a0; b4 = (x152 - x153 - x154 + x155)/a0; b5 = (x149 - x150 + x151)/a0; b6 = (-x142 - x143 - x144 + x148)/a0; ); function initDumbleJazz(K) instance(a0, a1, a2, a3, a4, a5, a6 b0, b1, b2, b3, b4, b5, b6, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x90, x91, x92, x93, x94, x95, x96, x97, x98, x99, x100, x101, x102, x103, x104, x105, x106, x107, x108, x109, x110, x111, x112, x113, x114, x115, x116, x117, x118, x119, x120, x121, x122, x123, x124, x125, x126, x127, x128, x129, x130, x131, x132, x133, x134, x135, x136, x137, x138, x139, x140, x141, x142, x143, x144, x145, x146, x147, x148, x149, x150, x151, x152, x153, x154, x155, Bass, Mid, Treble, Vol ) global(sBass, sMid, sTreble, sVol) ( coeffs = 7; Bass = logB(sBass); Mid = logB(sMid); Treble = logA(sTreble); Vol = logA(sVol); x0 = Bass*Mid; x1 = Bass*Treble; x2 = Bass*Vol; x3 = Mid*Vol; x4 = Treble*Vol; x5 = Vol*x0; x6 = Vol*x1; x7 = -Bass + 1.0; x8 = Bass*x7; x9 = -Treble + 1.0; x10 = Bass*x9; x11 = -Vol + 1.0; x12 = Bass*x11; x13 = Mid*x11; x14 = Treble*x11; x15 = Vol*x7; x16 = Vol*x9; x17 = Vol*x11; x18 = Vol*x8; x19 = Vol*x10; x20 = Vol*x12; x21 = Vol*x13; x22 = Vol*x14; x23 = x11*x7; x24 = x11*x9; x25 = Vol*x23; x26 = Vol*x24; x27 = K*(9738456000.0*Bass + 275000000.0*Mid + 128007000.0*Treble + 904807500.0*Vol + 780000000.0*x0 + 395928000.0*x1 + 32853600.0*x10 + 8214180000.0*x12 + 625000000.0*x13 + 317250000.0*x14 + 8658000000.0*x15 + 29220750.0*x16 + 2126068750.0*x17 + 2433600000.0*x18 + 8213400.0*x19 + 11489634000.0*x2 + 2053545000.0*x20 + 156250000.0*x21 + 79312500.0*x22 + 7800000000.0*x23 + 26325000.0*x24 + 1950000000.0*x25 + 6581250.0*x26 + 693750000.0*x3 + 352147500.0*x4 + 195000000.0*x5 + 98982000.0*x6 + 9734400000.0*x8 + 15536288000.0); x128 = K*K; x28 = x128*K; x130 = x28*K; x110 = x130*K; x132 = x110*K; x29 = Mid*Treble; x30 = Treble*x0; x31 = Treble*x3; x32 = x0*x4; x33 = Mid*x7; x34 = Mid*x9; x35 = Treble*x7; x36 = Treble*x9; x37 = x0*x7; x38 = Mid*x10; x39 = x0*x11; x40 = Treble*x8; x41 = Treble*x10; x42 = x1*x11; x43 = Treble*x33; x44 = Treble*x34; x45 = Treble*x13; x46 = x3*x7; x47 = Mid*x16; x48 = Treble*x15; x49 = Treble*x16; x50 = x0*x35; x51 = x10*x29; x52 = x0*x14; x53 = x0*x15; x54 = x10*x3; x55 = x0*x17; x56 = x4*x8; x57 = x10*x4; x58 = x1*x17; x59 = x3*x35; x60 = x16*x29; x61 = x13*x4; x62 = x15*x30; x63 = x10*x31; x64 = x14*x5; x65 = x7*x9; x66 = x10*x7; x67 = x11*x8; x68 = x10*x11; x69 = x34*x7; x70 = x13*x7; x71 = Mid*x24; x72 = x35*x9; x73 = Treble*x23; x74 = Treble*x24; x75 = x16*x7; x76 = x10*x33; x77 = x0*x23; x78 = x10*x13; x79 = x10*x35; x80 = x14*x8; x81 = x10*x14; x82 = x10*x15; x83 = x17*x8; x84 = x10*x17; x85 = x13*x35; x86 = x24*x29; x87 = x16*x33; x88 = x13*x15; x89 = x24*x3; x90 = x16*x35; x91 = x23*x4; x92 = x24*x4; x93 = x10*x46; x94 = x23*x5; x95 = x13*x19; x96 = x10*x48; x97 = x14*x18; x98 = x14*x19; x99 = x15*x45; x100 = x24*x31; x101 = x24*x7; x102 = x10*x23; x103 = x24*x33; x104 = x24*x35; x105 = x15*x24; x106 = x19*x23; x107 = x24*x46; x108 = x24*x48; x109 = x28*(-5987.21136*Bass + 61891.001*Mid + 32242.2432606*Treble - 895.129957000001*Vol + 255764.8392*x0 + 145846.54826352*x1 + 10236.524688*x10 + 20.879015625*x100 + 9791.358408*x101 + 1260.7897536*x102 + 2053.35*x103 + 1042.28046*x104 + 2493.013302*x105 + 315.1974384*x106 + 513.3375*x107 + 260.570115*x108 + 317107.7982384*x12 + 152653.01725*x13 + 79817.94162135*x14 + 244184.38512*x15 + 6534.6615945*x16 + 14122.34831675*x17 + 214518.530304*x18 + 13464.7687044*x19 + 327830.642724*x2 + 85864.0270566*x20 + 39258.88525*x21 + 20534.7592904625*x22 + 228137.65728*x23 + 5951.9154942*x24 + 62942.98842*x25 + 1534.161742425*x26 + 10895.729175*x29 + 167653.533375*x3 + 39902.61366*x30 + 27593.08048125*x31 + 34817.660865*x32 + 97065.54*x33 + 851.0346*x34 + 57545.363304*x35 + 459.91293426*x36 + 275313.168*x37 + 3160.51632*x38 + 262206.1962*x39 + 88226.88852465*x4 + 163219.5759168*x40 + 1683.491398992*x41 + 133262.93690892*x42 + 10888.02*x43 + 36.7470675*x44 + 24888.3418125*x45 + 255787.935*x46 + 2186.9362125*x47 + 145595.890206*x48 + 1163.271850065*x49 + 324417.9783*x5 + 30882.384*x50 + 104.228046*x51 + 24896.44755*x52 + 99795.852*x53 + 2939.98653*x54 + 66678.6393*x55 + 42009.3069552*x56 + 1463.153309748*x57 + 33862.25839113*x58 + 27467.505*x59 + 168805.34199828*x6 + 92.702829375*x60 + 6265.707328125*x61 + 7720.596*x62 + 26.0570115*x63 + 6224.1118875*x64 + 4112.613648*x65 + 11664.8678016*x66 + 169004.174976*x67 + 10978.60209264*x68 + 903.474*x69 + 231993.45*x70 + 1975.770225*x71 + 458.6034024*x72 + 131449.08582*x73 + 1049.102051985*x74 + 10799.635392*x75 + 2562.5808*x76 + 32306.04*x77 + 2154.37482*x78 + 1300.76601408*x79 + 210353.959296*x8 + 1883.825424*x80 + 1044.573477012*x81 + 4120.6299264*x82 + 42932.330064*x83 + 2791.94738706*x84 + 24745.5*x85 + 83.5160625*x86 + 2279.2185*x87 + 59070.8625*x88 + 497.56224375*x89 + 1156.9313106*x90 + 33406.672455*x91 + 264.11286637125*x92 + 640.6452*x93 + 8076.51*x94 + 538.593705*x95 + 325.19150352*x96 + 470.956356*x97 + 261.143369253*x98 + 6186.375*x99 + 120755.083922); x111 = x34*x35; x112 = x33*x41; x113 = x23*x30; x114 = x10*x45; x115 = x33*x49; x116 = x35*x54; x117 = x23*x32; x118 = x10*x61; x119 = x10*x70; x120 = x23*x41; x121 = x33*x74; x122 = x35*x78; x123 = x10*x88; x124 = x23*x57; x125 = x35*x89; x126 = x45*x82; x127 = x110*(0.000027912924*Treble - 0.00000120978*Vol + 0.0008708832288*x1 + 0.00410224251121425*x100 + 0.00799227555984*x101 + 0.022668999769728*x102 + 0.0105348682296*x103 + 0.0190272425403622*x104 + 0.003076069672962*x105 + 0.0064210920241104*x106 + 0.00376272075465*x107 + 0.00540917397500454*x108 + 0.01086890063688*x111 + 0.030828154533696*x112 + 0.04776007009176*x113 + 0.0249226351385544*x114 + 0.02741927206122*x115 + 0.007707038633424*x116 + 0.01210562430714*x117 + 0.0063739723478886*x118 + 0.02988071716032*x119 + 0.000844118496*x12 + 0.000814149448212672*x120 + 0.02476510486983*x121 + 0.000178855326936*x122 + 0.00763578607428*x123 + 0.000203537362053168*x124 + 0.0063345897807075*x125 + 0.000044713831734*x126 + 0.0007891065*x13 + 0.000461642794452*x14 + 0.000887010696*x15 + 0.000222462045*x16 + 0.0001762804019*x17 + 0.0025158848832*x18 + 0.006940815804*x19 + 0.00080637336*x2 + 0.00501209265648*x20 + 0.004545411002125*x21 + 0.0006853601932605*x22 + 0.0009285303456*x23 + 0.000232875162*x24 + 0.00545020149102*x25 + 0.0002400441781725*x26 + 0.00081412695*x29 + 0.00075382125*x3 + 0.00362868012*x30 + 0.00824272605*x31 + 0.02377943568*x32 + 0.00095797155168*x35 + 0.0002402590086*x36 + 0.0035171604*x39 + 0.000299222586*x4 + 0.002717155673856*x40 + 0.00749608106832*x41 + 0.0138763708334784*x42 + 0.0015966192528*x43 + 0.0069238156455*x44 + 0.012358876727295*x45 + 0.00147835116*x46 + 0.0064109404125*x47 + 0.01005159834432*x48 + 0.00066071227365*x49 + 0.003359889*x5 + 0.00452859278976*x50 + 0.0286210214316*x51 + 0.040723372601964*x52 + 0.004193141472*x53 + 0.02650094577*x54 + 0.0183994045833*x55 + 0.022334634226944*x56 + 0.02061422293788*x57 + 0.0157351124963916*x58 + 0.0140916318192*x59 + 0.0093357446832*x6 + 0.017538874221375*x60 + 0.0130070404420987*x61 + 0.02967673572864*x62 + 0.0318573022599*x63 + 0.025782112800171*x64 + 0.00263364970752*x67 + 0.0072657050544*x68 + 0.001547550576*x70 + 0.006711026985*x71 + 0.008245689175152*x72 + 0.0149883298307496*x73 + 0.0007689035242863*x74 + 0.0076348973844*x75 + 0.0043894161792*x77 + 0.027741415572*x78 + 0.0233877729331584*x79 + 0.0363369998975443*x80 + 0.019454660911399*x81 + 0.02165534530848*x82 + 0.015191105991984*x83 + 0.003290184797562*x84 + 0.0204671663703*x85 + 0.015867318269907*x86 + 0.010063796886*x87 + 0.0072531967365*x88 + 0.002417889307275*x89 + 0.020801624964588*x90 + 0.0157770064200294*x91 + 0.000576526712986575*x92 + 0.0285445875312*x93 + 0.0201266245908*x94 + 0.00821021895018*x95 + 0.0058469432332896*x96 + 0.00983809205606448*x97 + 0.00551602856776374*x98 + 0.020572199882325*x99 + 0.00002705508); x129 = x128*(69583282.08*Bass + 8586075.0*Mid + 4261091.13*Treble + 6626435.7*Vol + 31444140.0*x0 + 16713308.664*x1 + 1326628.368*x10 + 821340.0*x101 + 205335.0*x105 + 120489420.48*x12 + 19935687.5*x13 + 10558111.725*x14 + 118765374.0*x15 + 930293.91*x16 + 17259209.725*x17 + 44542180.8*x18 + 1191600.072*x19 + 148497619.92*x2 + 30573191.22*x20 + 5018296.875*x21 + 2656976.68125*x22 + 107617380.0*x23 + 840325.59*x24 + 27333345.0*x25 + 211529.2725*x26 + 348975.0*x29 + 22067081.25*x3 + 989820.0*x30 + 880368.75*x31 + 247455.0*x32 + 8580000.0*x33 + 28957.5*x34 + 4355208.0*x35 + 14698.827*x36 + 24336000.0*x37 + 82134.0*x38 + 20535450.0*x39 + 11706312.4425*x4 + 12352953.6*x40 + 41691.2184*x41 + 9958579.02*x42 + 793125.0*x45 + 21645000.0*x46 + 73051.875*x47 + 10987002.0*x48 + 37081.13175*x49 + 28353585.0*x5 + 6084000.0*x53 + 20533.5*x54 + 5133862.5*x55 + 3088238.4*x56 + 10422.8046*x57 + 2489644.755*x58 + 14115130.146*x6 + 198281.25*x61 + 361389.6*x65 + 1025032.32*x66 + 12922416.0*x67 + 861749.928*x68 + 19500000.0*x70 + 65812.5*x71 + 9898200.0*x73 + 33406.425*x74 + 911687.4*x75 + 128620627.2*x8 + 256258.08*x82 + 3230604.0*x83 + 215437.482*x84 + 4875000.0*x88 + 16453.125*x89 + 2474550.0*x91 + 8351.60625*x92 + 140196064.34); x131 = x130*(-0.0686275199999999*Bass + 0.64155*Mid + 2.8906422264*Treble - 0.127990708*Vol + 2.85948*x0 + 86.51539922688*x1 + 5.90707728*x10 + 0.620612036240625*x100 + 19.82620798704*x101 + 14.347787395968*x102 + 20.57703102*x103 + 11.886374821932*x104 + 5.49398350566*x105 + 3.653189562672*x106 + 5.257192005*x107 + 3.028919130783*x108 + 1.146508506*x111 + 3.2519150352*x112 + 4.70956356*x113 + 2.61143369253*x114 + 2.8923282765*x115 + 0.8129787588*x116 + 1.17739089*x117 + 0.6528584231325*x118 + 3.151974384*x119 + 91.0417375296*x12 + 0.0715421307744*x120 + 2.60570115*x121 + 0.787993596*x123 + 0.0178855326936*x124 + 0.6514252875*x125 + 82.46099373*x13 + 12.268630906533*x14 + 95.062705764*x15 + 3.3532484895*x16 + 3.017769443975*x17 + 264.7660867488*x18 + 28.2723790284*x19 + 87.463623936*x2 + 39.85369913382*x20 + 28.985191504375*x21 + 7.44315838998075*x22 + 98.9529591024*x23 + 3.4385055822*x24 + 37.1486362026*x25 + 1.1858854225725*x26 + 78.539680269*x29 + 79.217376175*x3 + 324.5655809448*x30 + 199.94985207225*x31 + 364.8008434122*x32 + 1.2581712*x33 + 5.4561195*x34 + 94.11317044272*x35 + 3.05920005066*x36 + 3.56863104*x37 + 22.5539964*x38 + 332.614602216*x39 + 11.1327109911*x4 + 266.939174346624*x40 + 12.990149829072*x41 + 231.040101754894*x42 + 123.17617026*x43 + 1.0799629074*x44 + 180.914197109625*x45 + 125.1565263*x46 + 14.82098553*x47 + 242.25418283508*x48 + 7.752087865665*x49 + 319.26240606*x5 + 349.372410192*x50 + 4.01069521008*x51 + 285.8540919273*x52 + 346.87889496*x53 + 28.817863776*x54 + 97.4798728215*x55 + 80.441013253536*x56 + 15.108689092068*x57 + 65.0389292100054*x58 + 311.801466015*x59 + 244.64739140712*x6 + 2.73204424935*x60 + 46.5963524277187*x61 + 90.354134988*x62 + 3.60837495252*x63 + 72.829833391575*x64 + 6.497785008*x65 + 18.4300811136*x66 + 275.80025985408*x67 + 27.35861856624*x68 + 8.56493352*x69 + 130.1805882*x70 + 13.503762558*x71 + 5.218906719312*x72 + 221.89088520612*x73 + 7.0125830643843*x74 + 21.2244604884*x75 + 24.293265984*x76 + 361.12896144*x77 + 23.3531930736*x78 + 14.8027172402304*x79 + 2.141178624*x8 + 22.683296342304*x80 + 11.9537436617446*x81 + 18.31373994528*x82 + 77.85621718992*x83 + 7.439464705842*x84 + 281.60626455*x85 + 2.4640746112125*x86 + 22.66857333*x87 + 45.2788323*x88 + 3.4845204054375*x89 + 13.165878314628*x90 + 62.68924651743*x91 + 1.81080191500358*x92 + 9.084348936*x93 + 91.98545616*x94 + 5.95654042815*x95 + 3.7006793100576*x96 + 5.737066799256*x97 + 3.04576134073614*x98 + 71.7625686375*x99 + 4.181838408); x133 = x132*(0.000000964638082175625*x100 + 0.00000045351290463336*x104 + 0.000000419919356142*x105 + 0.0000011910439919664*x106 + 0.00000055350882873*x107 + 0.00000114408937305234*x108 + 0.0000002490726034368*x113 + 0.000001574156178738*x114 + 0.0000016322204650752*x117 + 0.0000017521516242945*x118 + 0.00000128632751132371*x120 + 0.0000005977895350284*x121 + 0.00000169554849935328*x122 + 0.000001569952314216*x123 + 0.000000321581877830928*x124 + 0.0000015080599633671*x125 + 0.00000042388712483832*x126 + 0.00000000153521082*x14 + 0.0000000014214915*x17 + 0.0000000443505348*x20 + 0.00000004146016875*x21 + 0.00000001645724223*x22 + 0.00000004878558828*x25 + 0.000000012235412475*x26 + 0.000000047898577584*x42 + 0.00000004477698225*x45 + 0.0000001995774066*x52 + 0.000000184793895*x55 + 0.000000513465957576*x58 + 0.00000045334993275*x61 + 0.0000013078689624*x64 + 0.0000000526884353424*x73 + 0.000000013214245473*x74 + 0.00000014944356206208*x80 + 0.0000004122844587576*x81 + 0.000000138373668576*x83 + 0.00000038174486922*x84 + 0.000000087814058904*x85 + 0.0000003808098605025*x86 + 0.0000000813093138*x88 + 0.0000003526017226875*x89 + 0.0000005528379089376*x91 + 0.00000003633917505075*x92 + 0.00000023062278096*x94 + 0.00000145755201735*x95 + 0.00000122840488248192*x97 + 0.0000011337822615834*x98 + 0.000000775039750056*x99); x134 = 312000000000*Bass + 27500000000*Vol + x129 + x131 + x133 + 62500000000*x17 + 78000000000*x2 + 360000000000.0; x135 = 4*x127; x136 = 4*x27; x137 = 1872000000000*Bass + 165000000000*Vol + 2*x129 - 2*x131 - 6*x133 + 375000000000*x17 + 468000000000*x2 + 2160000000000.0; x138 = 3*x109; x139 = 5*x27; x140 = 5*x127; x141 = 4680000000000*Bass + 412500000000*Vol - x129 - x131 + 15*x133 + 937500000000*x17 + 1170000000000*x2 + 5400000000000.0; x142 = K*(250000000.0*Vol + 7800000000.0*x2); x143 = x28*(1755.0975*Vol + 3145.428*x15 + 247.455*x16 + 159.998575*x17 + 8921.5776*x18 + 7720.596*x19 + 7577.622*x2 + 4834.68414*x20 + 34.375*x21 + 17.44875*x22 + 1.447875*x26 + 7272.6625*x3 + 793.125*x31 + 24745.5*x32 + 3691.603485*x4 + 65.8125*x47 + 33.406425*x49 + 219758.37*x5 + 2053.35*x54 + 1072.5*x55 + 1042.28046*x57 + 544.401*x58 + 111549.348612*x6 + 45.1737*x84); x144 = x110*(0.0000045933834375*x100 + 0.00014331356325*x118 + 0.000007561125*x17 + 0.0002359071*x20 + 0.0002205328125*x21 + 0.0001224970300125*x22 + 0.00025949781*x25 + 0.0050882934375*x31 + 0.02267925075*x32 + 0.000174455775*x4 + 0.005987322198*x48 + 0.00098294625*x55 + 0.0169822229616*x56 + 0.00052888012749*x58 + 0.00997887033*x59 + 0.00544302018*x6 + 0.0007850509875*x60 + 0.0005075954791875*x61 + 0.028303704936*x62 + 0.02449359081*x63 + 0.01533803543415*x64 + 0.000736030152*x83 + 0.00043249635*x88 + 0.0000340250625*x89 + 0.00021953514726*x91 + 0.000017271121725*x92 + 0.00122671692*x94 + 0.00106158195*x95 + 0.000622681508592*x97 + 0.00053885899782*x98); x145 = x128*(2909065.0*Vol + 26325.0*x16 + 13750.0*x17 + 821340.0*x19 + 87903348.0*x2 + 429000.0*x20 + 625000.0*x3 + 317250.0*x4 + 19500000.0*x5 + 9898200.0*x6); x146 = x130*(0.137475*Vol + 4.718142*x15 + 0.0965303625*x17 + 13.3823664*x18 + 4.28922*x2 + 0.41676921*x20 + 0.3999964375*x21 + 0.203038191675*x22 + 0.17299854*x25 + 0.013610025*x26 + 4.0096875*x3 + 9.2290087125*x31 + 278.87337153*x32 + 2.2272187275*x4 + 7.86357*x46 + 0.6186375*x47 + 3.991548132*x48 + 0.314020395*x49 + 17.87175*x5 + 22.303944*x53 + 19.30149*x54 + 12.08671035*x55 + 11.3214819744*x56 + 9.797436324*x57 + 6.13521417366*x58 + 9.616002318*x6 + 0.0835160625*x60 + 0.043621875*x61 + 2.60570115*x63 + 1.3610025*x64 + 0.490686768*x83 + 0.42463278*x84 + 0.0036196875*x89 + 0.001837353375*x92 + 0.11293425*x95 + 0.0573254253*x98); x147 = x132*(0.0000000431778043125*x100 + 0.00000155670377148*x117 + 0.00000134714749455*x118 + 0.000000009595067625*x22 + 0.0000002993661099*x58 + 0.0000002798561390625*x61 + 0.00000124735879125*x64 + 0.00000032930272089*x91 + 0.000000934022262888*x97 + 0.00000054883786815*x99); x148 = x145 + x146 + x147; x149 = 4*x144; x150 = 4*x142; x151 = 2*x145 - 2*x146 - 6*x147; x152 = 3*x143; x153 = 5*x142; x154 = 5*x144; x155 = -x145 - x146 + 15*x147; a0 = (x109 + x127 + x134 + x27); a1 = (-x135 + x136 + x137)/a0; a2 = (-x138 + x139 + x140 + x141)/a0; a3 = (6240000000000*Bass + 550000000000*Vol - 4*x129 + 4*x131 - 20*x133 + 1250000000000*x17 + 1560000000000*x2 + 7200000000000.0)/a0; a4 = (x138 - x139 - x140 + x141)/a0; a5 = (x135 - x136 + x137)/a0; a6 = (-x109 - x127 + x134 - x27)/a0; b0 = (x142 + x143 + x144 + x148)/a0; b1 = (-x149 + x150 + x151)/a0; b2 = (-x152 + x153 + x154 + x155)/a0; b3 = (-4*x145 + 4*x146 - 20*x147)/a0; b4 = (x152 - x153 - x154 + x155)/a0; b5 = (x149 - x150 + x151)/a0; b6 = (-x142 - x143 - x144 + x148)/a0; ); function initAria(K) instance(a0, a1, a2, a3, a4, b0, b1, b2, b3, b4, coeffs ) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63, x64, x65, x66, x67, x68, x69, x70, x71, x72, x73, x74, x75, x76, Bass, Mid, Treble ) global(sBass, sMid, sTreble) ( coeffs = 5; Bass = logB(sBass); Mid = logB(sMid); Treble = logB(sTreble); x0 = Bass*Mid; x1 = Bass*Treble; x2 = Mid*Treble; x3 = Bass*x2; x4 = -Bass + 1.0; x5 = Bass*x4; x6 = -Mid + 1.0; x7 = Bass*x6; x8 = -Treble + 1.0; x9 = Bass*x8; x10 = Mid*x4; x11 = Mid*x6; x12 = Mid*x8; x13 = Treble*x4; x14 = Treble*x6; x15 = Treble*x8; x16 = Mid*x5; x17 = Bass*x11; x18 = Bass*x12; x19 = x1*x4; x20 = x1*x6; x21 = Bass*x15; x22 = x2*x4; x23 = x2*x6; x24 = x2*x8; x25 = x2*x5; x26 = x2*x7; x27 = x2*x9; x28 = x4*x6; x29 = x4*x8; x30 = x6*x8; x31 = x5*x6; x32 = x5*x8; x33 = x7*x8; x34 = x11*x4; x35 = x10*x8; x36 = x11*x8; x37 = Treble*x28; x38 = x15*x4; x39 = x15*x6; x40 = x11*x5; x41 = x12*x5; x42 = x11*x9; x43 = x1*x28; x44 = x15*x5; x45 = x15*x7; x46 = x2*x28; x47 = x2*x29; x48 = x2*x30; x49 = x23*x5; x50 = x2*x32; x51 = x2*x33; x52 = x28*x8; x53 = x30*x5; x54 = x11*x29; x55 = x15*x28; x56 = x11*x32; x57 = x39*x5; x58 = x24*x28; x59 = x25*x30; x60 = K*(726000000000007000000.0*Bass + 72600000000002400000.0*Mid + 871200000000000000000.0*Treble + 27551237000000000000000000.0*x0 + 94020400000000000000000.0*x1 + 27475889200000000000000000.0*x10 + 7592860000000000000000.0*x11 + 123872860000000000000000.0*x12 + 93400000000000000000000.0*x13 + 213916000000000000000000.0*x14 + 396000000000000000000.0*x15 + 11001717200000000000000000.0*x16 + 2588022260000000000000000.0*x17 + 412902260000000000000000.0*x18 + 16400000000000000000000.0*x19 + 214042720000000000000000.0*x2 + 9667186000000000000000000.0*x20 + 1266000000000000000000.0*x21 + 9613570000000000000000000.0*x22 + 19892300000000000000000.0*x23 + 40836300000000000000000.0*x24 + 1684870000000000000000000.0*x25 + 886009300000000000000000.0*x26 + 126713300000000000000000.0*x27 + 27450840000000000000000000.0*x28 + 3640000000000000000000.0*x29 + 9674657520000000000000000.0*x3 + 123760000000000000000000.0*x30 + 10992640000000000000000000.0*x31 + 1440000000000000000000.0*x32 + 412960000000000000000000.0*x33 + 2580502000000000000000000.0*x34 + 364342000000000000000000.0*x35 + 11628000000000000000000.0*x36 + 9605200000000000000000000.0*x37 + 1200000000000000000000.0*x38 + 40800000000000000000000.0*x39 + 934682000000000000000000.0*x40 + 144122000000000000000000.0*x41 + 38348000000000000000000.0*x42 + 1684200000000000000000000.0*x43 + 200000000000000000000.0*x44 + 126800000000000000000000.0*x45 + 881310000000000000000000.0*x46 + 120110000000000000000000.0*x47 + 3740000000000000000000.0*x48 + 89210000000000000000000.0*x49 + 106744000000000000000000.0*x5 + 20010000000000000000000.0*x50 + 11340000000000000000000.0*x51 + 364000000000000000000000.0*x52 + 144000000000000000000000.0*x53 + 34200000000000000000000.0*x54 + 120000000000000000000000.0*x55 + 12200000000000000000000.0*x56 + 20000000000000000000000.0*x57 + 11000000000000000000000.0*x58 + 1000000000000000000000.0*x59 + 27526115200000000000000000.0*x7 + 4115200000000000000000.0*x9 + 344392400000000000000000.0); x64 = K*K; x61 = x64*K; x62 = 1597200000000000.0*x1; x63 = x61*(1597200000000000.0*x0 + 1597200000000000.0*x10 + 1597200000000000.0*x13 + 1597200000000000.0*x16 + 159720000000000.0*x17 + 164719720000000000.0*x18 + 166476640000000000.0*x20 + 1916640000000000.0*x21 + 166316920000000000.0*x22 + 164719720000000000.0*x25 + 16631692000000000.0*x26 + 197647692000000000.0*x27 + 1597200000000000.0*x28 + 1597200000000000.0*x29 + 166316920000000000.0*x3 + 1597200000000000.0*x31 + 1597200000000000.0*x32 + 164560000000000000.0*x33 + 159720000000000.0*x34 + 164719720000000000.0*x35 + 166476640000000000.0*x37 + 1916640000000000.0*x38 + x4*x62 + 159720000000000.0*x40 + 164719720000000000.0*x41 + 16456000000000000.0*x42 + 164879440000000000.0*x43 + 319440000000000.0*x44 + 197472000000000000.0*x45 + 16631692000000000.0*x46 + 197647692000000000.0*x47 + 16471972000000000.0*x49 + 32927972000000000.0*x50 + 18101600000000000.0*x51 + 164560000000000000.0*x52 + 164560000000000000.0*x53 + 16456000000000000.0*x54 + 197472000000000000.0*x55 + 16456000000000000.0*x56 + 32912000000000000.0*x57 + 18101600000000000.0*x58 + 1645600000000000.0*x59 + x62 + 1597200000000000.0*x7 + 1597200000000000.0*x9); x65 = x64*(1673916200000000000000.0*x0 + 45885400000000000000.0*x1 + 1673843600000000000000.0*x10 + 7260000000000000.0*x11 + 7487260000000000000.0*x12 + 45812800000000000000.0*x13 + 7567120000000000000.0*x14 + 87120000000000000.0*x15 + 1657871600000000000000.0*x16 + 167072180000000000000.0*x17 + 2754712180000000000000.0*x18 + 13868800000000000000.0*x19 + 7559860000000000000.0*x2 + 4735470520000000000000.0*x20 + 8990520000000000000.0*x21 + 4731181840000000000000.0*x22 + 755986000000000000.0*x23 + 8983986000000000000.0*x24 + 1429307440000000000000.0*x25 + 440559526000000000000.0*x26 + 926275526000000000000.0*x27 + 1672246400000000000000.0*x28 + 26646400000000000000.0*x29 + 4738229100000000000000.0*x3 + 7480000000000000000.0*x30 + 1656274400000000000000.0*x31 + 10674400000000000000.0*x32 + 2752200000000000000000.0*x33 + 167064920000000000000.0*x34 + 2747224920000000000000.0*x35 + 748000000000000000.0*x36 + 4728416000000000000000.0*x37 + 8976000000000000000.0*x38 + 8976000000000000000.0*x39 + 165467720000000000000.0*x40 + 1100027720000000000000.0*x41 + 258764000000000000000.0*x42 + 1429736000000000000000.0*x43 + 1496000000000000000.0*x44 + 925496000000000000000.0*x45 + 439854800000000000000.0*x46 + 924822800000000000000.0*x47 + 822800000000000000.0*x48 + 109986800000000000000.0*x49 + 15972000000000000000.0*x5 + 154074800000000000000.0*x50 + 84774800000000000000.0*x51 + 2744720000000000000000.0*x52 + 1099120000000000000000.0*x53 + 258016000000000000000.0*x54 + 924000000000000000000.0*x55 + 93456000000000000000.0*x56 + 154000000000000000000.0*x57 + 84700000000000000000.0*x58 + 7700000000000000000.0*x59 + 1672319000000000000000.0*x7 + 26719000000000000000.0*x9 + 16117200000000000000.0); x66 = 4752000000000000000000000*Bass + 1128600000000000000000000*Mid + 3960000000000000000000000*Treble + 4129022600000000000000000000*x0 + 12660000000000000000000000*x1 + 3643420000000000000000000000*x10 + 116280000000000000000000000*x11 + 12000000000000000000000000*x13 + 408000000000000000000000000*x14 + 1441220000000000000000000000*x16 + 383480000000000000000000000*x17 + 2000000000000000000000000*x19 + 408363000000000000000000000*x2 + 1268000000000000000000000000*x20 + 1201100000000000000000000000*x22 + 37400000000000000000000000*x23 + 200100000000000000000000000*x25 + 113400000000000000000000000*x26 + 3640000000000000000000000000*x28 + 1267133000000000000000000000*x3 + 1440000000000000000000000000*x31 + 342000000000000000000000000*x34 + 1200000000000000000000000000*x37 + 122000000000000000000000000*x40 + 200000000000000000000000000*x43 + 110000000000000000000000000*x46 + 10000000000000000000000000*x49 + 14400000000000000000000000*x5 + x65 + 4129600000000000000000000000*x7 + 1286012000000000000000000000.0; x67 = 2*x63; x68 = 2*x60; x69 = 19008000000000000000000000*Bass + 4514400000000000000000000*Mid + 15840000000000000000000000*Treble + 16516090400000000000000000000*x0 + 50640000000000000000000000*x1 + 14573680000000000000000000000*x10 + 465120000000000000000000000*x11 + 48000000000000000000000000*x13 + 1632000000000000000000000000*x14 + 5764880000000000000000000000*x16 + 1533920000000000000000000000*x17 + 8000000000000000000000000*x19 + 1633452000000000000000000000*x2 + 5072000000000000000000000000*x20 + 4804400000000000000000000000*x22 + 149600000000000000000000000*x23 + 800400000000000000000000000*x25 + 453600000000000000000000000*x26 + 14560000000000000000000000000*x28 + 5068532000000000000000000000*x3 + 5760000000000000000000000000*x31 + 1368000000000000000000000000*x34 + 4800000000000000000000000000*x37 + 488000000000000000000000000*x40 + 800000000000000000000000000*x43 + 440000000000000000000000000*x46 + 40000000000000000000000000*x49 + 57600000000000000000000000*x5 + 16518400000000000000000000000*x7 + 5144048000000000000000000000.0; x70 = K*(1597200000000000000000000.0*x0 + 1597200000000000000000000.0*x10 + 7260000000000000000000.0*x12 + 33000000000000000000000.0*x14 + 1597200000000000000000000.0*x16 + 249260000000000000000000.0*x18 + 47520000000000000000000.0*x2 + 573000000000000000000000.0*x20 + 870000000000000000000000.0*x22 + 3300000000000000000000.0*x23 + 3300000000000000000000.0*x24 + 870000000000000000000000.0*x25 + 57300000000000000000000.0*x26 + 113300000000000000000000.0*x27 + 1357520000000000000000000.0*x3 + 220000000000000000000000.0*x33 + 22000000000000000000000.0*x35 + 100000000000000000000000.0*x37 + 22000000000000000000000.0*x41 + 22000000000000000000000.0*x42 + 100000000000000000000000.0*x43 + 100000000000000000000000.0*x45 + 10000000000000000000000.0*x46 + 10000000000000000000000.0*x47 + 10000000000000000000000.0*x49 + 10000000000000000000000.0*x50 + 10000000000000000000000.0*x51); x71 = x61*(159720000000000000.0*x20 + 159720000000000000.0*x22 + 159720000000000000.0*x25 + 15972000000000000.0*x26 + 15972000000000000.0*x27 + 159720000000000000.0*x3 + 159720000000000000.0*x37 + 159720000000000000.0*x43 + 15972000000000000.0*x46 + 15972000000000000.0*x47 + 15972000000000000.0*x49 + 15972000000000000.0*x50); x72 = x64*(7260000000000000000.0*x14 + 159720000000000000000.0*x18 + 7260000000000000000.0*x2 + 755260000000000000000.0*x20 + 1067440000000000000000.0*x22 + 726000000000000000.0*x23 + 726000000000000000.0*x24 + 1067440000000000000000.0*x25 + 75526000000000000000.0*x26 + 97526000000000000000.0*x27 + 1074700000000000000000.0*x3 + 159720000000000000000.0*x35 + 748000000000000000000.0*x37 + 159720000000000000000.0*x41 + 748000000000000000000.0*x43 + 22000000000000000000.0*x45 + 74800000000000000000.0*x46 + 74800000000000000000.0*x47 + 74800000000000000000.0*x49 + 74800000000000000000.0*x50 + 2200000000000000000.0*x51); x73 = 72600000000000000000000000*Mid + 2492600000000000000000000000*x0 + 220000000000000000000000000*x10 + 220000000000000000000000000*x16 + 220000000000000000000000000*x17 + 33000000000000000000000000*x2 + 1000000000000000000000000000*x20 + 100000000000000000000000000*x22 + 100000000000000000000000000*x25 + 100000000000000000000000000*x26 + 1133000000000000000000000000*x3 + 2200000000000000000000000000*x7 + x72; x74 = 2*x71; x75 = 2*x70; x76 = 290400000000000000000000000*Mid + 9970400000000000000000000000*x0 + 880000000000000000000000000*x10 + 880000000000000000000000000*x16 + 880000000000000000000000000*x17 + 132000000000000000000000000*x2 + 4000000000000000000000000000*x20 + 400000000000000000000000000*x22 + 400000000000000000000000000*x25 + 400000000000000000000000000*x26 + 4532000000000000000000000000*x3 + 8800000000000000000000000000*x7; a0 = (x60 + x63 + x66); a1 = (-x67 + x68 + x69)/a0; a2 = (28512000000000000000000000*Bass + 6771600000000000000000000*Mid + 23760000000000000000000000*Treble + 24774135600000000000000000000*x0 + 75960000000000000000000000*x1 + 21860520000000000000000000000*x10 + 697680000000000000000000000*x11 + 72000000000000000000000000*x13 + 2448000000000000000000000000*x14 + 8647320000000000000000000000*x16 + 2300880000000000000000000000*x17 + 12000000000000000000000000*x19 + 2450178000000000000000000000*x2 + 7608000000000000000000000000*x20 + 7206600000000000000000000000*x22 + 224400000000000000000000000*x23 + 1200600000000000000000000000*x25 + 680400000000000000000000000*x26 + 21840000000000000000000000000*x28 + 7602798000000000000000000000*x3 + 8640000000000000000000000000*x31 + 2052000000000000000000000000*x34 + 7200000000000000000000000000*x37 + 732000000000000000000000000*x40 + 1200000000000000000000000000*x43 + 660000000000000000000000000*x46 + 60000000000000000000000000*x49 + 86400000000000000000000000*x5 - 2*x65 + 24777600000000000000000000000*x7 + 7716072000000000000000000000.0)/a0; a3 = (x67 - x68 + x69)/a0; a4 = (-x60 - x63 + x66)/a0; b0 = (x70 + x71 + x73)/a0; b1 = (-x74 + x75 + x76)/a0; b2 = (435600000000000000000000000*Mid + 14955600000000000000000000000*x0 + 1320000000000000000000000000*x10 + 1320000000000000000000000000*x16 + 1320000000000000000000000000*x17 + 198000000000000000000000000*x2 + 6000000000000000000000000000*x20 + 600000000000000000000000000*x22 + 600000000000000000000000000*x25 + 600000000000000000000000000*x26 + 6798000000000000000000000000*x3 + 13200000000000000000000000000*x7 - 2*x72)/a0; b3 = (x74 - x75 + x76)/a0; b4 = (-x70 - x71 + x73)/a0; ); function initBoneRay(K) instance( a0, a1, a2, a3, a4 b0, b1, b2, b3, b4, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, Bass, Mid, Treble) global(sBass, sMid, sTreble) ( coeffs = 5; Bass = sBass; Mid = logB(sMid); Treble = sTreble; x17 = K * K; x10 = x17 * K; x19 = x10 * K; x0 = Mid*Treble; x1 = 1 - Treble; x2 = Mid*x1; x3 = 1.0 - Mid; x4 = Treble*x3; x5 = Treble*x1; x6 = Treble*x2; x7 = x1*x3; x8 = 4700000000.0*x7; x9 = K*(1216759999.9999981*Mid + Treble*x8 + 6788416799.9999981*Treble + 8379000000.0*x0 + 8595600000.0*x2 + 6909000000.0*x4 + 9586960000.0*x5 + 5699999999.999999*x6 + 7087600000.0*x7 + 9451134324.0); x11 = Mid*x3; x12 = Mid*x4; x13 = 1247.1218759999997*x7; x14 = Mid*x7; x15 = x0*x7; x16 = x10*(-32.114530359999989*Mid + Treble*x13 + 40.794133159999987*Treble + 7004.9105067600003*x0 + 6730.8858239600004*x11 + 19595.242068000007*x12 + x13 + 15728.237356000011*x14 + 14215.770399999999*x15 + 265.34508*x2 + 1287.9160091599997*x4 + 1247.1218759999997*x5 + 15993.582436000008*x6 + 40.794133159999987); x18 = x17*(-4097662.4759999998*Mid + 11746991.999999998*Treble*x7 + 5538445.4456000002*Treble + 36766200.839999996*x0 + 32597000.399999999*x11 + 39381299.999999993*x12 + 40399319.999999993*x14 + 26790000.0*x15 + 3346433.4800000009*x2 + 17039667.639999997*x4 + 12277682.16*x5 + 43423952.000000007*x6 + 12012337.08*x7 + 5803790.5256000003); x20 = x19*(0.040794133159999996*x0 + 0.040794133159999996*x11 + 1.2879160091599999*x12 + 1.247121876*x14 + 1.247121876*x15 + 1.247121876*x6); x21 = -38000000000.0*Treble + x18 + x20 + 1000000000000*x5 + 2724760000000.0; x22 = 2*x16; x23 = 2*x9; x24 = -152000000000.0*Treble - 4*x20 + 4000000000000*x5 + 10899040000000.0; x25 = K*(470000000.0*Mid + 2209000000.0*Treble + 5700000000.0*x2 + 4700000000.0*x5 + x8 + 2360998000.0); x26 = x10*(1530.3510199999998*x0 + 1301.9404199999997*x11 + 2770.0859999999998*x12 + 2770.0859999999998*x14 + 1073.5298199999997*x4 + 2770.0859999999993*x6); x27 = x17*(48597.999999999942*Mid + 456821.19999999995*Treble + 13180679.999999998*x0 + 12591300.0*x11 + 26790000.0*x14 + 589380.0*x2 + 485979.99999999994*x4 + 485979.99999999994*x5 + 26790000.0*x6 + 485979.99999999994*x7 + 228410.59999999998); x28 = x12*x19; x29 = -1000000000000.0*Treble + x27 + 1.0735298199999999*x28 + 1470000000000.0; x30 = 2*x26; x31 = 2*x25; x32 = -4000000000000.0*Treble - 4.2941192799999994*x28 + 5880000000000.0; a0 = (x16 + x21 + x9); a1 = (-x22 + x23 + x24)/a0; a2 = (-228000000000.0*Treble - 2*x18 + 6*x20 + 6000000000000*x5 + 16348560000000.0)/a0; a3 = (x22 - x23 + x24)/a0; a4 = (-x16 + x21 - x9)/a0; b0 = (x25 + x26 + x29)/a0; b1 = (-x30 + x31 + x32)/a0; b2 = (-6000000000000.0*Treble - 2*x27 + 6.4411789200000005*x28 + 8820000000000.0)/a0; b3 = (x30 - x31 + x32)/a0; b4 = (-x25 - x26 + x29)/a0; ); function initWah(K) instance( a0, a1, a2, a3, a4, a5, a6, b0, b1, b2, b3, b4, b5, b6, coeffs) local(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, Bass, Mid, Treble) global(sBass, sMid, sTreble) ( coeffs = 7; Bass = sBass; Mid = sMid; Treble = sTreble; x6 = K * K; x1 = x6 * K; x8 = x1 * K; x4 = x8 * K; x10 = x4 * K; x0 = K*(1011527664224356139008*Mid + 7530545260787261243392); x2 = (1 - Mid)*(100000*Mid + 1); x3 = x1*(194385491651800064*Mid + 12153655119655.215*x2 + 5737417270635544576); x5 = x4*(736213860207.35718*Mid + 1966981.2839713853*x2 + 133800038956.98361); x7 = x6*(54538959353917849600*Mid + 222536086129358.34*x2 + 369180463562224697344); x9 = x8*(120318885337396.5*Mid + 8751796652.518404*x2 + 3920384183569353.0); x11 = x10*(494057977.82895726*Mid + 1095.1662824298012*x2 + 19022914.496187665); x12 = x11 + x7 + x9 + 45978530192016183132160; x13 = 4*x5; x14 = 4*x0; x15 = -6*x11 + 2*x7 - 2*x9 + 275871181152097082015744; x16 = 3*x3; x17 = 5*x0; x18 = 5*x5; x19 = 15*x11 - x7 - x9 + 689677952880242772148224; x20 = x1*(-21359924127294784.0*Mid - 819227616645.3125*x2 - 343837738942162624); x21 = x4*(-106557848.43835449*Mid - 2075435.8246488329*x2 - 767492838853.37451); x22 = x6*(-3074432947283161088*Mid - 3723829875790740992); x23 = x8*(-7411003819342.0*Mid - 5706298455.6539326*x2 - 2218253037391599.8); x24 = x10*(20300.917984303087*Mid - 63.789356386653644*x2 - 11512430.503099531); x25 = x22 + x23 + x24; x26 = 4*x21; x27 = 2*x22 - 2*x23 - 6*x24; x28 = 3*x20; x29 = 5*x21; x30 = -x22 - x23 + 15*x24; a0 = (x0 + x12 + x3 + x5); a1 = (-x13 + x14 + x15)/a0; a2 = (-x16 + x17 + x18 + x19)/a0; a3 = (-20*x11 - 4*x7 + 4*x9 + 919570603840323696197632)/a0; a4 = (x16 - x17 - x18 + x19)/a0; a5 = (x13 - x14 + x15)/a0; a6 = (-x0 + x12 - x3 - x5)/a0; b0 = (x20 + x21 + x25)/a0; b1 = (-x26 + x27)/a0; b2 = (-x28 + x29 + x30)/a0; b3 = (-4*x22 + 4*x23 - 20*x24)/a0; b4 = (x28 - x29 + x30)/a0; b5 = (x26 + x27)/a0; b6 = (-x20 - x21 + x25)/a0; ); function resetStack() instance(y1, y2, y3, y4, y5, y6, y7, s1, s2, s3, s4, s5, s6) local() global() ( s1 = s2 = s3 = s4 = s5 = s6 = 0; ); function eval4(x) instance( a1, a2, a3, b0, b1, b2, b3, s1, s2, s3) local(y) global() ( y = b0 * x + s1; s1 = b1 * x - a1 * y + s2; s2 = b2 * x - a2 * y + s3; s3 = b3 * x - a3 * y; y ); function eval5(x) instance( a1, a2, a3, a4 b0, b1, b2, b3, b4 s1, s2, s3, s4) local(y) global() ( y = b0 * x + s1; s1 = b1 * x - a1 * y + s2; s2 = b2 * x - a2 * y + s3; s3 = b3 * x - a3 * y + s4; s4 = b4 * x - a4 * y; y ); function eval6(x) instance( a1, a2, a3, a4, a5 b0, b1, b2, b3, b4, b5 s1, s2, s3, s4, s5) local(y) global() ( y = b0 * x + s1; s1 = b1 * x - a1 * y + s2; s2 = b2 * x - a2 * y + s3; s3 = b3 * x - a3 * y + s4; s4 = b4 * x - a4 * y + s5; s5 = b5 * x - a5 * y; y ); function eval7(x) instance( a1, a2, a3, a4, a5, a6 b0, b1, b2, b3, b4, b5, b6 s1, s2, s3, s4, s5, s6) local(y) global() ( y = b0 * x + s1; s1 = b1 * x - a1 * y + s2; s2 = b2 * x - a2 * y + s3; s3 = b3 * x - a3 * y + s4; s4 = b4 * x - a4 * y + s5; s5 = b5 * x - a5 * y + s6; s6 = b6 * x - a6 * y; y ); function initToneStack() instance() local(Kbase, Kmod) global(ToneStack, srate, Kstar, non_legacy) ( non_legacy ? ( Kbase = 2 * srate; Kmod = Kbase; ) : ( Kbase = srate; Kmod = Kbase * Kstar; ); ( ToneStack == 0 ) ? ( this.initMarshall(Kbase) ) : ( ToneStack == 1 ) ? ( this.initFender(Kbase) ) : ( ToneStack == 2 ) ? ( this.initVox(Kmod) ) : ( ToneStack == 3 ) ? ( this.initJames(Kmod) ) : ( ToneStack == 4 ) ? ( this.initESeries(Kmod) ) : ( ToneStack == 5 ) ? ( this.initBench(Kmod) ) : ( ToneStack == 6 ) ? ( this.initBigMuff(Kmod) ) : ( ToneStack == 7 ) ? ( this.initHiwatt(Kmod) ) : ( ToneStack == 8 ) ? ( this.initCrate(Kmod) ) : ( ToneStack == 9 ) ? ( this.initDumbleRock(Kmod) ) : ( ToneStack == 10 ) ? ( this.initDumbleJazz(Kmod); ) : ( ToneStack == 11 ) ? ( this.initAria(Kmod) ) : ( ToneStack == 12 ) ? ( this.initBoneRay(Kmod); ) : ( ToneStack == 13 ) ? ( this.initWah(Kmod); ); ); function evalToneStack(s) instance(coeffs) local() global(ToneStack) ( ( coeffs == 4 ) ? ( this.eval4(s) ) : ( coeffs == 5 ) ? ( this.eval5(s) ) : ( coeffs == 6 ) ? ( this.eval6(s) ) : ( coeffs == 7 ) ? ( this.eval7(s) ); ); function initWindow(windowtype) global(fftSize) instance(recPtr, window, rStart, rEnd, fftLoc) local(i, pwr, dwindowpos, windowpos) ( windowpos = 0; dwindowpos = $pi*2/fftSize; i = 0; pwr = 0; loop(fftSize*.5+1, pwr += (window[i] = ( windowtype==1 ? ( 0.53836 - cos(windowpos)*0.46164 ) : windowtype==2 ? ( 0.35875 - 0.48829 * cos(windowpos) + 0.14128 * cos(2*windowpos) - 0.01168 * cos(3*windowpos) ) : windowtype==3 ? ( 0.42 - 0.50 * cos(windowpos) + 0.08 * cos(2.0*windowpos) ) : windowtype==4 ? ( 1.0 ) : ( .21557895 - 0.41663158 * cos(windowpos) + 0.277263158 * cos(2*windowpos) - 0.083578947 * cos(3*windowpos) + 0.006947368 * cos(4*windowpos) ) ) ); i+=1; windowpos+=dwindowpos; ); pwr=.5/(pwr*2-window[i-1]); loop(fftsize*.5+1,window[i-=1]*=pwr); ); function initSpectrum(memoryOffset) global(fftSize, srate, newUI) instance(recPtr, window, rStart, rEnd, fftLoc, hzoffset, thisUI, slope) local() ( slope = 3; hzoffset = 20*fftSize/srate; window = memoryOffset + fftSize + (fftSize*0.5 - 1); // Start and end of the buffer rStart = memoryOffset; rEnd = window; fftLoc = window + (fftSize*0.5 + 1); // fftw recPtr = rStart; thisUI = newUI+=1; this.initWindow(3) ); function drawLine(x1, y1, x2, y2) local(dx, dy, x, smooth) global(gfx_x, gfx_y) instance() ( smooth = 1; x1 = floor(x1); x2 = floor(x2); gfx_x=x1; gfx_y=y1; x2 = floor(x2); y2 = floor(y2); smooth ? ( (x2 - x1) > 4 ? ( dx = 1.0/(x2-x1); dy = (y2 - y1)*6*dx; x = 0; loop(x2-x1, x2 = x1 + 1; y2 = y1 + dy * ( x - x*x ); gfx_line(x1, y1-1, x2, y2-1, 1); gfx_lineto(x2,y2,1); x1 = x2; y1 = y2; x = x + dx; ); ) : ( gfx_line(x1, y1-1, x2, y2-1, 1); gfx_lineto(x2,y2,1); ); ) : ( gfx_line(x1, y1-1, x2, y2-1, 1); gfx_lineto(x2,y2,1); ); ); function calcFFT() global(fftSize) instance(recPtr, window, rStart, rEnd, fftLoc, slope, yshift) local(buf1, buf2, buf3, yOut, i, prec, ty, sc) ( buf1=recPtr-fftSize; buf1= rEnd ? buf1 -= (rEnd-rStart); ); buf2-=1; loop(fftSize*.5 - 1, buf3[] = buf1[]*(buf2-=1)[]; buf3+=1; (buf1+=1) >= rEnd ? buf1 -= (rEnd-rStart); ); fft_real(fftLoc,fftSize); fft_permute(fftLoc,fftSize/2); buf3 = fftLoc; yOut = fftLoc; i = 0; slope = .5*log(2)*slope; yshift = slope*log(1.0+.5*fftSize); prec = (10^(-500/20*2)); sc = 10/log(10); // TO DO: Also include in Filther and others loop(fftSize*0.5, ty = sqr(buf3[0])+sqr(buf3[1]); ty = sc*log(max(ty,prec));//+78; ty = ty + slope*log(1.0+i) - yshift; yOut[] = ty; yOut += 1; buf3 += 2; i += 1; ); ); function drawGrid() global( fftSize, srate, gfx_x, gfx_y ) instance(x, y, w, h, recPtr, window, rStart, rEnd, fftLoc, floorLevel, hzoffset ) local(xx, i, wsc, N, xl) ( i = 0; gfx_set( .2, .2, .2, .2 ); gfx_line(x, y, x+w, y); gfx_line(x, y+h, x+w, y+h); gfx_line(x, y, x, y+h); gfx_line(x+w, y, x+w, y+h); i = 0; wsc = w/log(1+fftSize*0.5-hzoffset); xl = x; gfx_y = y+h+2; gfx_setfont(1); loop(16, xx = x + log(1+i*fftSize/srate-hzoffset)*wsc; gfx_set( .4, .0, .4, .5 ); gfx_line(xx, y, xx, y+h); ( (xx - xl) > 30 && (xx > 0) ) ? ( gfx_set( 1, 1, 1, 1 ); gfx_x = xx+2; gfx_line(xx, y+h, xx, y+h+7); (i>999) ? ( gfx_printf("%dk", .001*i); ) : ( gfx_printf("%d", i); ); xl = xx; ); ( i < 100 ) ? (i += 20) : ( i < 1000 ) ? (i += 200) : ( i < 10000 ) ? (i += 2000) : ( i < 100000 ) ? (i += 20000); ); gfx_set( .2, .2, .2, .2 ); N = 8; xx = y; i = 0; gfx_measurestr("8", wsc, xl); loop(N, gfx_set( 1, 1, 1, 1 ); gfx_x = x+w; gfx_y = xx-.5*xl + 1; i > 0 ? gfx_printf("-%d", i*floorLevel/N); xx += h/N; gfx_set( .4, .0, .4, .5 ); gfx_line(x, xx, x+w, xx); i += 1; ); ); function drawFFT(fill, oversamplingFactor) global(fftSize, gfx_x, gfx_y, gfx_r, gfx_g, gfx_b, gfx_a, srate, gfx_mode) instance(x, y, w, h, recPtr, window, rStart, rEnd, fftLoc, floorLevel, hzoffset) local(copyval, buf, i, ixsc, txl, tx, ty, wsc, fill, tx0, lx0, lx, ly, ty2, ly2, fill_slast, fill_slmin) ( this.calcFFT(); i = 0; ixsc = 0; wsc = w/log(1+fftsize*0.5-hzoffset); fill_slmin = y; gfx_set( .4, .4, .8, .1 ); buf = fftLoc; txl = x; lx = x; ly = y + h; buf += 1; loop(fftsize*0.5, tx = floor(x + log(1.0+ixsc-hzoffset)*wsc); ( (tx != txl) && tx > x && i && ( tx < (x+w) ) ) ? // ( ty = y - max(buf[], -floorLevel)*h / floorLevel; txl = floor(tx); tx = min(tx, x+w); (fill) ? ( tx0=tx|0; lx0=lx|0; tx0>lx0 ? ( gfx_triangle(lx0,max(y+h,ly),lx0,ly,tx0-1,ty,tx0-1,max(y+h,ty)); ) : ( tx0 > fill_slast ? ( fill_slast < h ? gfx_line(fill_slast,h,fill_slast,fill_slmin); fill_slmin=h; ) : ( fill_slmin=min(fill_slmin,ty); ); ); fill_slast=tx0; ); gfx_set( 1, 0.2, 0.8, .4 ); drawLine(lx, ly, tx, ty); lx=tx; ly=ty; ly2=ty2; ); buf+=1; i+=1; ixsc+=oversamplingFactor; ); ); function impulse() global(fftSize) instance(recPtr, window, rStart, rEnd, fftLoc, last) local() ( recPtr = rStart; memset(recPtr, 0, fftSize); recPtr[] = 1; ); function feedSample(sample) global(fftSize) instance(recPtr, window, rStart, rEnd, fftLoc) local() ( recPtr[] = sample; recPtr = (recPtr+1) >= rEnd ? rStart : recPtr + 1; ); function setToFFTLoc() global(fftSize) instance(recPtr, rStart) local() ( recPtr = rStart + fftSize; ); gfxFilter.initSpectrum(impulseLoc); gfxFilter.initWindow(4); function estimateGain(impulseLocGain) local(ptr) global(test, gainEst, compensateGain, ToneStack) instance() ( /* Detect max gain */ compensateGain ? ( this.initToneStack(); this.resetStack(); ptr = impulseLocGain; ptr[] = this.evalToneStack(1); ptr += 1; loop(2048, ptr[] = this.evalToneStack(0); ptr += 1; ); fft_real(impulseLocGain,2048); fft_permute(impulseLocGain,2048/2); ptr = impulseLocGain+2; gainEst = 0; ( compensateGain == 1 ) ? ( loop(2048, gainEst = max(gainEst, sqr(ptr[])+sqr(ptr[1]) ); ptr += 2; ); gainEst = sqrt(gainEst) ) : ( loop(2048, gainEst = gainEst + sqr(ptr[])+sqr(ptr[1]); ptr += 2; ); gainEst = sqrt(2)*sqrt(gainEst / 2048) ); ); ); init = 0; @slider @block @sample !init ? ( maxGain = dummy.estimateGain(impulseLocGainEs); gainComp = 2/maxGain; sBass = slider_Bass; sMid = slider_Mid; sTreble = slider_Treble; init = 1; ); csample += 1; gainV = (compensateGain > 0) ? .95*gainV + .05*gainComp : 1; ( ToneStack != currentModel ) ? ( currentModel = ToneStack; force_reinit = 1; L.initToneStack(); R.initToneStack(); L.resetStack(); R.resetStack(); ); // Really basic smoothing dBass = (slider_Bass - sBass); dMid = (slider_Mid - sMid); dTreble = (slider_Treble - sTreble); sBass = sBass + 0.01 * dBass; sMid = sMid + 0.01 * dMid; sTreble = sTreble + 0.01 * dTreble; /* Don't pay cost if we aren't moving the sliders */ (abs(dBass) + abs(dMid) + abs(dTreble) + force_reinit) > 0.0000001 ? ( (cSample % 10) == 0 ? ( L.initToneStack(); R.initToneStack(); force_reinit = 0; reestimate_gain = 1; ); ); reestimate_gain ? ( (cSample % 512) == 0 ? ( maxGain = dummy.estimateGain(impulseLocGainEs); gainComp = 2/maxGain; reestimate_gain = 0; ); ); spl0 = gainV*L.evalToneStack(spl0); spl1 = gainV*R.evalToneStack(spl1); @gfx 600 600 gfxFilter.initToneStack(); gfxFilter.resetStack(); gfxFilter.x = -40; gfxFilter.y = 0; gfxFilter.w = gfx_w + 40 - 30; gfxFilter.h = .95*gfx_h; gfxFilter.slope = 0; gfxFilter.floorLevel = 46; gfxFilter.impulse(); gfxFilter.feedSample(gfxFilter.evalToneStack(fftSize)); loop(fftSize-1, gfxFilter.feedSample(gfxFilter.evalToneStack(0)); ); x = 0; y = 0; w = gfx_w; h = gfx_h; gfx_gradrect(x, y, gfxFilter.w-40, gfxFilter.h, 0, 0, 0, .3, .0001, .0001, .0006, .0001, -.0001, -.0001, .0001, .00005); gfx_gradrect(x, y, gfxFilter.w-40, gfxFilter.h, 0, .3, .2, 1, 0.001, 0, 0, .001, -.001, .001, .001, .00001); gfxFilter.setToFFTLoc(); gfxFilter.drawGrid(); gfxFilter.drawFFT(2, max(1, slider54));