spessasynth_core documentation
    Preparing search index...

    Interface XGVariationBlock

    The Variation section provides a wealth of additional effects. It features some of the same effects found in the Reverb, Chorus and Insertion sections. This is not mere redundancy; it allows you to use two types of Reverb, Chorus or other effects on different Voices.

    The Variation section of effects can be applied either to a single selected Part or to all Parts, depending on the connection setting: Insertion or System.

    This is a Yamaha XG-compatible variation interface.

    It is used when GlobalMIDIParameter.system is xg.

    SpessaSynthProcessor allows you to supply a custom variation block. A custom variation block must implement this interface.

    Editing the parameters can be done via XG system exclusive messages.

    interface XGVariationBlock {
        insertionMode: boolean;
        pan: number;
        partNumber: number;
        return: number;
        sendToChorus: number;
        sendToReverb: number;
        getType(): number;
        process(
            inputLeft: Float32Array,
            inputRight: Float32Array,
            outputLeft: Float32Array,
            outputRight: Float32Array,
            chorusLeft: Float32Array,
            chorusRight: Float32Array,
            reverbLeft: Float32Array,
            reverbRight: Float32Array,
            startIndex: number,
            sampleCount: number,
        ): void;
        processInsertion(
            inputLeft: Float32Array,
            inputRight: Float32Array,
            sampleCount: number,
        ): void;
        reset(): void;
        setParameter(param: number, value: number): void;
        setType(type: number): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    insertionMode: boolean

    Indicates if variation is in the insertion mode (CONNECTION). If false, then variation is in the system mode.

    The two connection modes work as following:

    • system routes all channels via sends (like reverb and chorus).
    • insertion routes a single partNumber channel straight through. Note that variation is processed last, after all insertion effects.
    pan: number

    The stereo panning of this effect. 1 is hard left, 64 is center, 127 is hard right.

    partNumber: number

    The channel routed through the insertion effect, 0-based.

    127 or a value that's above the current channel count means OFF.

    return: number

    The return (level) of the effect. 0 is silence (-Inf dB), 64 is normal (0 dB) and 127 is double the volume (+6 dB).

    sendToChorus: number

    The amount of variation being sent to the chorus effect.

    0 is none, 64 is 100% and 127 is 200%.

    sendToReverb: number

    The amount of variation being sent to the reverb effect.

    0 is none, 64 is 100% and 127 is 200%.

    • Process the effect in system mode and adds it to the output. Feeds the chorus and reverb buffers according to the send amounts. The DSP's wet is fixed at 100% in this case.

      Parameters

      • inputLeft: Float32Array

        The input buffer to process. It always starts at index 0.

      • inputRight: Float32Array

        The input buffer to process. It always starts at index 0.

      • outputLeft: Float32Array

        The left output buffer.

      • outputRight: Float32Array

        The right output buffer.

      • chorusLeft: Float32Array

        The left chorus send buffer. It always starts at index 0.

      • chorusRight: Float32Array

        The right chorus send buffer. It always starts at index 0.

      • reverbLeft: Float32Array

        The left reverb send buffer. It always starts at index 0.

      • reverbRight: Float32Array

        The right reverb send buffer. It always starts at index 0.

      • startIndex: number

        The index to start mixing at into the output buffers.

      • sampleCount: number

        The amount of samples to mix. This will never be larger than SynthProcessorOptions.maxBufferSize of the parent SpessaSynthProcessor instance.

      Returns void