Functions
Voice

Voice Manipulation functions. More...

Functions

function changePan (voiceId, pan, relative, immediate)
 changes the pan position of a specific note event. More...
 
function changeTune (voiceId, shift, relative, immediate)
 change the tuning of specific voice in (fractionnal) semitones. More...
 
function changeVolume (voiceId, gain, relative, immediate)
 changes a voice's volume. More...
 
function changeVolumedB (voiceId, dBGain, relative, immediate)
 change the volume of specific voice in decibels. More...
 
function fade (voiceId, targetValue, duration, layer)
 starts a volume fade. More...
 
function fade2 (voiceId, startValue, targetValue, duration, layer)
 starts a volume fade. More...
 
function fadein (voiceId, duration, reset, layer)
 starts a volume fade-in for a specific voice. More...
 
function fadeout (voiceId, duration, killVoice, reset, layer)
 starts a volume fade-out. More...
 
function sendScriptModulation (id, targetValue, rampTime, voiceId)
 send a script modulation event to control a Script Modulation source. More...
 
function sendScriptModulation2 (id, startValue, targetValue, rampTime, voiceId)
 send a script modulation event to control a Script Modulation source. More...
 
function setSampleOffset (voiceId, value)
 changes a sample starting point in milliseconds. More...
 

Detailed Description

Voice Manipulation functions.

Function Documentation

function sendScriptModulation ( id  ,
targetValue  ,
rampTime  ,
voiceId   
)

send a script modulation event to control a Script Modulation source.

enables per voice script-driven piece-wise linear modulation source control.

Parameters
idthe modulation source id (can be changed on each modulation source)
targetValuethe modulation value in [0;1] if the source is unipolar or [-1;1] if the source is bipolar
rampTimethe rampTime in milliseconds (defaults to 20ms)
voiceIdthe optional voice id of the voice to be controlled. If it is not specified then the value is the same for all voices (broadcast mode).
local id = playNote(note, vel)
local sourceIndex = 0
local targetValue = 0.5
local rampTime = 100
sendScriptModulation(sourceIndex, targetValue, rampTime, id)
function sendScriptModulation2 ( id  ,
startValue  ,
targetValue  ,
rampTime  ,
voiceId   
)

send a script modulation event to control a Script Modulation source.

enables per voice script-driven piece-wise linear modulation source control.

Parameters
idthe modulation source id (can be changed on each modulation source)
startValuethe start modulation value in [0;1] if the source is unipolar or [-1;1] if the source is bipolar
targetValuethe target modulation value in [0;1] if the source is unipolar or [-1;1] if the source is bipolar
rampTimethe rampTime in milliseconds (defaults to 20ms)
voiceIdthe optional voice id of the voice to be controlled. If it is not specified then the value is the same for all voices (broadcast mode).
local id = playNote(note, vel)
local sourceIndex = 0
local startValue = 0.1
local targetValue = 0.5
local rampTime = 100
sendScriptModulation2(sourceIndex, startValue, targetValue, rampTime, id)
function changeTune ( voiceId  ,
shift  ,
relative  ,
immediate   
)

change the tuning of specific voice in (fractionnal) semitones.

Parameters
voiceIdid of the voice to be transposed
shifttransposition in semitones to be applied
relative(optional) specify if the transposition is relative to the last changeTune transposition, default to false
immediate(optional) apply transpostion without smoothing, default to false

Example:

function onNote(e)
local id = postEvent(e)
local tune = math.random(-0.5, 0.5)
changeTune(id, tune)
end
See Also
changePan, changeVolume, changeVolumedB
Examples:
Ensemble.lua, portamento.lua, quarterTone.lua, TimbreShifting.lua, and vibrato.lua.
function changePan ( voiceId  ,
pan  ,
relative  ,
immediate   
)

changes the pan position of a specific note event.

Parameters
voiceIdid of the voice to be transposed
panpanoramic position between -1 and 1
relative(optional) specify if the transposition is relative to the last changePan, default to false
immediate(optional) apply transpostion without smoothing, default to false

Panning note from left to right Example:

function onNote(e)
local id = postEvent(e)
local pan = 2*(e.note/127) - 1
changePan(id, pan)
end
See Also
changeTune, changeVolume, changeVolumedB
Examples:
Ensemble.lua, and tremolo.lua.
function changeVolume ( voiceId  ,
gain  ,
relative  ,
immediate   
)

changes a voice's volume.

N.B.: the changeVolume() gain will be applied on top of other changes made using fade()

Parameters
voiceIdid of the voice to be transposed
gainlinear gain to be applied between 0 and 1
relative(optional) specify if the transposition is relative to the last changeVolume, default to false
immediate(optional) apply transpostion without smoothing, default to false
See Also
changeTune, changePan, changeVolumedB
Examples:
Ensemble.lua, and tremolo.lua.
function changeVolumedB ( voiceId  ,
dBGain  ,
relative  ,
immediate   
)

change the volume of specific voice in decibels.

N.B.: the changeVolume() gain will be applied on top of other changes made using fade()

Parameters
voiceIdid of the voice to be transposed
dBgaingain to be applied in decibels
relative(optional) specify if the transposition is relative to the last changeVolumedB, default to false
immediate(optional) apply transpostion without smoothing, default to false

Example:

function onNote(e)
local id = postEvent(e)
local gain = ((e.velocity-1)/126) * 12 - 6
changeVolumedB(id, gain)
end
See Also
changeTune, changePan, changeVolume
function setSampleOffset ( voiceId  ,
value   
)

changes a sample starting point in milliseconds.

if the oscillator is in streaming mode then the offset will be clipped according to streaming preload preferences

Parameters
voiceIdid of the voice to apply the samplestart
valueoffset in milliseconds in the sample
Examples:
legato.lua, and portamento.lua.
function fadeout ( voiceId  ,
duration  ,
killVoice  ,
reset  ,
layer   
)

starts a volume fade-out.

N.B.: the fade volume will be applied on top of other changes made using changeVolume()

Parameters
voiceIdthe voice id to fade-out
durationthe fade-in duration ms
killVoicekill the voice at the end of the fade-out if true
resetmake the fade start at 1 instead of the current fade value (if a fade in ongoing)
layeroptional layer id
Examples:
legato.lua, and portamento.lua.
function fadein ( voiceId  ,
duration  ,
reset  ,
layer   
)

starts a volume fade-in for a specific voice.

N.B.: the fade volume will be applied on top of other changes made using changeVolume()

Parameters
voiceIdthe voice id to fade-in
durationthe fade-in duration in ms
resetmake the fade start at 0 instead of the current fade value (if a fade in ongoing)
layeroptional layer id

Example:

function onNote(e)
local id1 = playNote(e.note+12, e.velocity)
local id2 = playNote(e.note+19, e.velocity)
fadein(id1, 1000, true)
fadein(id2, 5000, true)
end
Examples:
legato.lua, and portamento.lua.
function fade ( voiceId  ,
targetValue  ,
duration  ,
layer   
)

starts a volume fade.

N.B.: the fade volume will be applied on top of other changes made using changeVolume()

Parameters
voiceIdthe voice id to fade-in
targetValuethe volume target to reach
durationthe fade duration in ms
layeroptional layer id
function fade2 ( voiceId  ,
startValue  ,
targetValue  ,
duration  ,
layer   
)

starts a volume fade.

N.B.: the fade volume will be applied on top of other changes made using changeVolume()

Parameters
voiceIdthe voice id to fade-in
startValuethe initial ramp volume
targetValuethe volume target to reach
durationthe fade duration in ms
layeroptional layer id