Class BasicZone

Namespace
SpessaSharp.SoundBank
Assembly
SpessaSharp.dll
public sealed class BasicZone
Inheritance
BasicZone
Inherited Members

Fields

BagByteSize

public const int BagByteSize = 4

Field Value

int

Generators

The zone's generators.

public readonly List<Generator> Generators

Field Value

List<Generator>

KeyRange

The zone's key range. Min -1 means that it is a default value

public (int Min, int Max) KeyRange

Field Value

(int Min, int Max)

Modulators

The zone's modulators.

public readonly List<Modulator> Modulators

Field Value

List<Modulator>

VelRange

The zone's velocity range. Min -1 means that it is a default value

public (int Min, int Max) VelRange

Field Value

(int Min, int Max)

Properties

FineTuning

The current tuning in cents, taking in both coarse and fine generators.

public int FineTuning { get; set; }

Property Value

int

HasKeyRange

public bool HasKeyRange { get; }

Property Value

bool

HasVelRange

public bool HasVelRange { get; }

Property Value

bool

LoopMode

The current SamplesMode. No Loop (0) is the default.

public Generator.LoopMode LoopMode { get; set; }

Property Value

Generator.LoopMode

ReleaseModEnv

The current release mod envelope.

public int ReleaseModEnv { get; set; }

Property Value

int

ReleaseVolEnv

The current release vol envelope.

public int ReleaseVolEnv { get; set; }

Property Value

int

Methods

Add(params ReadOnlySpan<Generator>)

Adds generators to the zone.

public void Add(params ReadOnlySpan<Generator> generators)

Parameters

generators ReadOnlySpan<Generator>

Generators

AddToGenerator(Type, int, bool)

Adds to a given generator, or its default value.

public void AddToGenerator(Generator.Type type, int value, bool validate = true)

Parameters

type Generator.Type

The generator type.

value int

The value to add.

validate bool

If the value should be clamped to allowed limits.

CopyFrom(BasicZone)

public void CopyFrom(BasicZone zone)

Parameters

zone BasicZone

GetGenerator(Type)

public short? GetGenerator(Generator.Type type)

Parameters

type Generator.Type

Returns

short?

GetGenerator(Type, short)

Gets a generator value.

public short GetGenerator(Generator.Type type, short def)

Parameters

type Generator.Type

The generator type.

def short

If the generator is not found, this value is returned. A default value can be passed here, or null for example, to check if the generator is set.

Returns

short

GetWriteGenerators()

Filters the generators and prepends the range generators.

public List<Generator> GetWriteGenerators()

Returns

List<Generator>

SetGenerator(Type, int?, bool)

Sets a generator to a given value if preset, otherwise adds a new one.

public void SetGenerator(Generator.Type type, int? value = null, bool validate = true)

Parameters

type Generator.Type

The generator type.

value int?

The value to set. Set to null to remove this generator (set as "unset").

validate bool

If the value should be clamped to allowed limits.

Exceptions

ArgumentException

Type must be set using a different method