Program Experimental
The Program class represents a Kontakt program and provides access to its zones.
import { Program } from kontakt
export class Program {
zones: ZoneList { get }
add_user_zone(_ sample: Sample, group_index: Int = 0) -> Zone
remove_user_zone(zone: Zone) -> Bool
zone_by_id(id: Int) -> Zone
zones_by_group(_ group_index: Int) -> ZoneList
}
export var program: Program
This class was introduced as an experimental feature in Kontakt 8.10.
Access
program: Program
A Program cannot be created. However, the current Kontakt program is available via the program variable. It is provided by the kontakt module and can be imported directly:
import { program } from kontakt
Constructors
None. This class cannot be instantiated directly.
Properties
zones: ZoneList (get)
All zones in the program as a ZoneList.
Methods
add_user_zone(_ sample: Sample, group_index: Int = 0) -> (Zone)
Adds a new user zone and assigns the given sample to it. Optionally the group group_index can be set. Returns the newly created Zone.
remove_user_zone(zone: Zone) -> (Bool)
Removes the given user Zone from the program. Returns true if the zone was removed, and false if the given zone is not a user zone, or is a user zone created by KSP, or the zone has already been removed.
zone_by_id(id: Int) -> (Zone)
Returns the Zone with the given ID. This method is mainly useful for interpoerability with KSP.
zones_by_group(_ group_index: Int) -> (ZoneList)
Returns a ZoneList containing all zones that belong to the group at the given index.