
ar	oscilikt    xamp, xcps, kfn[, iphs[, istor]]
kr	oscilikt    kamp, kcps, kfn[, iphs[, istor]]
ar	osciliktp   kcps, kfn, kphs[, istor]
ar	oscilikts   xamp, xcps, kfn, async, kphs[, istor]

DESCRIPTION
-----------

oscilikt is very similar to oscili, but allows changing the table number
at k-rate. It is slightly slower than oscili (especially with high control
rate), although also more accurate as it uses a 31-bit phase accumulator,
as opposed to the 24-bit one used by oscili.
osciliktp allows phase modulation (which is actually implemented as k-rate
frequency modulation, by differentiating phase input). The disadvantage is
that there is no amplitude control, and frequency can be varied only at
the control rate. This opcode can be faster or slower than oscilikt,
depending on the control rate.
oscilikts is the same as oscilikt, except there is a sync input, that can
be used to re-initialize the oscillator to a k-rate phase value. It is
slower than oscilikt and osciliktp.

INITIALIZATION
--------------

istor (optional, defaults to 0) - skip initialization.

iphs (optional, defaults to 0) - initial phase for oscilikt, in the range
  0 to 1. Other values are wrapped to the allowed range.

PERFORMANCE
-----------

kr, ar - the output signal.

xamp, kamp - amplitude.

xcps, kcps - frequency in Hz. Zero and negative values are allowed,
  however the absolute value must be less than sr (and recommended to be
  less than sr/2).

kfn - function table number. Can be varied at control rate (useful to
  "morph" waveforms, or select from a set of band-limited tables generated
  by GEN30).

kphs - phase (k-rate). Similarly to iphs, the expected range is 0 to 1.
  In osciliktp, the absolute value of the difference of the current and
  previous value of kphs must be less than ksmps. oscilikts uses kphs
  only to set the initial phase, and when it is re-initialized with async.

async - any positive value resets the phase of oscilikts to kphs. Zero, or
  negative values have no effect.

EXAMPLES
--------

; ---- oscilikt.orc ----

sr	=  44100
ksmps	=  10
nchnls	=  1

	instr 1			; instr 1: osciliktp example

kphs	line 0, p3, 4

a1x	osciliktp 220.5, 1, 0
a1y	osciliktp 220.5, 1, -kphs
a1	=  a1x - a1y

	out a1 * 14000

	endin

	instr 2			; instr 2: oscilikts example

kfrq	expon 400, p3, 1200		; frequency envelope
kphs	line 0.1, p3, 0.9		; phase

atmp1	phasor 100			; sync 1
atmp2	phasor 150			; sync 2
async	diff 1 - (atmp1 + atmp2)

a1	oscilikts 14000, kfrq, 1, async, 0
a2	oscilikts 14000, kfrq, 1, async, -kphs

	out a1 - a2

	endin

; ---- oscilikt.sco ----

f 1 0 3 -2 1 0 -1	; sawtooth wave
i 1 0 4
i 2 5 4
e

AUTHOR
------

Istvan Varga
Aug 2002

