Instrument
The Instrument class represents a Kontakt instrument and provides access to its groups and zones.
class Instrument
Access
An Instrument cannot be created. However, the current Kontakt instrument is available via the instrument variable. It is provided by the kontakt package and can be imported directly:
import { instrument } from kontakt
Properties
groups
groups: GroupList { get }
All groups in the instrument as a GroupList.
Groups created after the script was loaded (e.g. in the Kontakt editor or by KSP) are not included. Reload the instrument to make them available.
Methods
group
group(named: String) -> (Group?)
Returns the first Group with the given name, or nil if no such group exists.
Groups created after the script was loaded (e.g. in the Kontakt editor or by KSP) are not found and return nil. Reload the instrument to make them available.
zone
zone(id: Int) -> (Zone?)
Returns the Zone with the given ID, or nil if no such zone exists. This method is mainly useful for interoperability with KSP, e.g. to resolve a zone ID that was persisted via KSP back to a Zone.
Zones created after the script was loaded (e.g. in the Kontakt editor or by KSP) are not found and return nil. Reload the instrument to make them available. Zones created by the script via Group.add_zone are available immediately.