From 09d4606f5cd33cee42d9fbb2991514c6f53144c5 Mon Sep 17 00:00:00 2001 From: mr21 Date: Wed, 1 May 2024 20:47:47 +0200 Subject: [PATCH] gswaFxWaveShaper: oversample --- gswaFxWaveShaper/gswaFxWaveShaper.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gswaFxWaveShaper/gswaFxWaveShaper.js b/gswaFxWaveShaper/gswaFxWaveShaper.js index fc324b1..209772f 100644 --- a/gswaFxWaveShaper/gswaFxWaveShaper.js +++ b/gswaFxWaveShaper/gswaFxWaveShaper.js @@ -32,7 +32,6 @@ class gswaFxWaveShaper { this.#input = ctx.createGain(); this.#output = ctx.createGain(); this.#shaper = ctx.createWaveShaper(); - this.#shaper.oversample = "4x"; // "none|2x|4x" this.$toggle( this.#enable ); this.$change( this.#data ); } @@ -51,10 +50,13 @@ class gswaFxWaveShaper { } $change( obj ) { GSUdiffAssign( this.#data, obj ); - if ( "curve" in obj ) { + if ( obj.curve ) { this.#dotlineSVG.$setCurve( this.#data.curve ); this.#shaper.curve = this.#dotlineSVG.$getCurveFloat32( 512 ); } + if ( obj.oversample ) { + this.#shaper.oversample = obj.oversample; + } } $liveChange( prop, val ) { }