Documents
Writing Docs Gigedit SFZ Instrument Scripts NKSP Language NKSP Reference

change_velo()

Changes the MIDI velocity of the requested note.

Changing the velocity with this function only succeeds if the respective note is new. That effectively means you should change the velocity before any wait() calls, and before entering any loops that may execute your script for a very long time. Because in both cases the sampler may suspend your script for a certain amount of time and once your script got resumed, the respective event and the resulting note may already have entered the sampler's regular event processing chain and thus the note's velocity can no longer be changed.

Note that the new velocity set by this function only affects the resulting new voices, it does not modify the actual MIDI event. That means the new voices behave as if the MIDI event itself was modified, that is for the new voices the instrument's synthesis parameter case and sample (i.e. if velocity splits are defined for the instrument) is selected based upon the new velocity.

However outside the scope of new voices the old MIDI note number is retained. That means all other common MIDI processing tasks of the sampler are not affected by this function at all.

Function Prototype

change_velo(event-id, velocity)

Arguments

Argument Name Data Type Description
event-id Event ID Number Event ID of the note to change.
[required]
velocity Integer Number New MIDI velocity (1 to 127).
[required]

Return Value

None.

Examples

None yet.

See also

set_event_par(), change_note()

Availability

Since LinuxSampler 2.0.0.svn49.

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