This is an example of how to apply a custom vibrato to a single voice.
--------------------------------------------------------------------------------
--! @example vibrato.lua
--! This is an example of how to apply a custom vibrato to a single voice.
--------------------------------------------------------------------------------
Freq =
Knob(
"Freq", 4.0, 0, 10) -- 4 Hz
Depth =
Knob(
"Depth", 0.5, 0, 1)
local step = 5 -- ms
local
id =
postEvent(e) -- duration is omitted
local phase = 0
local depth = Depth.value
local freq = Freq.value
local modulation = depth * math.sin(2 * math.pi * phase)
phase = phase + (step/1000.0) * freq
end
end