Struct MidiPatch
- Namespace
- SpessaSharp.MIDI
- Assembly
- SpessaSharp.dll
public readonly record struct MidiPatch : IEquatable<MidiPatch>
- Implements
- Inherited Members
Constructors
MidiPatch(int, int, int, bool)
public MidiPatch(int Program, int BankMSB, int BankLSB, bool IsGMGSDrum)
Parameters
ProgramintThe MIDI program number.
BankMSBintThe MIDI bank MSB number.
BankLSBintThe MIDI bank LSB number.
IsGMGSDrumboolIf the preset is marked as GM/GS drum preset. Note that XG drums do not have this flag.
Properties
BankLSB
The MIDI bank LSB number.
public int BankLSB { get; init; }
Property Value
BankMSB
The MIDI bank MSB number.
public int BankMSB { get; init; }
Property Value
IsGMGSDrum
If the preset is marked as GM/GS drum preset. Note that XG drums do not have this flag.
public bool IsGMGSDrum { get; init; }
Property Value
Program
The MIDI program number.
public int Program { get; init; }
Property Value
Methods
Compare(MidiPatch, MidiPatch)
A comparison function for .sort() or .toSorted(), ordering the patches in ascending order.
public static int Compare(MidiPatch a, MidiPatch b)
Parameters
Returns
- int
Order
From(ReadOnlySpan<char>)
Gets a MIDI patch from a string.
public static MidiPatch From(ReadOnlySpan<char> midiString)
Parameters
midiStringReadOnlySpan<char>
Returns
- MidiPatch
The parsed patch
Matches(MidiPatch)
Checks if two MIDI patches represent the same one.
public bool Matches(MidiPatch p2)
Parameters
p2MidiPatch
Returns
ToMidiString()
Converts a given MIDIPatch to a string.
The format is:
DRUM:programforGMGSDrumset totrue.bankLSB:bankMSB:programforGMGSDrumset tofalse.
public string ToMidiString()
Returns
Operators
implicit operator MidiPatch(Full)
public static implicit operator MidiPatch(MidiPatch.Full fullPatch)