Swapbins( index1, index2 ), Getbin( index ), Setbin( index, re, im ) – Expert Sleepers Spectral Conquest v1.0.0 User Manual

Page 18: Getbinmagnitudesqr( index ), Zerobin( index ), Built-in scripts

Advertising
background image

swapBins( index1, index2 )

Swaps the values of bin ‘index1’ with bin ‘index2’.

getBin( index )

Returns the value of bin ‘index’. The bin values are complex numbers, represented by a
pair of values. E.g.

local re, im = getBin( i )

setBin( index, re, im )

Sets the value of bin ‘index’ to the complex number represented by the pair of values ‘re’
and ‘im’.

getBinMagnitudeSqr( index )

Returns the square of the magnitude of bin ‘index’.

zeroBin( index )

Sets the value of bin ‘index’ to zero.

Built-in Scripts

The full text of the plug-in’s built-in scripts is included below for reference.

-- define spectral scripts

local function scriptedShift( state )

local shift = state.param1

local maxBin = state.maxBin

local copyBin = copyBin

local zeroBin = zeroBin

if shift > 0 then

for i=maxBin,shift,-1 do

copyBin( i-shift, i )

end

for i=shift-1,0,-1 do

zeroBin( i )

end

elseif shift < 0 then

for i=0,maxBin+shift,1 do

copyBin( i-shift, i )

end

for i=maxBin+shift+1,maxBin,1 do

zeroBin( i )

end

end

end

local function scriptedReverse( state )

local maxBin = state.maxBin

Advertising