Class KeyModifier.Manager
- Namespace
- SpessaSharp.Synthesizer.Engine
- Assembly
- SpessaSharp.dll
public sealed class KeyModifier.Manager
- Inheritance
-
KeyModifier.Manager
- Inherited Members
Methods
AddMapping(int, int, KeyModifier)
Add a mapping for a MIDI key to a KeyModifier.
public void AddMapping(int channel, int midiNote, KeyModifier mapping)
Parameters
channelintThe MIDI channel number.
midiNoteintThe MIDI note number (0-127).
mappingKeyModifierThe KeyModifier to apply for this key.
ClearMappings()
Clear all key mappings.
public void ClearMappings()
DeleteMapping(int, int)
Delete a mapping for a MIDI key.
public void DeleteMapping(int channel, int midiNote)
Parameters
GetGain(int, int)
Gets the gain override for a MIDI key.
public float GetGain(int channel, int midiNote)
Parameters
Returns
- float
The gain override, or 1 if no override is set.
GetMappings()
Returns the current key mappings.
public KeyModifier?[]?[] GetMappings()
Returns
- KeyModifier?[][]
GetPatch(int, int)
Gets the patch override for a MIDI key.
public MidiPatch GetPatch(int channel, int midiNote)
Parameters
Returns
- MidiPatch
An object containing the bank and program numbers.
Exceptions
- Exception
Error if no modifier is set for the key.
GetVelocity(int, int)
Gets the velocity override for a MIDI key.
public int? GetVelocity(int channel, int midiNote)
Parameters
Returns
- int?
The velocity override, or null if no override is set.
HasOverridePatch(int, int)
Checks if a MIDI key has an override for the patch.
public bool HasOverridePatch(int channel, int midiNote)
Parameters
Returns
- bool
True if the key has an override patch, false otherwise.
SetMappings(KeyModifier?[]?[])
Sets the key mappings to a new array.
public void SetMappings(KeyModifier?[]?[] mappings)
Parameters
mappingsKeyModifier?[][]A 2D array where the first dimension is the channel number and the second dimension is the MIDI note number.