The binit opcode takes an input containg a TRACKS pv streaming signal (as generated, for instance by partials) and converts it into a equal-bandwidth bin-frame containing amplitude and frequency pairs (PVS_AMP_FREQ), suitable for overlap-add resynthesis (such as performed by pvsynth) or further PVS streaming phase vocoder signal transformations. For each frequency bin, it will look for a suitable track signal to fill it; if not found, the bin will be empty (0 amplitude). If more than one track fits a certain bin, the one with highest amplitude will be chosen. This means that not all of the input signal is actually 'binned', the operation is lossy. However, in many situations this loss is not perceptually relevant.
Syntax
fsig=binit(fin,isize)
fsigbinitfin,isize
Performance
fsig -- output pv stream in PVS_AMP_FREQ format
fin -- input pv stream in TRACKS format
isize -- FFT size of output (N).
Examples
Here is an example of the binit opcode. It uses the file binit-modern.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;RT audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o binit.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=2instr1;ain inch 1 ; for live inputain=diskin("drumsMlp.wav",1); input signalfsi1,fsi2=pvsifd(ain,2048,512,1); ifd analysisfst=partials(fsi1,fsi2,0.003,1,3,500); partial trackingfbins=binit(fst,2048); convert it back to binsaout=pvsynth(fbins); overlap-add resynthesisouts(aout,aout)endin</CsInstruments><CsScore>i102e</CsScore></CsoundSynthesizer>
Here is an example of the binit opcode. It uses the file binit.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;RT audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o binit.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=2instr1;ain inch 1 ; for live inputaindiskin"drumsMlp.wav",1; input signalfs1,fsi2pvsifdain,2048,512,1; ifd analysisfstpartialsfs1,fsi2,.003,1,3,500; partial trackingfbinsbinitfst,2048; convert it back to binsaoutpvsynthfbins; overlap-add resynthesisoutsaout,aoutendin</CsInstruments><CsScore>i102e</CsScore></CsoundSynthesizer>
The example above shows partial tracking of an ifd-analysis signal, conversion to bin frames and overlap-add resynthesis.