ifn -- (optional) function table number. This defaults to -1 which indicates a sinewave.
iphs (optional, default=0) -- initial phase (normalized table index 0-1). If a negative value is given initialisation of the phase is skipped.
Performance
ares -- output signal
kamp, aamp -- the amplitude of the output signal.
kcps, acps -- the frequency of the output signal in cycles per second.
poscil (precise oscillator) is the same as oscili, but always employs floating-point table indexing, instead of integer math, like oscil and oscili (which can use either alternatively, depending on the table size). It is only a bit slower than oscili when reading power-two size tables.
The opcode poscil3 is the same as poscil, but uses cubic interpolation.
Examples
Here is an example of the poscil opcode. It uses the file poscil-modern.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac;;;realtime audio out-d;;;no display;-iadc ;;;uncomment -iadc if realtime audio input is needed too; For Non-realtime ouput leave only the line below:; -o poscil.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1seed(0)sine@global:i=ftgen(0,0,2^10,10,1)instr1dur:i=p3env_peak:i=random(0,1);where is the envelope peaksig:a=poscil(0.8,220,sine)env:a=transeg(0,dur*env_peak,6,1,dur-dur*env_peak,-6,0)left:a,right:a=pan2(sig*env,env_peak);pan according to random valueouts(left,right)endin</CsInstruments><CsScore>i105i145i185e</CsScore></CsoundSynthesizer>
Here is an example of the poscil opcode. It uses the file poscil.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac;;;realtime audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o poscil.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1seed0gisineftgen0,0,2^10,10,1instr1ipeakrandom0,1;where is the envelope peakasigposcil.8,220,gisineaenvtranseg0,p3*ipeak,6,1,p3-p3*ipeak,-6,0aL,aRpan2asig*aenv,ipeak;pan according to random valueoutsaL,aRendin</CsInstruments><CsScore>i105i145i185e</CsScore></CsoundSynthesizer>