spessasynth_core documentation
    Preparing search index...

    Interface ChannelModification

    This represents modifications applied to a single MIDI channel when using BasicMIDI.modify.

    interface ChannelModification {
        controllers?: Map<MIDIController, ClearableParameter<number>>;
        drumParams?: ClearableParameter<ChannelDrumModification>;
        fineTune?: number;
        keyShift?: number;
        midiParams?: {
            assignMode?: ClearableParameter<number>;
            cc1?: ClearableParameter<MIDIController>;
            cc2?: ClearableParameter<MIDIController>;
            drumMap?: ClearableParameter<number>;
            dryLevel?: ClearableParameter<number>;
            efxAssign?: ClearableParameter<boolean>;
            fineTune?: ClearableParameter<number>;
            keyShift?: ClearableParameter<number>;
            modulationDepth?: ClearableParameter<number>;
            pitchWheel?: ClearableParameter<number>;
            pitchWheelRange?: ClearableParameter<number>;
            polyMode?: ClearableParameter<boolean>;
            pressure?: ClearableParameter<number>;
            randomPan?: ClearableParameter<boolean>;
            rxChannel?: ClearableParameter<number>;
            velocitySenseDepth?: ClearableParameter<number>;
            velocitySenseOffset?: ClearableParameter<number>;
        };
        patch?: ClearableParameter<MIDIPatch>;
    }
    Index
    controllers?: Map<MIDIController, ClearableParameter<number>>

    All controllers that should be modified for this channel.

    • Key: the MIDI controller number.
    • value:
      • "clear" - all controller changes for this controller are removed.
      • number - clear + sets the new controller before the channel's first note-on, re-applying it after every system reset, effectively locking it to the set value.

    The channel drum parameter changes, set via NRPN at the channel's first note on.

    • "clear" - all drum parameter changes for this channel are removed (both NRPN edits and any drum map SysEx edits affecting this channel).
    • ChannelDrumModification - modifies the channel's drum notes.
    fineTune?: number

    The channel tuning in cents. Tuned using RPN Fine Tune.

    This differs from the fineTune MIDI Parameter in that it is relative to the tuning applied in the MIDI file, and it does not overwrite it.

    keyShift?: number

    The channel key shift in semitones. Note on/off and poly pressure MIDI note numbers are shifted.

    This differs from the keyShift MIDI Parameter in that it shifts the actual note numbers, and doesn't delete or overwrite existing shifts.

    midiParams?: {
        assignMode?: ClearableParameter<number>;
        cc1?: ClearableParameter<MIDIController>;
        cc2?: ClearableParameter<MIDIController>;
        drumMap?: ClearableParameter<number>;
        dryLevel?: ClearableParameter<number>;
        efxAssign?: ClearableParameter<boolean>;
        fineTune?: ClearableParameter<number>;
        keyShift?: ClearableParameter<number>;
        modulationDepth?: ClearableParameter<number>;
        pitchWheel?: ClearableParameter<number>;
        pitchWheelRange?: ClearableParameter<number>;
        polyMode?: ClearableParameter<boolean>;
        pressure?: ClearableParameter<number>;
        randomPan?: ClearableParameter<boolean>;
        rxChannel?: ClearableParameter<number>;
        velocitySenseDepth?: ClearableParameter<number>;
        velocitySenseOffset?: ClearableParameter<number>;
    }

    The ChannelMIDIParameter changes for this channel.

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

    Type Declaration

    • OptionalassignMode?: ClearableParameter<number>

      Assign mode for the channel:

      • 0 - A new note will kill the previous one if it is still playing.
      • Any other value - A new note will not kill the previous notes (default).

      While GS and XG differentiate 1 (Limited Multi for GS/Multi for XG) and 2 (Full Multi for GS/Inst (for Drum)), SpessaSynth treats them both as full Multi. (no note killing is performed)

      This may be useful for emulating SC-55 hi-hat cutoff or MSGS note cutoff.

    • Optionalcc1?: ClearableParameter<MIDIController>

      CC1 for GS controller matrix. An arbitrary MIDI controller, which can be bound to any synthesis parameter. Default is 16.

    • Optionalcc2?: ClearableParameter<MIDIController>

      CC2 for GS controller matrix. An arbitrary MIDI controller, which can be bound to any synthesis parameter. Default is 17.

    • OptionaldrumMap?: ClearableParameter<number>

      Drum map for system exclusive tracking. Only used for selecting the correct channel when setting drum parameters through sysEx, as those don't specify the channel, but the drum number.

      For GS, default is 1 for channel 9 and 0 for all others.

      For XG, default is 2 for channel 9 and 0 for all others.

      Setting this to any value other than 0 turns the channel into a drum channel.

    • OptionaldryLevel?: ClearableParameter<number>

      The dry audio data amount being sent to the output. 127 is full, 0 is none (only effect audio). For example setting dry to 0 and reverb send to 127 results in only reverb. Setting dry to 0 and all sends to 0 effectively mutes the channel.

    • OptionalefxAssign?: ClearableParameter<boolean>

      Indicates whether this channel uses the GS insertion EFX processor.

    • OptionalfineTune?: ClearableParameter<number>

      Cents, RPN/SysEx for fine-tuning. Drum channels ignore this value.

    • OptionalkeyShift?: ClearableParameter<number>

      The key shift of the channel (in semitones). Drum channels ignore this value.

    • OptionalmodulationDepth?: ClearableParameter<number>

      The modulation depth in cents. This is internally converted to a multiplier by dividing by 50.

      The MIDI specification assumes the default modulation depth is 50 cents, but it may vary for different sound banks. For example, if a MIDI requests a modulation depth of 100 cents, the multiplier will be 2, which, for a preset with a depth of 50, will create a total modulation depth of 100 cents.

    • OptionalpitchWheel?: ClearableParameter<number>

      The current pitch wheel value (0-16,383) of this channel.

    • OptionalpitchWheelRange?: ClearableParameter<number>

      The current pitch wheel range, in semitones.

    • OptionalpolyMode?: ClearableParameter<boolean>

      If the channel is in the poly mode.

      • true - POLY ON - regular playback.
      • false - MONO ON - one note per channel, highest still pressed note is restored after releasing the currently playing one.
    • Optionalpressure?: ClearableParameter<number>

      The current pressure (aftertouch) of this channel.

    • OptionalrandomPan?: ClearableParameter<boolean>

      Enables random panning for every note played on this channel.

      Disabled on any pan (CC#10) changes.

    • OptionalrxChannel?: ClearableParameter<number>

      The channel's receiving number (0-based index). This allows triggering multiple parts (channels) with a single note message.

      -1 indicates OFF (no channel).

    • OptionalvelocitySenseDepth?: ClearableParameter<number>

      The relation between the input and the actual velocity.

      If Velocity Depth is increased, small differences in your playing dynamics will make a large difference in the loudness of the sound. If Velocity Depth is decreased, even large differences in your playing dynamics will make only a small difference in the loudness of the sound.

      Examples (with offset being set to normal):

      • 64 is normal.
      • 32 is half velocity at max volume.
      • 127 is max velocity at half volume.
    • OptionalvelocitySenseOffset?: ClearableParameter<number>

      The offset to add to the input velocity.

      If Velocity Offset is set higher than 64, even softly played notes (i.e., notes with a low velocity) will be sounded loudly. If Velocity Offset is set lower than 64, even strongly played notes (i.e., notes with a high velocity) will be sounded softly.

      Examples (with depth set to normal):

      • 64 is normal.
      • 32 is silent until half velocity, max velocity is half volume.
      • 96 starts at half volume and reaches max volume at half velocity.
      • 127 always forces velocity to max.

    The new program of this channel.

    • "clear" - all program changes for this channel are removed.
    • MIDIPatch - clear + sets the new patch according to the MIDI system before the channel's first note-on, re-applying it after every system reset, effectively locking it to the set value.