This function can be used to modify the volume of active voices during their entire life time. So you may for example implement very sophisticated volume envelopes by script by using this function. You need to pass the note ID of the voices you want to alter. This function will change the volume of all active voices associated with the requested note. So if you are using a layered instrument patch, then it will change the volume of all layers.
Internally the sampler always fades the volume from its current value to
the new volume as requested, however that volume fade by default is so fast
that it sounds like its value jumps directly from its old to the new value,
it is yet slow enough though to avoid undesired click sounds. You may also
override that automated fade time explicitly by calling
change_vol_time() before calling the
The volume changes set by calling this function are always applied relatively to
the volume calculated by the synthesis model and sampler format. That means
the various sources of volume factors like MIDI CC #7, Amplitute Envelopes,
Amplitutude LFOs and other volume factors that may be defined by the
instrument patch, are always processed and calculated for the voices first,
and the final volume applied is always a relative combination of all those
factors and the one set with this function call. This does also not change
when you pass
1 for argument
Or in other words: you cannot replace the volume set by other synthesis
sources with this function.
play_note()instead of using the sampler format's internal support for release trigger samples.
change_vol(note, volume, [relative])
|Argument Name||Data Type||Description|
||Note ID Number or Note ID Array||All voices of this note will be modified.
||Integer Number||Volume change in Milli dB.
A positive value increases the volume,
a negative value decreases the volume.
||Integer Number||Whether change_vol() calls should be relative to each other.
This functions optionally accepts
B (for "Bel") as standard unit
and finalness for its argument
Since LinuxSampler 2.0.0.svn11.
relative is only
optional with NKSP. If you want to keep compatibility with KSP, then you
should always pass a value for that third argument of this function.