Documents
Writing Docs Gigedit SFZ Instrument Scripts NKSP Language NKSP Reference

by_marks()

Returns an array of event IDs of all events being members of the requested event group. These are events which had previously been added to that event group by calling the set_event_mark() function. The by_marks() function acts as placeholder for all event IDs of the particular group and allows to manipulate a set of events this way with only one call.

After notes died, this function may still return those recently died notes' IDs for a certain while, that means for example that num_elements(by_marks($MARK_1)) may return a higher value than the actual amount of currently active notes. This does not mean that you have to remove dead notes from their groups by calling delete_event_mark(). The sampler automatically removes dead notes from their groups automatically after a certain amount of time, and in practice this lag does not have any negative impact on using this function, since all built-in functions automatically detect invalid IDs and are automatically ignoring IDs of dead notes.

Function Prototype

by_marks(group-id)

Arguments

Argument Name Data Type Description
group-id Event Group ID Number Event group that shall be referenced. You should pass one of the built-in constant variables $MARK_1 to $MARK_28 for this argument to select one of the 28 available groups.
[required]

Return Value

Data Type Description
Event ID Array Event IDs of requested group.

Examples

The following example implements two "exclusive" keyboard zones with a split point at key 36. The script enforces that only notes of either one of the two keyboard zones may play at the same time. So for example if you start playing notes left of the split point, all sounds play as usual. Now however, as soon as you hit a note on the right side of the split point, it will cause all notes left of the split point to be released immediately.

Document Updated:  2019-08-29  |  Author:  Christian Schoenebeck