How to use the standardized-audio-context.BiquadFilterNode 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 / distortion.ts View on Github external
// Boost stage - pre-filtering.

    const bandpassParams = calculateBandpass(this.tunings.preFilterRange);
    this.preFilter = new BiquadFilterNode(context, {
      type: 'bandpass',
      Q: bandpassParams.q,
      frequency: bandpassParams.fc
    });

    // Clipping stage.
    this.waveSharper = new WaveShaperNode(context, {
      oversample: '4x'
    });

    this.postFilter = new BiquadFilterNode(context, {
      type: 'lowpass',
      Q: Math.SQRT1_2,
      frequency: this.tunings.postFilter
    });

    // Equalization stage.
    if (this.tunings.toneControlType === 'standard') {
      this.toneNode = new StandardTone(context, this.tunings.toneRange);
    }

    if (this.tunings.toneControlType === 'mixed') {
      this.toneNode = new MixedTone(context, this.tunings.toneRange);
    }

    // Output stage.
    this.levelNode = new GainNode(context);
github vitaliy-bobrov / js-rocks / src / app / audio / effects / distortion.ts View on Github external
constructor(
    context: AudioContext,
    model: string,
    protected defaults: DistortionSettings,
    tunings: DistortionTuningOptions
  ) {
    super(context, model);

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

    // Boost stage - pre-filtering.

    const bandpassParams = calculateBandpass(this.tunings.preFilterRange);
    this.preFilter = new BiquadFilterNode(context, {
      type: 'bandpass',
      Q: bandpassParams.q,
      frequency: bandpassParams.fc
    });

    // Clipping stage.
    this.waveSharper = new WaveShaperNode(context, {
      oversample: '4x'
    });

    this.postFilter = new BiquadFilterNode(context, {
      type: 'lowpass',
      Q: Math.SQRT1_2,
      frequency: this.tunings.postFilter
    });
github vitaliy-bobrov / js-rocks / src / app / audio / effects / tone.ts View on Github external
constructor(
    context: AudioContext,
    private range: [number, number] = [350, 10000]
  ) {
    this.filter = new BiquadFilterNode(context, {
      type: 'lowpass',
      Q: Math.SQRT1_2
    });
  }
github vitaliy-bobrov / js-rocks / src / app / audio / effects / cabinet.ts View on Github external
this.defaults.gain = gain;

    this.bassNode = new BiquadFilterNode(context, {
      type: 'lowshelf',
      frequency: 320,
      gain: 0
    });

    this.midNode = new BiquadFilterNode(context, {
      type: 'peaking',
      Q: Math.SQRT1_2,
      frequency: 1000,
      gain: 0
    });

    this.trebleNode = new BiquadFilterNode(context, {
      type: 'highshelf',
      frequency: 3200,
      gain: 0
    });

    buffer$.subscribe(buffer => {
      this.convolver.buffer = buffer;
    });

    this.processor = [
      this.convolver,
      this.makeUpGain,
      this.bassNode,
      this.midNode,
      this.trebleNode
    ];
github vitaliy-bobrov / js-rocks / src / app / audio / effects / cabinet.ts View on Github external
constructor(
    context: AudioContext,
    model: string,
    buffer$: Observable,
    gain: number,
    private maxGain: number
  ) {
    super(context, model);

    this.convolver = new ConvolverNode(context);
    this.makeUpGain = new GainNode(context, { gain });
    this.defaults.gain = gain;

    this.bassNode = new BiquadFilterNode(context, {
      type: 'lowshelf',
      frequency: 320,
      gain: 0
    });

    this.midNode = new BiquadFilterNode(context, {
      type: 'peaking',
      Q: Math.SQRT1_2,
      frequency: 1000,
      gain: 0
    });

    this.trebleNode = new BiquadFilterNode(context, {
      type: 'highshelf',
      frequency: 3200,
      gain: 0
github vitaliy-bobrov / js-rocks / src / app / audio / effects / cabinet.ts View on Github external
gain: number,
    private maxGain: number
  ) {
    super(context, model);

    this.convolver = new ConvolverNode(context);
    this.makeUpGain = new GainNode(context, { gain });
    this.defaults.gain = gain;

    this.bassNode = new BiquadFilterNode(context, {
      type: 'lowshelf',
      frequency: 320,
      gain: 0
    });

    this.midNode = new BiquadFilterNode(context, {
      type: 'peaking',
      Q: Math.SQRT1_2,
      frequency: 1000,
      gain: 0
    });

    this.trebleNode = new BiquadFilterNode(context, {
      type: 'highshelf',
      frequency: 3200,
      gain: 0
    });

    buffer$.subscribe(buffer => {
      this.convolver.buffer = buffer;
    });
github vitaliy-bobrov / js-rocks / src / app / audio / effects / tuner / tuner.ts View on Github external
constructor(
    context: AudioContext,
    model: string,
    protected defaults: Active
  ) {
    super(context, model);

    this.preHPFilter = new BiquadFilterNode(context, {
      type: 'highpass',
      Q: Math.SQRT1_2,
      frequency: 20
    });

    this.analyserNode = new AnalyserNode(context, {
      fftSize: 4096
    });

    this.processor = [this.preHPFilter, this.analyserNode];
    connectNodes(this.processor);
    this.applyDefaults();

    this.worker = new Worker('./tuner.worker', { type: 'module' });
    this.worker.onmessage = ({ data }: TunerResponseMessage) => {
      if (this.isBypassEnabled) {