Class BasicInstrument
- Namespace
- SpessaSharp.SoundBank
- Assembly
- SpessaSharp.dll
Represents a single instrument
public sealed class BasicInstrument
- Inheritance
-
BasicInstrument
- Inherited Members
Fields
GlobalZone
Instrument's global zone
public readonly BasicZone GlobalZone
Field Value
INST_BYTE_SIZE
public const int INST_BYTE_SIZE = 22
Field Value
LinkedTo
Instrument's linked presets (the presets that use it). Note that duplicates are allowed since one preset can use the same instrument multiple times.
public readonly List<BasicPreset> LinkedTo
Field Value
Zones
The instrument's zones
public readonly List<BasicInstrument.Zone> Zones
Field Value
Properties
Name
The instrument's name
public string Name { get; set; }
Property Value
UseCount
How many presets is this instrument used by
public int UseCount { get; }
Property Value
Methods
CreateZone(BasicSample)
Creates a new instrument zone and returns it.
public BasicInstrument.Zone CreateZone(BasicSample sample)
Parameters
sampleBasicSampleThe sample to use in the zone.
Returns
Delete()
Unlinks everything from this instrument
public void Delete()
Exceptions
DeleteUnusedZones()
Deletes unused zones of the instrument
public void DeleteUnusedZones()
DeleteZone(int, bool)
Deletes a given instrument zone if it has no uses
public bool DeleteZone(int index, bool force = false)
Parameters
Returns
- bool
If the zone has been deleted
Globalize()
Globalizes the instrument in-place. This means trying to move as many generators and modulators to the global zone as possible to reduce clutter and the count of parameters.
public void Globalize()
LinkTo(BasicPreset)
Links the instrument to a given preset
public void LinkTo(BasicPreset preset)
Parameters
presetBasicPresetThe preset to link to
UnlinkFrom(BasicPreset)
Unlinks the instrument from a given preset
public void UnlinkFrom(BasicPreset preset)
Parameters
presetBasicPresetThe preset to unlink from