From 5e3bd47b42c3d758c0cd753a51f857174a167c00 Mon Sep 17 00:00:00 2001 From: Sotiri Bakagiannis Date: Mon, 26 Jul 2021 12:22:39 +0100 Subject: [PATCH] sound/TonePlayer: use gain to db when instantiating volume node --- src/sound/TonePlayer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sound/TonePlayer.js b/src/sound/TonePlayer.js index f11760c..f06c2c4 100644 --- a/src/sound/TonePlayer.js +++ b/src/sound/TonePlayer.js @@ -332,7 +332,8 @@ export class TonePlayer extends SoundPlayer this._synth = new Tone.Synth(this._synthOtions); // connect it to a volume node: - this._volumeNode = new Tone.Volume(-60 + this._volume * 66); + this._volumeNode = new Tone.Volume(Tone.gainToDb(this._volume)); + this._synth.connect(this._volumeNode); // connect the volume node to the master output: