Class BasicPreset

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

Constructors

BasicPreset(SoundBank, BasicZone?, Full)

Creates a new preset representation.

public BasicPreset(SoundBank parent, BasicZone? globalZone = null, MidiPatch.Full patch = default)

Parameters

parent SoundBank

The sound bank this preset belongs to.

globalZone BasicZone

Optional, a global zone to use.

patch MidiPatch.Full

Fields

Genre

Unused metadata

public uint Genre

Field Value

uint

GlobalZone

Preset's global zone

public readonly BasicZone GlobalZone

Field Value

BasicZone

Library

Unused metadata

public uint Library

Field Value

uint

Morphology

Unused metadata

public uint Morphology

Field Value

uint

PHDR_BYTE_SIZE

public const int PHDR_BYTE_SIZE = 38

Field Value

int

Parent

The parent soundbank instance. Currently used for determining default modulators and XG status.

public readonly SoundBank Parent

Field Value

SoundBank

Patch

public MidiPatch.Full Patch

Field Value

MidiPatch.Full

Zones

The preset's zones

public readonly List<BasicPreset.Zone> Zones

Field Value

List<BasicPreset.Zone>

Properties

BankLSB

public int BankLSB { get; set; }

Property Value

int

BankMSB

public int BankMSB { get; set; }

Property Value

int

IsDrum

Checks if this preset is a drum preset

public bool IsDrum { get; }

Property Value

bool

IsGMGSDrum

public bool IsGMGSDrum { get; set; }

Property Value

bool

IsXGDrum

public bool IsXGDrum { get; }

Property Value

bool

Name

public string Name { get; set; }

Property Value

string

Program

public int Program { get; set; }

Property Value

int

Methods

CreateZone(BasicInstrument)

Creates a new preset zone and returns it.

public BasicPreset.Zone CreateZone(BasicInstrument instrument)

Parameters

instrument BasicInstrument

The instrument to use in the zone.

Returns

BasicPreset.Zone

Delete()

Unlinks everything from this preset.

public void Delete()

DeleteZone(int)

Deletes an instrument zone from this preset.

public void DeleteZone(int index)

Parameters

index int

The zone's index to delete.

Matches(MidiPatch)

Checks if the bank and program numbers are the same for the given preset as this one.

public bool Matches(MidiPatch preset)

Parameters

preset MidiPatch

The preset to check.

Returns

bool

Preload(int, int)

Preloads (loads and caches synthesis data) for a given key range.

public void Preload(int keyMin, int keyMax)

Parameters

keyMin int
keyMax int

ToFlattenedInstrument()

Combines preset into an instrument, flattening the preset zones into instrument zones. This is a really complex function that attempts to work around the DLS limitations of only having the instrument layer.

public BasicInstrument ToFlattenedInstrument()

Returns

BasicInstrument

The instrument containing the flattened zones. In theory, it should exactly the same as this preset.

ToMidiString()

BankMSB:BankLSB:Program:IsGMGSDrum

public string ToMidiString()

Returns

string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ZonesInRange(int, int)

public BasicPreset.InstrumentZoneEnumerable ZonesInRange(int key, int vel)

Parameters

key int
vel int

Returns

BasicPreset.InstrumentZoneEnumerable