remove dynamic updates since WX info is not updated

This commit is contained in:
2025-12-29 19:23:24 +02:00
parent 8bf5a4dacd
commit ef3343cf62
2 changed files with 41 additions and 89 deletions

View File

@@ -237,9 +237,36 @@
sequence = null;
}
// Set transport BPM
// Set all audio parameters once (static until page refresh)
Tone.getTransport().bpm.value = bpm;
if (reverb) {
reverb.wet.value = reverbWet;
}
if (delay) {
const delayTimeSeconds = Tone.Time(delayTime).toSeconds();
delay.delayTime.value = delayTimeSeconds;
delay.feedback.value = delayFeedback;
}
if (filter) {
filter.frequency.value = filterCutoff;
filter.Q.value = filterResonance;
}
if (gain) {
gain.gain.value = Tone.dbToGain(volume);
}
if (arpSynth) {
arpSynth.volume.value = arpVolume;
}
if (pingSynth) {
pingSynth.volume.value = pingVolume;
}
sequence = new Tone.Sequence(
(time: number, chord) => {
if (synth && chord) {
@@ -390,55 +417,7 @@
}
};
// Reactive updates for environmental parameters using effects
$effect(() => {
if (reverb && isInitialized) {
reverb.wet.rampTo(reverbWet, 0.5);
}
});
// Memoize delay time conversion to avoid repeated calculations
const delayTimeSeconds = $derived.by(() => {
return Tone.Time(delayTime).toSeconds();
});
$effect(() => {
if (delay && isInitialized) {
delay.delayTime.rampTo(delayTimeSeconds, 0.5);
delay.feedback.rampTo(delayFeedback, 0.5);
}
});
$effect(() => {
if (filter && isInitialized) {
filter.frequency.rampTo(filterCutoff, 1.0);
filter.Q.rampTo(filterResonance, 1.0);
}
});
$effect(() => {
if (gain && isInitialized) {
gain.gain.rampTo(Tone.dbToGain(volume), 0.1);
}
});
$effect(() => {
if (isPlaying && isInitialized) {
Tone.getTransport().bpm.rampTo(bpm, 1.0);
}
});
$effect(() => {
if (arpSynth && isInitialized) {
arpSynth.volume.rampTo(arpVolume, 0.5);
}
});
$effect(() => {
if (pingSynth && isInitialized) {
pingSynth.volume.rampTo(pingVolume, 0.5);
}
});
// Audio parameters are set once on playback start and remain static
// Lifecycle
onMount(() => {