Documents
Writing Docs Gigedit SFZ Instrument Scripts NKSP Language NKSP Reference

change_note()

Changes the MIDI note number of the requested note.

Changing the note number with this function only succeeds if the respective note is new. That effectively means you should change the note number 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 note number can no longer be changed.

Note that the new note number 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 region, synthesis parameter case and sample is selected based upon the new note number.

However outside the scope of new voices the old MIDI note number is retained. That means for example the newly triggered voices will only be released later on if a MIDI note-off event was received equal to the old MIDI note number (not the new note number), and also other MIDI processing tasks of the sampler like exclusive groups (a.k.a. key groups), key based round robin and all other common MIDI processing tasks are not affected by this function at all.

Function Prototype

change_note(event-id, note-number)

Arguments

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

Return Value

None.

Examples

None yet.

See also

set_event_par(), change_velo()

Availability

Since LinuxSampler 2.0.0.svn49.

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