QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 

oscil, oscili, foscil, foscili

     kr   oscil     kamp, kcps, ifn[, iphs]
     kr   oscili    kamp, kcps, ifn[, iphs]
     ar   oscil     xamp, xcps, ifn[, iphs]
     ar   oscili    xamp, xcps, ifn[, iphs]
     ar   foscil    xamp, kcps, kcar, kmod, kndx, ifn[, iphs]
     ar   foscili   xamp, kcps, kcar, kmod, kndx, ifn[, iphs]

DESCRIPTION

Table ifn is incrementally sampled modulo the table length and the value obtained is multiplied by amp.

INITIALIZATION

ifn - function table number. Requires a wrap-around guard point.

iphs (optional) - initial phase of sampling, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped. The default value is 0.

PERFORMANCE

The oscil units output periodic control (or audio) signals consisting of the value of kamp(xamp)times the value returned from control rate (audio rate) sampling of a stored function table. The internal phase is simultaneously advanced in accordance with the cps input value. While the amplitude and frequency inputs to the K-rate oscils are scalar only, the corresponding inputs to the audio-rate oscils may each be either scalar or vector, thus permitting amplitude and frequency modulation at either sub-audio or audio frequencies.

foscil is a composite unit that effectively banks two oscils in the familiar Chowning FM setup, wherein the audio-rate output of one generator is used to modulate the frequency input of another (the "carrier"). Effective carrier frequency = kcps * kcar, and modulating frequency = kcps * kmod. For integral values of kcar and kmod, the perceived fundamental will be the minimum positive value of kcps * (kcar - n * kmod), n = 1,1,2,... The input kndx is the index of modulation (usually time-varying and ranging 0 to 4 or so) which determines the spread of acoustic energy over the partial positions given by n = 0,1,2,.., etc. ifn should point to a stored sine wave.

oscili and foscili differ from oscil and foscil respectively in that the standard procedure of using a truncated phase as a sampling index is here replaced by a process that interpolates between two successive lookups. Interpolating generators will produce a noticeably cleaner output signal, but they may take as much as twice as long to run. Adequate accuracy can also be gained without the time cost of interpolation by using large stored function tables of 2K, 4K or 8K points if the space is available.

EXAMPLE:

     k1   oscil     10, 5, 1            ; 5 cps vibrato
     a1   oscil     5000, 440 + k1, 1   ; around A440 + -10 cps

QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 
HTML Csound Manual - © Jean Piché & Peter J. Nix, 1994-97