// title: Twin Peak Filters // author: eli.rosenkim // description: // Ndefs inspired by rob hordijk's twin peak filters, which can accomplish some formant-y fun // code: ///////////////////////////////////////////////////////////////////////// //This patch contains some rough emulations of Rob Hordijk's Twin Peak Filter //I'm new so my style/syntax maybe sucks major balls. // /\ /\ ----\ / o | | D _ / | / /\ /\ // / \/ \ | \/\/ | |\| | |= /-| | \ / \/ \ ///////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////// //convenience test signals for injecting into the filters //////////////////////////////////////////////////// Ndef(\sawLFO, {arg lfofreq = 0.1; LFSaw.kr(lfofreq).linlin(-1, 1, 0.1, 4); }) ( Ndef(\testTones, { arg dustMul=0, dustDensity=5, noiseMul=0, pulseMul=0, pulseFreq=100, sawMul=0, sawFreq=100; var dust, noise, pulse, saw; dust = Dust.ar(dustDensity, dustMul); noise = WhiteNoise.ar(noiseMul); pulse = Pulse.ar(pulseFreq, mul: pulseMul); saw = Saw.ar(sawFreq, sawMul); (dust + noise + pulse + saw)!2; }); Spec.add(\dustMul, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\dustDense, ControlSpec(0, 1000, \lin, 0, 5)); Spec.add(\noiseMul, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\pulseMul, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\pulseFreq, ControlSpec(0, 10000, \lin, 0, 100)); Spec.add(\sawMul, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\sawFreq, ControlSpec(0, 10000, \lin, 0, 100)); Ndef(\testTones).gui; //don't "play" the Ndef, it breaks it for some reason, do "pause/resume" instead ) Ndef(\testTones).gui; //mapping examples Ndef(\VadimTwinPeak) <<>.inA Ndef(\testTones); //maps test tones to in1 Ndef(\VadimTwinPeak) <<>.inB nil; //unmaps Ndef(\VadimTwinPeak) <<>.freqMul (Ndef(\testTones)); Ndef(\VadimTwinPeak) <<>.freqMul (Ndef(\sawLFO)); Ndef(\VadimTwinPeak) <<>.freqMul nil; //unmaps Ndef(\VadimTwinPeak) <<>.curveA (Ndef(\testTones)); Ndef(\VadimTwinPeak) <<>.curveA nil; //unmaps Ndef(\VadimTwinPeak) <<>.freqAdd (Ndef(\testTones)); Ndef(\VadimTwinPeak) <<>.freqAdd nil; ////////////////////////////////////////////////////////////////////////////////////// //I made a bunch of different versions using different filter UGens to see what sounds best //Faves 4 Pinging: SVF, BLowPass, BLowPass4 (for bass), VADiode(sharp) //Faves 4 Other: VadimFilter, VADiode, VALadder, BMoog ////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// //using VadimFilter, no q control and is 12dB/oct as opposed to 18dB in the original, buttery but pings r bad /////////////////////////////////////////////////////////////////////////////////////////////////// ( Ndef(\VadimTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, resA, resB, resMul, resAdd, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve resA = \resA.ar(val:0, lag:0);//cv for A resonance resB = \resB.ar(val:0, lag:0);//cv for B resonance resMul = \resMul.ar(val:1, lag:0);//cv for resonance multiplier resAdd = \resAdd.ar(val:0, lag:0);//cv for resonance addition filterA = VadimFilter.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((resA*resMul)+resAdd).clip(0, 1) //resonance , 0); //filter type, 0 is LPF2, 1 is LPF4 filterB = VadimFilter.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((resB*resMul)+resAdd).clip(0, 1) , 0); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\resA, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resB, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\resAdd, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\VadimTwinPeak).gui; ) Ndef(\VadimTwinPeak).gui; ///////////////////////////////////////////////////////////////// //Using BLowPass, rq control, still 12db/oct //modulation needs a lot of lag to not click, better pings ///////////////////////////////////////////////////////////////// ( Ndef(\BLPTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, rqA, rqB, rqMul, rqAdd, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve rqA = \rqA.ar(val:0, lag:0);//cv for A reciprocal q rqB = \rqB.ar(val:0, lag:0);//cv for B reciprocal q rqMul = \rqMul.ar(val:1, lag:0);//cv for reciprocal q multiplier rqAdd = \rqAdd.ar(val:0, lag:0);//cv for reciprocal q addition filterA = BLowPass.ar( (inA+(curveB * inB)).clip(-1, 1), ((freqA*freqMul)+freqAdd).clip(1, 20000), ((rqA*rqMul)+rqAdd).clip(0, 1), 1); filterB = BLowPass.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((rqB*rqMul)+rqAdd).clip(0, 1), 1); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\rqA, ControlSpec(0.01, 3, \exp, 0, 1)); Spec.add(\rqB, ControlSpec(0.01, 3, \exp, 0, 1)); Spec.add(\rqMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\rqAdd, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\BLPTwinPeak).gui; ) Ndef(\BLPTwinPeak).gui; Ndef(\BLPTwinPeak) <<>.inA Ndef(\testTones); Ndef(\BLPTwinPeak) <<>.freqMul Ndef(\testTones); ////////////////////////////////////////////////////////////////////////////////////////// //Using BLowPass4, rq control, 24db/oct, same FM issue as above, but sounds really cool as drums //also bass thumps hard! ////////////////////////////////////////////////////////////////////////////////////////// ( Ndef(\BLP4TwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, rqA, rqB, rqMul, rqAdd, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve rqA = \rqA.ar(val:0, lag:0);//cv for A reciprocal q rqB = \rqB.ar(val:0, lag:0);//cv for B reciprocal q rqMul = \rqMul.ar(val:1, lag:0);//cv for reciprocal q multiplier rqAdd = \rqAdd.ar(val:0, lag:0);//cv for reciprocal q addition filterA = BLowPass4.ar( (inA+(curveB * inB)).clip(-1, 1), ((freqA*freqMul)+freqAdd).clip(1, 20000), ((rqA*rqMul)+rqAdd).clip(0, 1), 1); filterB = BLowPass4.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((rqB*rqMul)+rqAdd).clip(0, 1), 1); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\rqA, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\rqB, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\rqMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\rqAdd, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\BLP4TwinPeak).gui; ) s.makeWindow; Ndef(\BLP4TwinPeak).gui; Ndef(\BLP4TwinPeak) <<>.inA Ndef(\testTones); Ndef(\BLP4TwinPeak) <<>.freqMul Ndef(\testTones); ////////////////////////////////////// //Using BMoog, q, 24/db/oct, saturation //weird, self-oscillates ////////////////////////////////////// ( Ndef(\BMoogTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, qA, qB, qMul, qAdd, filterA, filterB, sat, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve qA = \qA.ar(val:0, lag:0);//cv for A q qB = \qB.ar(val:0, lag:0);//cv for B q qMul = \qMul.ar(val:1, lag:0);//cv for q multiplier qAdd = \qAdd.ar(val:0, lag:0);//cv for q addition sat = \sat.ar(val:0.95, lag:0);//cv for saturation filterA = BMoog.ar( (inA+(curveB * inB)).clip(-1, 1), ((freqA*freqMul)+freqAdd).clip(1, 20000), ((qA*qMul)+qAdd).clip(0, 2), 0, 0, sat ); filterB = BMoog.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((qB*qMul)+qAdd).clip(0, 2), 0, 0, sat ); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\qA, ControlSpec(0, 2, \lin, 0, 1)); Spec.add(\qB, ControlSpec(0, 2, \lin, 0, 1)); Spec.add(\qMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\qAdd, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\sat, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\BMoogTwinPeak).gui; ) s.makeWindow; Ndef(\BMoogTwinPeak).gui; Ndef(\testTones).gui; Ndef(\BMoogTwinPeak) <<>.inA Ndef(\testTones); Ndef(\BMoogTwinPeak) <<>.freqMul Ndef(\testTones); Ndef(\BMoogTwinPeak) <<>.freqMul nil; /////////////////////////////////////////////////////// //RLPFD TB303 emulation, slope n/a, distortion, resonance //ehhh, maybe useful for more vowely acid sounds? /////////////////////////////////////////////////////// ( Ndef(\RLPFDTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, resA, resB, resMul, resAdd, filterA, filterB, sig, dist; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve resA = \resA.ar(val:0, lag:0);//cv for A resonance resB = \resB.ar(val:0, lag:0);//cv for B resonance resMul = \resMul.ar(val:1, lag:0);//cv for resonance multiplier resAdd = \resAdd.ar(val:0, lag:0);//cv for resonance addition dist = \dist.ar(val:0, lag:0);//cv for distortion filterA = RLPFD.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((resA*resMul)+resAdd).clip(0, 1) //resonance , dist.clip(0,1)); //distortion(0-1) filterB = RLPFD.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((resB*resMul)+resAdd).clip(0, 1) , dist.clip(0,1)); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\resA, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resB, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\resAdd, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\dist, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\RLPFDTwinPeak).gui; ) Ndef(\RLPFDTwinPeak).gui; Ndef(\RLPFDTwinPeak) <<>.inA Ndef(\testTones); ///////////////////////////////////// //SVF, "total, 100% plastic", resonance //OH YEAH THATS NICE PINGS //OH YEAH ///////////////////////////////////// ( Ndef(\SVFTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, resA, resB, resMul, resAdd, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve resA = \resA.ar(val:0, lag:0);//cv for A resonance resB = \resB.ar(val:0, lag:0);//cv for B resonance resMul = \resMul.ar(val:1, lag:0);//cv for resonance multiplier resAdd = \resAdd.ar(val:0, lag:0);//cv for resonance addition filterA = SVF.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((resA*resMul)+resAdd).clip(0, 1) //resonance ); filterB = SVF.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((resB*resMul)+resAdd).clip(0, 1) ); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\resA, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resB, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\resAdd, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\SVFTwinPeak).gui; ) Ndef(\SVFTwinPeak).gui; Ndef(\SVFTwinPeak) <<>.inA Ndef(\testTones); Ndef(\SVFTwinPeak) <<>.freqMul Ndef(\testTones); Ndef(\SVFTwinPeak) <<>.freqMul nil; Ndef(\SVFTwinPeak) <<>.inB Ndef(\SVFTwinPeak); Ndef(\SVFTwinPeak) <<>.inB nil; Ndef(\SVFTwinPeak) <<>.freqMul Ndef(\SVFTwinPeak); /////////////////////////////////////////////////////////////////// //DFM1, in example file resonance >1, need to investigate max res values //eh? semi-cool with audio in, high res /////////////////////////////////////////////////////////////////// ( Ndef(\DFM1TwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, resA, resB, resMul, resAdd, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve resA = \resA.ar(val:0, lag:0);//cv for A resonance resB = \resB.ar(val:0, lag:0);//cv for B resonance resMul = \resMul.ar(val:1, lag:0);//cv for resonance multiplier resAdd = \resAdd.ar(val:0, lag:0);//cv for resonance addition filterA = DFM1.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((resA*resMul)+resAdd).clip(0, 2) //resonance ); filterB = DFM1.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((resB*resMul)+resAdd).clip(0, 2) ); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\resA, ControlSpec(0.01, 2, \exp, 0, 1)); Spec.add(\resB, ControlSpec(0.01, 2, \exp, 0, 1)); Spec.add(\resMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\resAdd, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\DFM1TwinPeak).gui; ) Ndef(\DFM1TwinPeak).gui; Ndef(\DFM1TwinPeak) <<>.inA Ndef(\testTones); ///////////////////////////////// //VA1Pole //not very interesting, doesn't ping ///////////////////////////////// ( Ndef(\VA1PoleTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, fbA, fbB, fbMul, fbAdd, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve fbA = \fbA.ar(val:0, lag:0);//cv for A resonance fbB = \fbB.ar(val:0, lag:0);//cv for B resonance fbMul = \fbMul.ar(val:1, lag:0);//cv for resonance multiplier fbAdd = \fbAdd.ar(val:0, lag:0);//cv for resonance addition filterA = VA1Pole.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((fbA*fbMul)+fbAdd).clip(-1, 5) //feedback ); filterB = VA1Pole.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((fbB*fbMul)+fbAdd).clip(-1, 5) ); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\fbA, ControlSpec(-1, 5, \lin, 0, 1)); Spec.add(\fbB, ControlSpec(-1, 5, \lin, 0, 1)); Spec.add(\fbMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\fbAdd, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\VA1PoleTwinPeak).gui; ) Ndef(\VA1PoleTwinPeak).gui; Ndef(\VA1PoleTwinPeak) <<>.inA Ndef(\testTones); ////////////////////////////////////////////////////////// //VADiode, res, overdrive //sharp and lean pings, interesting timbre, kind of benjoliny??? ////////////////////////////////////////////////////////// ( Ndef(\VADiodeTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, resA, resB, resMul, resAdd, od, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve resA = \resA.ar(val:0, lag:0);//cv for A resonance resB = \resB.ar(val:0, lag:0);//cv for B resonance resMul = \resMul.ar(val:1, lag:0);//cv for resonance multiplier resAdd = \resAdd.ar(val:0, lag:0);//cv for resonance addition od = \od.ar(val:0, lag:0);//cv for overdrive filterA = VADiodeFilter.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((resA*resMul)+resAdd).clip(0, 1), //resonance od);//overdrive filterB = VADiodeFilter.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((resB*resMul)+resAdd).clip(0, 1), od); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\resA, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resB, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\resAdd, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\od, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\VADiodeTwinPeak).gui; ) Ndef(\VADiodeTwinPeak).gui; Ndef(\VADiodeTwinPeak) <<>.inA Ndef(\testTones); ///////////////////////////////////////// //VAKorg35, res, overdrive //ping bad, interesting at low freq high res //////////////////////////////////////// ( Ndef(\VAKorg35TwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, resA, resB, resMul, resAdd, od, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve resA = \resA.ar(val:0, lag:0);//cv for A resonance resB = \resB.ar(val:0, lag:0);//cv for B resonance resMul = \resMul.ar(val:1, lag:0);//cv for resonance multiplier resAdd = \resAdd.ar(val:0, lag:0);//cv for resonance addition od = \od.ar(val:0, lag:0);//cv for overdrive filterA = VAKorg35.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((resA*resMul)+resAdd).clip(0, 1), //resonance od);//overdrive filterB = VAKorg35.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((resB*resMul)+resAdd).clip(0, 1), od); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\resA, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resB, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\resAdd, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\od, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\VAKorg35TwinPeak).gui; ) Ndef(\VAKorg35TwinPeak).gui; Ndef(\VAKorg35TwinPeak) <<>.inA Ndef(\testTones); ////////////////////////// //VALadder, res, overdrive //glassy, meh sharp pings //VERY interesting cascading //tones when res is 1 and //freq is low ////////////////////////// ( Ndef(\VALadderTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, resA, resB, resMul, resAdd, od, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve resA = \resA.ar(val:0, lag:0);//cv for A resonance resB = \resB.ar(val:0, lag:0);//cv for B resonance resMul = \resMul.ar(val:1, lag:0);//cv for resonance multiplier resAdd = \resAdd.ar(val:0, lag:0);//cv for resonance addition od = \od.ar(val:0, lag:0);//cv for overdrive filterA = VALadder.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((resA*resMul)+resAdd).clip(0, 1), //resonance od);//overdrive filterB = VALadder.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((resB*resMul)+resAdd).clip(0, 1), od); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\resA, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resB, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\resAdd, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\od, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\VALadderTwinPeak).gui; ) Ndef(\VALadderTwinPeak).gui; Ndef(\VALadderTwinPeak) <<>.inA Ndef(\testTones); /////////////////////// //VASEM12, res //similar to above, harsh /////////////////////// ( Ndef(\VASEM12TwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, resA, resB, resMul, resAdd, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve resA = \resA.ar(val:0, lag:0);//cv for A resonance resB = \resB.ar(val:0, lag:0);//cv for B resonance resMul = \resMul.ar(val:1, lag:0);//cv for resonance multiplier resAdd = \resAdd.ar(val:0, lag:0);//cv for resonance addition filterA = VALadder.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((resA*resMul)+resAdd).clip(0, 1), //resonance ); filterB = VALadder.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((resB*resMul)+resAdd).clip(0, 1), ); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\resA, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resB, ControlSpec(0.01, 1, \exp, 0, 1)); Spec.add(\resMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\resAdd, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\VASEM12TwinPeak).gui; ) Ndef(\VASEM12TwinPeak).gui; Ndef(\VASEM12TwinPeak) <<>.inA Ndef(\testTones); /////////////////////////////////////// //Ringz, decay time, optimized for pinging //actually bad and pinging //LOL /////////////////////////////////////// ( Ndef(\RingzTwinPeak, { var inA, inB, freqA, freqB, freqMul, freqAdd, curveA, curveB, decayA, decayB, decayMul, decayAdd, filterA, filterB, sig; inA = \inA.ar(val:0, lag:0)!2; //input for channel A inB = \inB.ar(val:0, lag:0)!2; //input for channel B freqA = \freqA.ar(val:500, lag:0);//cv for A freq freqB = \freqB.ar(val:500, lag:0);//cv for B freq freqMul = \freqMul.ar(val:1, lag:0);//cv for frequency multiplier freqAdd = \freqAdd.ar(val:0, lag:0);//cv for frequency addition curveA = \curveA.ar(val:0, lag:0);//cv for A curve curveB = \curveB.ar(val:0, lag:0);//cv for B curve decayA = \decayA.ar(val:0, lag:0);//cv for A resonance decayB = \decayB.ar(val:0, lag:0);//cv for B resonance decayMul = \decayMul.ar(val:1, lag:0);//cv for resonance multiplier decayAdd = \decayAdd.ar(val:0, lag:0);//cv for resonance addition filterA = DFM1.ar( (inA+(curveB * inB)).clip(-1, 1), //input ((freqA*freqMul)+freqAdd).clip(1, 20000), //freq ((decayA*decayMul)+decayAdd).clip(0, 10) //resonance ); filterB = DFM1.ar( (-1)*((inB+(curveA * inA)).clip(-1,1)), ((freqB*freqMul)+freqAdd).clip(1, 20000), ((decayB*decayMul)+decayAdd).clip(0, 10) ); sig = Limiter.ar((filterA+filterB)/2); }); Spec.add(\freqA, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqB, ControlSpec(1, 18000, \exp, 0, 1)); Spec.add(\freqMul, ControlSpec(0, 4, \lin, 0, 1)); Spec.add(\freqAdd, ControlSpec(-10000, 10000, \lin, 0, 0)); Spec.add(\curveA, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\curveB, ControlSpec(0, 1, \lin, 0, 0)); Spec.add(\decayA, ControlSpec(0, 5, \lin, 0, 1)); Spec.add(\decayB, ControlSpec(0, 5, \lin, 0, 1)); Spec.add(\decayMul, ControlSpec(0, 1, \lin, 0, 1)); Spec.add(\decayAdd, ControlSpec(0, 1, \lin, 0, 0)); Ndef(\RingzTwinPeak).gui; ) Ndef(\RingzTwinPeak).gui; Ndef(\RingzTwinPeak) <<>.inA Ndef(\testTones);