Re: [linux-audio-dev] Re: detune

From: mlang <mlang@email-addr-hidden>
Date: Sun Jan 15 2006 - 20:55:29 EET

"Bill Schottstaedt" <bil@email-addr-hidden> 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
Received on Mon Jan 16 00:15:07 2006

This archive was generated by hypermail 2.1.8 : Mon Jan 16 2006 - 00:15:07 EET