[linux-audio-dev] Re: detune
mlang
mlang at delysid.org
Sun Jan 15 18:55:29 UTC 2006
"Bill Schottstaedt" <bil at ccrma.Stanford.EDU> writes:
> Another method, related to the vocoder but more "real-time" oriented
> (i.e. sample-by-sample, not fft block processed) uses a bank of Hilbert
> transforms (for the pitch shift) and a bank of bandpass filters (each
> harmonic shifted individually to maintain harmonic relations) --
> see ssb-bank et al in dsp.scm in the Snd tarball (ssb refers to the
> single sideband suppressed carrier amplitude modulation generator).
> sndscm.html has examples.
And here is a minimalistic class for SuperCollider to
do this (sort of).
FreqShift : UGen {
*ar { arg input, shift, mul=1.0, add=0.0;
var sin1, sin2, cos1, cos2, constFreq, filtFreq;
constFreq = SampleRate.ir * 0.25;
filtFreq = constFreq * 0.75;
cos1 = FSinOsc.ar(constFreq, 0);
sin1 = FSinOsc.ar(constFreq, pi/2);
cos2 = SinOsc.ar(constFreq + shift, 0);
sin2 = SinOsc.ar(constFreq + shift, pi/2);
^(LPF.ar(LPF.ar(input * cos1, filtFreq), filtFreq) * cos2) +
(LPF.ar(LPF.ar(input * sin1, filtFreq), filtFreq) * sin2) *
mul + add;
}
}
--
CYa,
Mario
More information about the Linux-audio-dev
mailing list