Skip to content

Commit

Permalink
use pow for volume
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Feb 5, 2025
1 parent 2dbb085 commit 7127671
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ async function main() {
});
controls.appendChild(sampleRateElem);

const volumeElem = addVerticalRange({min: 1, max: 100, step: 1, value: g_localSettings.volume }, {
const volumeElem = addVerticalRange({min: 0, max: 100, step: 1, value: g_localSettings.volume }, {
onChange(event) {
g_gainNode.gain.value = event.target.value / 100;
g_gainNode.gain.value = Math.pow(event.target.value / 100, 2);
g_localSettings.volume = parseInt(event.target.value);
saveSettings();
},
Expand Down Expand Up @@ -486,6 +486,7 @@ async function main() {
g_byteBeat.setType(parseInt(t));
g_byteBeat.setExpressionType(parseInt(e));
g_byteBeat.setDesiredSampleRate(parseInt(s));
g_byteBeat.reset();
if (data.v) {
setVisualizerByName(data.v);
}
Expand Down

0 comments on commit 7127671

Please sign in to comment.