User-Defined Opcode Database

linearPointer

Pointer to read a function table linearly, forwards or backwards.

Download UDO File

Description

Pointer to read a function table linearly, forwards or backwards. Output is in samples.

Syntax

linearPointer kspeed, kbeg, kend, ifn, [imode]

Initialization

ifn -- function table to point at
imode [optional] -- if -1 reads backwards. all other values, reads forwards

Performance

kspeed -- 1=no change, 2=double speed, .5=half speed
kbeg/kend -- values 0-1. example: kbeg=.1, kend = .8 loops between .1 and .8 * tablelength.

Code

	opcode linearPointer, k, kkkip
kspeed, kbeg, kend, ifn, imode xin
kend limit kend, kbeg + .001, 1
kbeg limit kbeg, 0, kend
isamps = ftlen(ifn)
ilength = (isamps/sr)
kcps = kspeed/ilength
kpoint phasor kcps
kpoint = (imode == -1?kpoint * -1 + 1:kpoint)
kpoint = (kpoint * (kend-kbeg)) * isamps + kbeg * isamps
xout kpoint
	endop

Examples

see stereoGrain

Credits

bhob rainey


Previous Home Next
stereoGrain   boomerangPointer