spessasynth_core documentation
    Preparing search index...

    Interface ModifyMIDIOptions

    Options editing a MIDI sequence using BasicMIDI.modify.

    interface ModifyMIDIOptions {
        channels?: Map<number, ClearableParameter<ChannelModification>>;
        fallbackReset?: MIDISystem;
        gsChorusParams?: ClearableParameter<GSChorusParameter>;
        gsDelayParams?: ClearableParameter<GSDelayParameter>;
        gsInsertionParams?: ClearableParameter<GSInsertionBlockSnapshot>;
        gsReverbParams?: ClearableParameter<GSReverbParameter>;
        midiParams?: {
            fineTune?: ClearableParameter<number>;
            keyShift?: ClearableParameter<number>;
            pan?: ClearableParameter<number>;
            system?: ClearableParameter<MIDISystem>;
            volume?: ClearableParameter<number>;
        };
        userDrumParams?: Map<number, ClearableParameter<UserDrumModification>>;
        xgChorusParams?: ClearableParameter<XGChorusBlockSnapshot>;
        xgInsertionParams?: Map<
            number,
            ClearableParameter<XGInsertionBlockSnapshot>,
        >;
        xgReverbParams?: ClearableParameter<XGSystemEffectBlockSnapshot>;
        xgVariationParams?: ClearableParameter<XGVariationBlockSnapshot>;
    }
    Index
    channels?: Map<number, ClearableParameter<ChannelModification>>

    The channel changes.

    • Key: the MIDI channel number.
    • value:
      • "clear" - all MIDI messages for this channel, such as Note On are removed.
      • ChannelModification - modifies the channel.
    fallbackReset?: MIDISystem

    The system reset to add when the file contains no reset. Unlike midiParams.system, existing resets are left untouched. Ignored when midiParams.system is set (it takes precedence) and when midiParams.system is "clear" (no reset is added). When unset, the added reset defaults to "xg" if only XG setups are requested, otherwise to "gs".

    Also, if GM resets are replaced, they use this system if provided, otherwise "gs".

    The GS chorus parameters.

    • "clear" - all existing parameter change MIDI messages are cleared.
    • GSChorusParameter - clear + the new parameters are set via System Exclusive messages.

    The GS delay parameters.

    • "clear" - all existing parameter change MIDI messages are cleared.
    • GSDelayParameter - clear + the new parameters are set via System Exclusive messages.

    The GS Insertion Effect parameters.

    • "clear" - all existing parameter change MIDI messages are cleared.
    • GSInsertionBlockSnapshot - clear + the new parameters are set via System Exclusive messages.

    The desired GS reverb parameters.

    • "clear" - all existing parameter change MIDI messages are removed.
    • GSReverbParameter - clear + the new parameters are set via System Exclusive messages.
    midiParams?: {
        fineTune?: ClearableParameter<number>;
        keyShift?: ClearableParameter<number>;
        pan?: ClearableParameter<number>;
        system?: ClearableParameter<MIDISystem>;
        volume?: ClearableParameter<number>;
    }

    The GlobalMIDIParameter changes.

    • Key: the MIDI parameter name.
    • value:
      • "clear" - all changes for this parameter are removed.
      • specific value - clear + sets the new parameter, re-applying it after every system reset, effectively locking it to the set value.

    For the system parameter specifically:

    • "clear" - deletes every system reset. Setup is inserted before the first note on without any reset.
    • specific value - replaces every system reset with the desired one.

    Type Declaration

    • OptionalfineTune?: ClearableParameter<number>

      The global tuning in cents.

    • OptionalkeyShift?: ClearableParameter<number>

      The global key shift in semitones.

    • Optionalpan?: ClearableParameter<number>

      The master pan. From -1 (left) to 1 (right). 0 is center.

      This uses the cosine panning law, so the perceived loudness remains constant as the pan changes.

    • Optionalsystem?: ClearableParameter<MIDISystem>

      The currently enabled MIDI system used by the synthesizer. It changes how the synthesizer behaves, including things such as effects or bank selection.

      It can be changed with a System Exclusive reset message. (GM, GM2, GS, XG)

    • Optionalvolume?: ClearableParameter<number>

      The master volume. From 0 (silent) to 1 (full volume).

    userDrumParams?: Map<number, ClearableParameter<UserDrumModification>>

    The User Drum Set changes.

    • Key: the User Drum Set number, 0 based. 0 is the User Drum Set 1 located at MIDI program 64, and 1 is User Drum Set 2 located at MIDI program 65.
    • value:
      • "clear" - all existing changes for this drum set are removed.
      • UserDrumModification - modifies the drum set.

    The desired XG chorus parameters.

    • "clear" - all existing parameter change MIDI messages are removed.
    • XGChorusBlockSnapshot - clear + the new parameters are set via System Exclusive messages.
    xgInsertionParams?: Map<number, ClearableParameter<XGInsertionBlockSnapshot>>

    The desired XG insertion parameters. Key is the insertion effect number.

    Value is:

    • "clear" - all existing parameter change MIDI messages are removed.
    • XGInsertionBlockSnapshot - clear + the new parameters are set via System Exclusive messages.

    The desired XG reverb parameters.

    • "clear" - all existing parameter change MIDI messages are removed.
    • XGSystemEffectBlockSnapshot - clear + the new parameters are set via System Exclusive messages.

    The desired XG variation parameters.

    • "clear" - all existing parameter change MIDI messages are removed.
    • XGVariationBlockSnapshot - clear + the new parameters are set via System Exclusive messages.