Skip to content

Commit

Permalink
gswaFxWaveShaper: oversample
Browse files Browse the repository at this point in the history
  • Loading branch information
mr21 committed May 1, 2024
1 parent 9e380fc commit 09d4606
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gswaFxWaveShaper/gswaFxWaveShaper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand All @@ -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 ) {
}
Expand Down

0 comments on commit 09d4606

Please sign in to comment.