oscil
A simple oscillator without any interpolation.
oscil reads table ifn sequentially and repeatedly at a frequency xcps. The amplitude is scaled by xamp.
Syntax
Initialization
ifn -- (optional) function table number. Requires a wrap-around guard point. The table number defaults to -1 which indicates a sinewave.
iphs (optional, default=0) -- 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
kamp, xamp -- amplitude
kcps, xcps -- frequency in cycles per second.
The oscil opcode generates 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 kcps or xcps input value.
Table ifn is incrementally sampled modulo the table length and the value obtained is multiplied by amp.
If you need to change the oscillator table with a k-rate signal, you can use oscilikt.
Note
This opcode does not perform any interpolation. This can lead to unexpected behaviour or unclean signals, e.g. for small table sizes and low frequencies. As standard oscillators the usage of oscili or poscil is recommended.
Examples
Here is an example of the oscil opcode. It uses the file oscil.csd.