change_vol_time()

This function can be used to override the internal fade time of volume changes upon calls to change_vol(). That fade time is not set globally, but rather on a per-note level. Additionally you might call change_vol_curve() to override the default fade curve shape type.

Function Prototype

change_vol_time(??note??, ??duration-us??)

Arguments

Argument Name Data Type Description
??note?? Note ID Number or Note ID Array All voices of this note will be modified.
[required]
??duration-us?? Integer Number or
Real Number
Fade time in microseconds.
[required]

Return Value

None.

Remarks

This functions optionally accepts s as standard unit for its argument ??duration-us??.

Examples

The following example demonstrates a simple, custom volume envelope generator.

on init declare const $time1US := 800000 { 0.8 seconds } declare const $time2US := 1600000 { 1.6 seconds } declare const $time3US := 3000000 { 3 seconds } end on on note { Start the note with a (immediately) decreased volume of -30 dB. } change_vol($EVENT_ID, -30000) { Fade the note's volume within 0.8s from -30 db up to its normal volume, that is to 0 dB. } change_vol_time($EVENT_ID, $time1US) change_vol($EVENT_ID, 0) { Remain in this stage with 0 dB for 1.6 seconds. } wait($time1US + $time2US) { Now fade the note's volume from 0 dB down to -12 dB within 3 seconds. } change_vol_time($EVENT_ID, $time3US) change_vol($EVENT_ID, -12000) end on

See also

change_vol(), change_vol_curve(), fade_in(), fade_out()

Availability

Since LinuxSampler 2.0.0.svn45.

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