Documents
Writing Docs Gigedit SFZ Instrument Scripts NKSP Language NKSP Reference

change_pitch_lfo_freq()

This function can be used to modify the pitch LFO frequency of active voices. Since LFOs are per voice, you need to pass the note ID(s) of the voices you want to alter. This function will change the pitch LFO frequency of all active voices associated with the requested note. So if you are using a layered instrument patch, then it will change the pitch LFO frequency of all layers.

The LFO frequency changes set by calling this function are always applied relatively to all other LFO frequency sources defined for controlling the LFO (i.e. an internal constant LFO frequency value, an associated MIDI controller defined in the instrument preset to control the LFO frequency, etc.). Or in other words: the frequency value passed to this function will not replace the overall LFO frequency, it will rather be multiplied against all other LFO frequency control sources.

There will only be audible changes with this function if the pitch LFO is actually already turned on (i.e. by enabling it in the instrument patch) and only if the LFO is not disabled by other LFO control sources. So you may for example set a certain constant internal LFO depth value with the instrument preset first, before actually making use of this function. Release Trigger Samples: In case the affected voices cause release trigger samples to be spawned later on, the LFO of those release trigger voices will not be affected by this function at all. So if you need to control the LFO of release trigger samples by script, then you might rather also trigger those release trigger samples by script with play_note() instead of using the sampler format's internal support for release trigger samples.

Function Prototype

change_pitch_lfo_freq(note, frequency)

Arguments

Argument Name Data Type Description
note Note ID Number or Note ID Array All voices of this note will be modified.
[required]
frequency Integer Number New LFO Frequency Value (abstract absolute value between 0 and 1000000).
[required]

Return Value

None.

Examples

None yet.

Availability

Since LinuxSampler 2.0.0.svn44.

This function exists only with NKSP, it is not available with KSP.

Document Updated:  2017-05-28  |  Author:  Christian Schoenebeck