spessasynth_core documentation
    Preparing search index...

    Interface SynthesizerPatch

    A generic synthesizer patch that can return voice parameters. This is used for the virtual GS user drum preset.

    interface SynthesizerPatch {
        bankLSB: number;
        bankMSB: number;
        isDrum: boolean;
        isGMGSDrum: boolean;
        name: string;
        program: number;
        getVoiceParameters(midiNote: number, velocity: number): VoiceParameters[];
    }

    Hierarchy (View Summary)

    Index
    bankLSB: number

    Bank LSB (CC#32) of this patch.

    This is mostly used in XG and GM2 for selecting variations of instruments, much like MSB in GS.

    bankMSB: number

    Bank MSB (CC#0) of this patch.

    It is used for sound variation in GS, and for channel type in XG and GM2. This means that with bank MSB of 127 for example, a channel in XG mode will turn into a drum channel.

    isDrum: boolean

    Indicates if this patch is a drum patch. This is the recommended way of determining if this is a drum preset.

    If this value is true:

    • If isGMGSDrum is true, then this is a GM/GS drum preset.
    • If isGMGSDrum is false, then this is a GM2/XG drum preset.
    isGMGSDrum: boolean

    If the preset is marked as GM/GS drum preset.

    This flag is exclusive to GM and GS systems. These don't use bank MSB as a drum flag. GM has channel 9 hardcoded as drums, and GS has a system exclusive for setting them. This allows XG and GS drums to coexist in a single sound bank and can be thought of as bank 128 in SF2.

    name: string

    The name of the patch.

    program: number

    The MIDI program number.

    • Returns the voice synthesis data for this preset.

      Parameters

      • midiNote: number

        the MIDI note number.

      • velocity: number

        the MIDI velocity.

      Returns VoiceParameters[]

      the returned sound data.