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

BasicZone

INST_BYTE_SIZE

public const int INST_BYTE_SIZE = 22

Field Value

int

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

List<BasicPreset>

Zones

The instrument's zones

public readonly List<BasicInstrument.Zone> Zones

Field Value

List<BasicInstrument.Zone>

Properties

Name

The instrument's name

public string Name { get; set; }

Property Value

string

UseCount

How many presets is this instrument used by

public int UseCount { get; }

Property Value

int

Methods

CreateZone(BasicSample)

Creates a new instrument zone and returns it.

public BasicInstrument.Zone CreateZone(BasicSample sample)

Parameters

sample BasicSample

The sample to use in the zone.

Returns

BasicInstrument.Zone

Delete()

Unlinks everything from this instrument

public void Delete()

Exceptions

InvalidOperationException

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

index int

The index of the zone to delete

force bool

Tgnores the use count and deletes forcibly

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

preset BasicPreset

The preset to link to

UnlinkFrom(BasicPreset)

Unlinks the instrument from a given preset

public void UnlinkFrom(BasicPreset preset)

Parameters

preset BasicPreset

The preset to unlink from

Exceptions

ArgumentException