Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Mono2eN - Ndef, slightly altered
name
code content
// patch for benjolin spatialisation, original 2012 by Callum Goddard // adapted and altered by Till Bovermann ( q = q ? (); q.inChannel = 0; q.numOutChans = 4; s.waitForBoot{ NdefMixer(s); Ndef(\for8).fadeTime = 10; Spec.add(\rotSpeed, [-10, 10]); Spec.add(\posLag, [0, 5, \exp]); Spec.add(\posLag, [0.001, 5, \exp]); Spec.add(\shifter, [0.25, 4]); Spec.add(\drive, [0, 10, 4]); ( Ndef(\for8, {|drive = 1, rotSpeed = 1, posLag = 0.1, shifter = 1| var in, pos, width, sig, sig2, sig2pan, out, chain, centroid; var freq, hasFreq, freq2, hasFreq2; var numInternalChannels = 4; in = SoundIn.ar(q.inChannel); // input width = \width.kr(4); // calculate spectral centroid (center of mass) // do some magic to scale it properly centroid = (( SpecCentroid.kr( FFT(LocalBuf(2048, 1), in) ) * 0.0005 ) - 0.3 ) * 10; // new position determined by centroid, linearly lagged pos = VarLag.ar(K2A.ar(centroid), posLag, 0) * rotSpeed; sig = PanAz.ar( numInternalChannels, in, pos, 0.5, width ); // Freezr #freq, hasFreq = Pitch.kr( in, ampThreshold: 0.09, median: 7 ); freq = freq * hasFreq * 0.01; chain = FFT({LocalBuf(2048, 1)}.dup(q.numOutChans), sig); chain = PV_MagFreeze( chain, SinOsc.ar( (freq*100).lag2(\laggin.kr(0.1), 0) ) ); sig2 = IFFT(chain); sig2pan = SplayAz.ar( numInternalChannels, sig2, center: LFSaw.ar(0.125) ); sig = PitchShift.ar(sig, 0.05, shifter, 0); (SplayAz.ar( q.numOutChans, Mix([sig, sig2pan]).scramble ) * drive).tanh; }) ); //Ndef('for8').set('shifter', 1.0, 'posLag', 0.82647347718014, 'fadeTime', 10, 'width', 2.0, 'laggin', 0.76778019328278, 'drive', 1.0, 'rotSpeed', 0.1); Ndef('for8').set('shifter', 1.0, 'posLag', 0.27577667345515, 'fadeTime', 10, 'width', 2.0, 'laggin', 1.078391331802, 'drive', 4.4666739998668, 'rotSpeed', -0.1); //Ndef('for8').set('shifter', 1.0, 'posLag', 0.021611250555475, 'fadeTime', 10, 'width', 4.0, 'laggin', 0.17982121468705, 'drive', 6.9880842593118, 'rotSpeed', 0.4); Ndef('for8').play( vol: 0.6914284026465 ); } ) Ndef(\tester, {SoundIn.ar(0)}) NdefMixer(s)
code description
The ndef version of the mono2eN system, slightly adapted - a multichannel autospatilisation musical performance tool.
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change