VOCODE2

channel-vocoder; right channel analyzed, left channel filtered (in package insts.jg)

VOCODE2 Performs a filter-bank analysis of the right input channel (the modulator), and uses the time-varying energy measured in the filter bands to control a corresponding filter bank that processes the left input channel (the carrier). The two filter banks have identical characteristics, but there is a way to shift all of the center frequencies of the carrier's bank.

This approach is to left/right channel processing is similar to the amplitude-envelope following instrument FOLLOWER. This instrument is similar in some respects to PVOC, but it is a channel vocoder using a bank of band-pass filters instead of an FFT analysis (like with phase vocoders). This kind of instrument was originally designed for cross-synthesis work -- see also VOCODE and VOCODESYNTH.


p-fields:

/* VOCODE2 - channel vocoder

   p0  = output start time
   p1  = input start time (must be 0 for aux bus)
   p2  = duration
   p3  = amplitude multiplier (post-processing)
   p4  = number of filters (greater than 0)
   p5  = lowest filter center frequency (in Hz or oct.pc)
   p6  = center frequency spacing multiplier (greater than 1)
         (multiplies each cf by this to get next higher cf)
   p7  = amount to transpose carrier filters (in Hz or oct.pc)
   p8  = filter bandwidth proportion of center frequency (greater than 0)
   p9  = filter response time (seconds)  [optional; default is 0.01]
         Determines how often changes in modulator power are measured.
   p10 = amount of high-passed modulator signal to mix with output
         (amplitude multiplier)  [optional; default is 0]
   p11 = cutoff frequency for high pass filter applied to modulator.
         This pfield ignored if p10 is zero.  [optional, default is 5000 Hz]
   p12 = amount of noise signal to mix into carrier before processing
         (amplitude multiplier applied to full-scale noise signal)
         [optional; default is 0]
   p13 = specifies how often (in samples) to get new random values from
         the noise generator.  This pfield is ignored if p12 is zero.
         [optional; default is 1 -- a new value every sample]  
   p14 = percent to left channel  [optional, default is 0.5]

   Assumes function table 1 is an amplitude curve for the note.  (Try gen 18.)
   Or you can just call setline.  If no setline or function table 1, uses a
   flat amplitude curve.  This curve, combined with the amplitude multiplier,
   affect the signal after processing by the filter bank.

   NOTES:

     -  Currently in RTcmix it's not possible for an instrument to take
        input from both an "in" bus and an "aux in" bus at the same time.
        So if you want the modulator to come from a microphone -- which
        must enter via an "in" bus -- and the carrier to come from a
        WAVETABLE instrument via an "aux" bus, then you must route the
        mic into the MIX instrument as a way to convert it from "in" to
        "aux in".  See "VOCODE2_1.sco" for an example.

     -  The "left" input channel comes from the bus with the lower number;
        the "right" input channel from the bus with the higher number.

     -  When specifying center frequencies...
           p6 = 2.0 will make a stack of octaves
           p6 = 1.5 will make a stack of perfect (Pythagorian) fifths
        Use this to get stacks of an equal tempered interval (in oct.pc):
           p6 = cpspch(interval) / cpspch(0.0)

     - More about p13:
       When this is greater than 1 sample, successive noise samples are
       connected using linear interpolation.  This acts as a low-pass filter;
       the higher the interval, the lower the cutoff frequency.
*/
Sample scorefile:
rtsetparams(44100, 2)
load("VOCODE2")

rtinput("/snd/beckett/furniture1.aiff")

/* carrier */
bus_config("MIX", "in 0", "aux 0 out")
inskip = 0
amp = 1
dur = DUR() - inskip
MIX(0, inskip, dur, amp, 0)

/* modulator */
bus_config("MIX", "in 0", "aux 1 out")
inskip = 0
dur = DUR() - inskip
amp = 1
MIX(0, inskip, dur, amp, 0)


/* -------------------------------------------------------------------------- */
bus_config("VOCODE2", "aux 0-1 in", "out 0-1")
amp = 1.0
numfilt = 0
makegen(2, 2, numpitches = 8,
   7.00,
   7.07,
   8.02,
   8.09,
   9.04,
   9.11,
  10.06,
  11.01
)
transp = 0.07
freqmult = 2.02
cartransp = -0.02
bw = 0.008
resp = 0.00
hipass = 0.2
hpcf = 5000
noise = 0.01
noisubsamp = 5

dur = dur + 2
setline(0,1, dur-1,1, dur,0)
VOCODE2(0, 0, dur, amp, numfilt, transp, freqmult, cartransp, bw,
   resp, hipass, hpcf, noise, noisubsamp, 1)
transp = transp + 0.002
VOCODE2(0, 0, dur, amp, numfilt, transp, freqmult, cartransp, bw,
   resp, hipass, hpcf, noise, noisubsamp, 0)