Skip to content

Commit

Permalink
fix sliders and renderer disabling on animation
Browse files Browse the repository at this point in the history
  • Loading branch information
spessasus committed Jul 9, 2024
1 parent 0eb8202 commit 79d2114
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/website/js/settings_ui/saving/load_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ export async function _loadSettings()
// note falling time
renderer.noteFallingTimeMs = rendererValues.noteFallingTimeMs;
rendererControls.noteTimeSlider.value = rendererValues.noteFallingTimeMs;
rendererControls.noteTimeSlider.dispatchEvent(new Event('input'));
getSpan(rendererControls.noteTimeSlider).innerText = `${rendererValues.noteFallingTimeMs}ms`

// waveform line thickness
rendererControls.analyserThicknessSlider.value = rendererValues.waveformThickness
rendererControls.analyserThicknessSlider.value = rendererValues.waveformThickness;
rendererControls.analyserThicknessSlider.dispatchEvent(new Event('input'));
renderer.lineThickness = rendererValues.waveformThickness;
getSpan(rendererControls.analyserThicknessSlider).innerText = `${rendererValues.waveformThickness}px`;

// fft size (sample size)
let value = rendererValues.sampleSize;
// Math.pow(2, parseInt(rendererControls.analyserFftSlider.value)); we need to invert this
rendererControls.analyserFftSlider.value = Math.log2(value);
rendererControls.analyserFftSlider.dispatchEvent(new Event('input'));
renderer.normalAnalyserFft = value;
renderer.drumAnalyserFft = Math.pow(2, Math.min(15, Math.log2(value) + 2));
renderer.updateFftSize();
Expand All @@ -45,7 +48,8 @@ export async function _loadSettings()
// wave multiplier
renderer.waveMultiplier = rendererValues.amplifier;
rendererControls.waveMultiplierSlizer.value = rendererValues.amplifier;
getSpan(rendererControls.waveMultiplierSlizer).innerText = rendererValues.amplifier;
rendererControls.waveMultiplierSlizer.dispatchEvent(new Event('input'));
getSpan(rendererControls.waveMultiplierSlizer).innerText = rendererValues.amplifier.toString();

// render waveforms
let controls = this.htmlControls.renderer;
Expand Down
2 changes: 1 addition & 1 deletion src/website/js/settings_ui/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ class SpessaSynthSettings

toggleMusicPlayerMode()
{
this.renderer.renderBool = !this.musicMode.visible;
this.musicMode.setVisibility(!this.musicMode.visible, this.renderer.canvas, this.midiKeyboard.keyboard);
this.renderer.renderBool = !this.musicMode.visible;
}

hideTopPart()
Expand Down

0 comments on commit 79d2114

Please sign in to comment.