Zone
Constants
max_num_sample_loops
max_num_sample_loops: integer
As of Kontakt 7.5, this constant returns 8.
max_num_zones
max_num_zones: integer
As of Kontakt 7.5, this constant returns 98304.
sample_loop_modes
sample_loop_modes: table
“off”
“until_end”
“until_end_alt”
“until_release”
“until_release_alt”
zone_grid_modes
zone_grid_modes: table
“auto”
“fixed”
“none”
Get Property
get_num_zones
get_num_zones(instrument_idx: integer) -> integer
Returns the total number of zones in the specified instrument.
get_sample_loop_count
get_sample_loop_count(instrument_idx: integer, zone_idx: integer, loop_idx: integer) -> integer
Returns the loop count of the specified zone’s loop.
get_sample_loop_length
get_sample_loop_length(instrument_idx: integer, zone_idx: integer, loop_idx: integer) -> integer
Returns the loop length of the specified zone’s loop.
get_sample_loop_mode
get_sample_loop_mode(instrument_idx: integer, zone_idx: integer, loop_idx: integer) -> string
Returns the loop mode of the specified zone’s loop. See sample_loop_modes.
get_sample_loop_start
get_sample_loop_start(instrument_idx: integer, zone_idx: integer, loop_idx: integer) -> integer
Returns the loop start of the specified zone’s loop.
get_sample_loop_tune
get_sample_loop_tune(instrument_idx: integer, zone_idx: integer, loop_idx: integer) -> float
Returns the loop tuning of the specified zone’s loop in semitones.
get_sample_loop_xfade
get_sample_loop_xfade(instrument_idx: integer, zone_idx: integer, loop_idx: integer) -> integer
Returns the loop crossfade time of the specified zone’s loop.
get_zone_geometry
get_zone_geometry(instrument_idx: integer, zone_idx: integer) -> table
Returns a table containing the complete zone geometry (key and velocity ranges, root key, zone crossfades, etc.). See set_zone_geometry.
get_zone_grid_bpm
get_zone_grid_bpm(instrument_idx: integer, zone_idx: integer) -> float
Returns the BPM of the specified zone.
get_zone_grid_mode
get_zone_grid_mode(instrument_idx: integer, zone_idx: integer) -> string
Returns the grid mode of the specified zone. See zone_grid_modes.
get_zone_group
get_zone_group(instrument_idx: integer, zone_idx: integer) -> integer
Returns the index of the group which contains the specified zone.
get_zone_high_key
get_zone_high_key(instrument_idx: integer, zone_idx: integer) -> integer
Returns the high key of the specified zone.
get_zone_high_key_fade
get_zone_high_key_fade(instrument_idx: integer, zone_idx: integer) -> integer
Returns the high key crossfade span of the specified zone.
get_zone_high_velocity
get_zone_high_velocity(instrument_idx: integer, zone_idx: integer) -> integer
Returns the high velocity of the specified zone.
get_zone_high_velocity_fade
get_zone_high_velocity_fade(instrument_idx: integer, zone_idx: integer) -> integer
Returns the high velocity crossfade span of the specified zone.
get_zone_low_key
get_zone_low_key(instrument_idx: integer, zone_idx: integer) -> integer
Returns the low key of the specified zone.
get_zone_low_key_fade
get_zone_low_key_fade(instrument_idx: integer, zone_idx: integer) -> integer
Returns the low key crossfade span of the specified zone.
get_zone_low_velocity
get_zone_low_velocity(instrument_idx: integer, zone_idx: integer) -> float
Returns the low velocity of the specified zone.
get_zone_low_velocity_fade
get_zone_low_velocity_fade(instrument_idx: integer, zone_idx: integer) -> float
Returns the low velocity crossfade span of the specified zone.
get_zone_pan
get_zone_pan(instrument_idx: integer, group_idx: integer) -> float
Returns the panorama offset of the specified zone.
get_zone_root_key
get_zone_root_key(instrument_idx: integer, zone_idx: integer) -> integer
Returns the root key of the specified zone.
get_zone_sample
get_zone_sample(instrument_idx: integer, zone_idx: integer) -> string?
Returns the absolute file path of the sample loaded in the specified zone.
get_zone_sample_channels
get_zone_sample_channels(instrument_idx: integer, zone_idx: integer) -> integer?
Returns the number of audio channels in the sample loaded in the specified zone.
get_zone_sample_end
get_zone_sample_end(instrument_idx: integer, zone_idx: integer) -> integer
Returns the sample end position for the specified zone. This is expressed in negative frames, by how far away the sample end marker is from last sample frame, so in order to get the same value as displayed in Kontakt's Wave Editor, use get_zone_sample_frames() + get_zone_sample_end()
.
get_zone_sample_frames
get_zone_sample_frames(instrument_idx: integer, zone_idx: integer) -> integer?
Returns the length of the sample loaded in the specified zone.
get_zone_sample_start
get_zone_sample_start(instrument_idx: integer, zone_idx: integer) -> integer
Returns the sample start position for the specified zone.
get_zone_sample_start_mod_range
get_zone_sample_start_mod_range(instrument_idx: integer, zone_idx: integer) -> integer
Returns the sample start modulation range for the specified zone.
get_zone_tune
get_zone_tune(instrument_idx: integer, zone_idx: integer) -> float
Returns the tuning offset of the specified zone in semitones.
get_zone_volume
get_zone_volume(instrument_idx: integer, zone_idx: integer) -> float
Returns the volume offset of the specified zone in dB.
Set Property
set_sample_loop_count
set_sample_loop_count(instrument_idx: integer, zone_idx: integer, loop_idx: integer, count: integer)
Sets the loop count of the specified zone’s loop.
set_sample_loop_length
set_sample_loop_length(instrument_idx: integer, zone_idx: integer, loop_idx: integer, frames: integer)
Sets the length for the specified zone’s loop in sample frames.
set_sample_loop_mode
set_sample_loop_mode(instrument_idx: integer, zone_idx: integer, loop_idx: integer, mode: string)
Sets the playback mode for the specified zone’s loop.See sample_loop_modes.
set_sample_loop_start
set_sample_loop_start(instrument_idx: integer, zone_idx: integer, loop_idx: integer, frame: integer)
Sets the start of the specified zone’s loop.
set_sample_loop_tune
set_sample_loop_tune(instrument_idx: integer, zone_idx: integer, loop_idx: integer, tune: float)
Sets the tuning of the specified zone’s loop in semitones. Range is -12.0 … 12.0.
set_sample_loop_xfade
set_sample_loop_xfade(instrument_idx: integer, zone_idx: integer, loop_idx: integer, frames: integer)
Sets the length of the specified zone’s loop xfade in sample frames.
set_zone_geometry
set_zone_geometry(instrument_idx: integer, zone_idx: integer, geometry: table)
Applies geometry
to the specified zone. This consists of a table of the following properties which specify the boundaries of the zone.
Geometry:
root_key
(default: 36, range: 0 … 127)low_key
(default: 0, range: 0 ...high_key
)high_key
(default: 127, range:low_key
...127)low_key_fade
(default: 0, range: 0 ...span
)high_key_fade
(default: 0, range: 0 ...span
)low_velocity
(default: 1, range: 0 ...high_velocity
)high_velocity
(default: 127, range:low_velocity
... 127)low_velocity_fade
(default: 0, range: 0 ...span
)high_velocity_fade
(default: 0, range: 0 ...span
)
span
is defined as: high_key / velocity + 1 - low_key / velocity - opposite_fade_value
. So if setting low_key_fade
, use the value of high_key_fade
as opposite_fade_value
set_zone_grid
set_zone_grid(instrument_idx: integer, zone_idx: integer, mode: string, bpm: float)
Sets the grid of the specified zone. See zone_grid_modes.
set_zone_group
set_zone_group(instrument_idx: integer, zone_idx: integer, group_idx: integer)
Sets the group index for the specified zone. This effectively moves the zone to the specified group without the need for creating a new zone and copying zone properties.
set_zone_high_key
set_zone_high_key(instrument_idx: integer, zone_idx: integer, key: integer)
See set_zone_geometry.
set_zone_high_key_fade
set_zone_high_key_fade(instrument_idx: integer, zone_idx: integer, key_fade: integer)
See set_zone_geometry.
set_zone_high_velocity
set_zone_high_velocity(instrument_idx: integer, zone_idx: integer, velocity: integer)
See set_zone_geometry.
set_zone_high_velocity_fade
set_zone_high_velocity_fade(instrument_idx: integer, zone_idx: integer, velocity_fade: integer)
See set_zone_geometry.
set_zone_low_key
set_zone_low_key(instrument_idx: integer, zone_idx: integer, key: integer)
See set_zone_geometry.
set_zone_low_key_fade
set_zone_low_key_fade(instrument_idx: integer, zone_idx: integer, key_fade: integer)
See set_zone_geometry.
set_zone_low_velocity
set_zone_low_velocity(instrument_idx: integer, zone_idx: integer, velocity: integer)
See set_zone_geometry.
set_zone_low_velocity_fade
set_zone_low_velocity_fade(instrument_idx: integer, zone_idx: integer, velocity_fade: integer)
See set_zone_geometry.
set_zone_pan
set_zone_pan(instrument_idx: integer, zone_idx: integer, pan: float)
Sets the panorama offset of the specified zone. Range is -100.0 … 100.0.
set_zone_root_key
set_zone_root_key(instrument_idx: integer, zone_idx: integer, key: integer)
See set_zone_geometry.
set_zone_sample
set_zone_sample(instrument_idx: integer, zone_idx: integer, filename: string)
Sets the absolute path of the sample to be loaded in the specified zone.
set_zone_sample_end
set_zone_sample_end(instrument_idx: integer, zone_idx: integer, frame: integer)
Sets the sample end of the sample loaded in the specified zone. This is expressed in negative frames, by how far away the sample end marker is from last sample frame.
set_zone_sample_start
set_zone_sample_start(instrument_idx: integer, zone_idx: integer, frame: integer)
Sets the sample start of the sample loaded in the specified zone, in sample frames.
set_zone_sample_start_mod_range
set_zone_sample_start_mod_range(instrument_idx: integer, zone_idx: integer, frame: integer)
Sets the sample start modulation range of the sample loaded in the specified zone, in sample frames.
set_zone_tune
set_zone_tune(instrument_idx: integer, zone_idx: integer, tune: float)
Sets the tuning offset of the specified zone in semitones. Range is -36.0 … 36.0.
set_zone_volume
set_zone_volume(instrument_idx: integer, zone_idx: integer, volume: float)
Sets the volume offset of the specified zone in dB. Range is -36.0 … 36.0.
Modifiers
add_zone
add_zone(instrument_idx: integer, group_idx: integer, filename: string) -> integer
The returned index refers the added zone. Pass this index to functions taking zone_idx
as an argument.
remove_zone
remove_zone(instrument_idx: integer, zone_idx: integer)
Removes the specified zone index from the instrument at the specified instrument index.
restore_loops_from_sample
restore_loops_from_sample(instrument_idx: integer, zone_idx: integer)
Sets the loop points to the values stored in the sample metadata, if it exists.