Documents
Writing Docs Gigedit SFZ Instrument Scripts NKSP Language NKSP Reference

change_play_pos()

This function can be used to change the sample playback position of the voices of the requested note. You need to pass the note ID of the voices you want to alter. This function will change the sample playback position of all voices associated with the requested note.

At the moment you may only use this function for new notes. That effectively means you should change the sample playback position with this function before any wait() calls, and before entering any loops that may execute your script for a very long time. Using this function for notes which alreay play for a while does not raise an error, but calling this function will simply be ignored for such older notes, and thus will have no effect. This current limitation might change in future.

In case the respective sample is using disk streaming, then you might be limited to set the new playback position somwehere within a certain range at the beginning of the sample (i.e. less than several hundred milliseconds from sample start). The precise range depends on the sampler configuration and the sampler format engine being used. Setting a position beyond that maximum position might either cause your position to be automatically corrected by the sampler, or that the resulting voices will not play at all.

Function Prototype

change_play_pos(note, position-us)

Arguments

Argument Name Data Type Description
note Note ID Number All voices of this note will be modified.
[required]
position-us Integer Number New sample playback position in micro seconds from sample start.
[required]

Return Value

None.

Examples

None yet.

See also

play_note()

Availability

Since LinuxSampler 2.0.0.svn57.

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

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