From ce93214e43c04db06b7cb19fbd65c16b64613065 Mon Sep 17 00:00:00 2001 From: Yotam Mann Date: Tue, 24 Sep 2019 22:41:58 -0400 Subject: [PATCH] using OnePoleFilter in LowpassCombFilter and PluckSynth means an API change since dampening is no longer a signal rate parameter --- CHANGELOG.md | 4 +++- .../filter/LowpassCombFilter.test.ts | 2 +- Tone/component/filter/LowpassCombFilter.ts | 23 +++++++++++-------- Tone/instrument/PluckSynth.test.ts | 6 ++--- Tone/instrument/PluckSynth.ts | 20 +++++++++------- package.json | 2 +- 6 files changed, 33 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 400993c4..38d0c60d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 14.3.0 +### 14.4.0 * **Converted to typescript!!! (WIP)** * Input/Outputs are no longer arrays. @@ -9,6 +9,8 @@ * PolySynth does not require a polyphony value. * Voice allocation and disposing is done automatically based on demand. * MetalSynth and MembraneSynth extends Monophonic enabling them to be used in PolySynth +* OnePoleFilter is a 6b-per-octave lowpass or highpass filter + * Using OnePoleFilter in PluckSynth and LowpassCombFilter ### 13.8.25 diff --git a/Tone/component/filter/LowpassCombFilter.test.ts b/Tone/component/filter/LowpassCombFilter.test.ts index fa6a87f3..0b107c4b 100644 --- a/Tone/component/filter/LowpassCombFilter.test.ts +++ b/Tone/component/filter/LowpassCombFilter.test.ts @@ -19,7 +19,7 @@ describe("LowpassCombFilter", () => { }); expect(lpcf.delayTime.value).to.be.closeTo(0.2, 0.001); expect(lpcf.resonance.value).to.be.closeTo(0.3, 0.001); - expect(lpcf.dampening.value).to.be.closeTo(2400, 0.001); + expect(lpcf.dampening).to.be.closeTo(2400, 0.001); lpcf.dispose(); }); diff --git a/Tone/component/filter/LowpassCombFilter.ts b/Tone/component/filter/LowpassCombFilter.ts index 993d04e1..1f0126b4 100644 --- a/Tone/component/filter/LowpassCombFilter.ts +++ b/Tone/component/filter/LowpassCombFilter.ts @@ -3,9 +3,9 @@ import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../. import { Frequency, NormalRange, Time } from "../../core/type/Units"; import { optionsFromArguments } from "../../core/util/Defaults"; import { RecursivePartial } from "../../core/util/Interface"; -import { Signal } from "../../signal/Signal"; import { FeedbackCombFilter } from "./FeedbackCombFilter"; import { Filter } from "./Filter"; +import { OnePoleFilter } from "./OnePoleFilter"; interface LowpassCombFilterOptions extends ToneAudioNodeOptions { delayTime: Time; @@ -29,18 +29,13 @@ export class LowpassCombFilter extends ToneAudioNode { /** * The lowpass filter */ - private _lowpass: Filter; + private _lowpass: OnePoleFilter; /** * The delayTime of the comb filter. */ readonly delayTime: Param