How to use the standardized-audio-context.IIRFilterNode function in standardized-audio-context

To help you get started, we’ve selected a few standardized-audio-context examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vitaliy-bobrov / js-rocks / src / app / audio / effects / muff.ts View on Github external
model: string,
    protected defaults: MuffSettings,
    tunings: MuffTuningOptions
  ) {
    super(context, model);

    this.tunings = { ...Muff.defaultTunings, ...tunings };

    // Boost stage - pre-filtering + boost gain.
    this.boostNode = new GainNode(context, {
      gain: dBToGain(this.tunings.boost)
    });

    const preRange = this.tunings.preFilterRange;

    this.preHighpass = new IIRFilterNode(context, {
      ...onePoleHighpass(preRange[0], context.sampleRate)
    });

    this.preLowpass = new IIRFilterNode(context, {
      ...onePoleLowpass(preRange[1], context.sampleRate)
    });

    // Double clipping stage.
    this.waveSharper1Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });
    this.waveSharper2Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });

    const postRange = this.tunings.postFilterRanges;
github vitaliy-bobrov / js-rocks / src / app / audio / effects / muff.ts View on Github external
});

    // Double clipping stage.
    this.waveSharper1Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });
    this.waveSharper2Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });

    const postRange = this.tunings.postFilterRanges;
    this.postLowpass1Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[0], context.sampleRate)
    });

    this.postHighpass1Stage = new IIRFilterNode(context, {
      ...onePoleLowpass(postRange[1], context.sampleRate)
    });

    this.postLowpass2Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[2], context.sampleRate)
    });

    this.postHighpass2Stage = new IIRFilterNode(context, {
      ...onePoleLowpass(postRange[3], context.sampleRate)
    });

    // Equalization stage.
    this.toneNode = new MixedTone(context, this.tunings.toneRange);

    // Output stage.
    this.levelNode = context.createGain();
github vitaliy-bobrov / js-rocks / src / app / audio / effects / muff.ts View on Github external
super(context, model);

    this.tunings = { ...Muff.defaultTunings, ...tunings };

    // Boost stage - pre-filtering + boost gain.
    this.boostNode = new GainNode(context, {
      gain: dBToGain(this.tunings.boost)
    });

    const preRange = this.tunings.preFilterRange;

    this.preHighpass = new IIRFilterNode(context, {
      ...onePoleHighpass(preRange[0], context.sampleRate)
    });

    this.preLowpass = new IIRFilterNode(context, {
      ...onePoleLowpass(preRange[1], context.sampleRate)
    });

    // Double clipping stage.
    this.waveSharper1Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });
    this.waveSharper2Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });

    const postRange = this.tunings.postFilterRanges;
    this.postLowpass1Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[0], context.sampleRate)
    });
github vitaliy-bobrov / js-rocks / src / app / audio / effects / muff.ts View on Github external
oversample: '4x'
    });
    this.waveSharper2Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });

    const postRange = this.tunings.postFilterRanges;
    this.postLowpass1Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[0], context.sampleRate)
    });

    this.postHighpass1Stage = new IIRFilterNode(context, {
      ...onePoleLowpass(postRange[1], context.sampleRate)
    });

    this.postLowpass2Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[2], context.sampleRate)
    });

    this.postHighpass2Stage = new IIRFilterNode(context, {
      ...onePoleLowpass(postRange[3], context.sampleRate)
    });

    // Equalization stage.
    this.toneNode = new MixedTone(context, this.tunings.toneRange);

    // Output stage.
    this.levelNode = context.createGain();

    this.processor = [
      this.boostNode,
      this.preLowpass,
github vitaliy-bobrov / js-rocks / src / app / audio / effects / muff.ts View on Github external
});

    const postRange = this.tunings.postFilterRanges;
    this.postLowpass1Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[0], context.sampleRate)
    });

    this.postHighpass1Stage = new IIRFilterNode(context, {
      ...onePoleLowpass(postRange[1], context.sampleRate)
    });

    this.postLowpass2Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[2], context.sampleRate)
    });

    this.postHighpass2Stage = new IIRFilterNode(context, {
      ...onePoleLowpass(postRange[3], context.sampleRate)
    });

    // Equalization stage.
    this.toneNode = new MixedTone(context, this.tunings.toneRange);

    // Output stage.
    this.levelNode = context.createGain();

    this.processor = [
      this.boostNode,
      this.preLowpass,
      this.preHighpass,
      this.waveSharper1Stage,
      this.postLowpass1Stage,
      this.postHighpass1Stage,
github vitaliy-bobrov / js-rocks / src / app / audio / effects / muff.ts View on Github external
});

    this.preLowpass = new IIRFilterNode(context, {
      ...onePoleLowpass(preRange[1], context.sampleRate)
    });

    // Double clipping stage.
    this.waveSharper1Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });
    this.waveSharper2Stage = new WaveShaperNode(context, {
      oversample: '4x'
    });

    const postRange = this.tunings.postFilterRanges;
    this.postLowpass1Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[0], context.sampleRate)
    });

    this.postHighpass1Stage = new IIRFilterNode(context, {
      ...onePoleLowpass(postRange[1], context.sampleRate)
    });

    this.postLowpass2Stage = new IIRFilterNode(context, {
      ...onePoleHighpass(postRange[2], context.sampleRate)
    });

    this.postHighpass2Stage = new IIRFilterNode(context, {
      ...onePoleLowpass(postRange[3], context.sampleRate)
    });

    // Equalization stage.
github vitaliy-bobrov / js-rocks / src / app / audio / effects / tone.ts View on Github external
constructor(context: AudioContext, range: [number, number] = [550, 1000]) {
    this.splitter = new ChannelSplitterNode(context);

    this.lowpassFilter = new IIRFilterNode(context, {
      ...onePoleLowpass(range[0], context.sampleRate)
    });

    this.toneLowGain = new GainNode(context);

    this.highpassFilter = new IIRFilterNode(context, {
      ...onePoleHighpass(range[1], context.sampleRate)
    });

    this.toneHighGain = new GainNode(context);
    this.merger = new ChannelMergerNode(context);

    this.splitter
      .connect(this.highpassFilter)
      .connect(this.toneHighGain)
      .connect(this.merger, 0, 1);
  }
github vitaliy-bobrov / js-rocks / src / app / audio / effects / tone.ts View on Github external
constructor(context: AudioContext, range: [number, number] = [550, 1000]) {
    this.splitter = new ChannelSplitterNode(context);

    this.lowpassFilter = new IIRFilterNode(context, {
      ...onePoleLowpass(range[0], context.sampleRate)
    });

    this.toneLowGain = new GainNode(context);

    this.highpassFilter = new IIRFilterNode(context, {
      ...onePoleHighpass(range[1], context.sampleRate)
    });

    this.toneHighGain = new GainNode(context);
    this.merger = new ChannelMergerNode(context);

    this.splitter
      .connect(this.highpassFilter)
      .connect(this.toneHighGain)
      .connect(this.merger, 0, 1);