Is there something like a Transient-Shaper?
Any hints?
Is there something like a Transient-Shaper?
Any hints?
Here’s one way (I can’t remember where I originally saw this method - probably it was shared on the old SC mailing list).
It uses Slew.ar which according to the help file “has the effect of removing transients and higher frequencies”. You can then get the transients separately by subtracting the slewed signal from the input signal.
In this example I’ve used the sound file that comes with SC. It sounds much more effective if you try it with a drum loop or any percussive sounds.
The most suitable dividing frequency will depend on the input signal.
// read a soundfile
s.boot;
p = Platform.resourceDir +/+ "sounds/a11wlk01.wav";
b = Buffer.read(s, p);
// now play it - with no change
(
x = SynthDef(\transientshaper_test, {
arg out = 0, bufnum, divideFreq = 500, transientVol = 1, sustainVol = 1;
var inSig, slewSig, sustainSig, transientSig, mixSig;
// play soundfile
inSig = PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), loop: 1);
// use slew to remove tranients and higher freqs
slewSig = Slew.ar(inSig, divideFreq, divideFreq);
sustainSig = slewSig * sustainVol;
transientSig = (inSig - slewSig) * transientVol;
// mix signals and play in stereo
mixSig = sustainSig + transientSig;
Out.ar( out, mixSig ! 2) * 0.3;
}).play(s,[\bufnum, b]);
)
// listen to transients only
x.set(\transientVol, 1, \sustainVol, 0);
// change dividing freq
x.set(\divideFreq, 1000);
x.set(\divideFreq, 200);
x.set(\divideFreq, 500);
// remove transients
x.set(\transientVol, 0, \sustainVol, 1);
// change dividing freq
x.set(\divideFreq, 1000);
x.set(\divideFreq, 200);
x.set(\divideFreq, 500);
//back to normal
x.set(\transientVol, 1, \sustainVol, 1);
// free synth and buffer
x.free; b.free;
Best,
Paul