From 78452c65d22295e40c54f66f653024ea84bdc361 Mon Sep 17 00:00:00 2001 From: Yotam Mann Date: Mon, 14 Dec 2020 18:43:40 -0500 Subject: [PATCH] making sure that the decibel values are propagated through to the filter fixes #807 --- Tone/component/filter/BiquadFilter.ts | 5 +++-- Tone/component/filter/Filter.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tone/component/filter/BiquadFilter.ts b/Tone/component/filter/BiquadFilter.ts index db5644bd..a52c5671 100644 --- a/Tone/component/filter/BiquadFilter.ts +++ b/Tone/component/filter/BiquadFilter.ts @@ -47,7 +47,7 @@ export class BiquadFilter extends ToneAudioNode { /** * The gain of the filter. Its value is in dB units. The gain is only used for lowshelf, highshelf, and peaking filters. */ - readonly gain: Param<"gain">; + readonly gain: Param<"decibels">; private readonly _filter: BiquadFilterNode; @@ -87,7 +87,8 @@ export class BiquadFilter extends ToneAudioNode { this.gain = new Param({ context: this.context, - units: "gain", + units: "decibels", + convert: false, value: options.gain, param: this._filter.gain, }); diff --git a/Tone/component/filter/Filter.ts b/Tone/component/filter/Filter.ts index 2d18b37f..358b0911 100644 --- a/Tone/component/filter/Filter.ts +++ b/Tone/component/filter/Filter.ts @@ -90,6 +90,7 @@ export class Filter extends ToneAudioNode { this.gain = new Signal({ context: this.context, units: "decibels", + convert: false, value: options.gain, }); this._type = options.type;