From 87a534fdaa61e7d658cf737deba3285a5757045f Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Thu, 27 Apr 2023 18:22:33 +0300 Subject: [PATCH] Force base MIDI note to be an integer ref #416 --- src/App.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/App.vue b/src/App.vue index bff3ccac..8d8cfc46 100644 --- a/src/App.vue +++ b/src/App.vue @@ -236,6 +236,14 @@ const encodeState = debounce(() => { router.push({ path: getPath(url), query }); }, 200); +watch(baseMidiNote, (newValue) => { + if (isNaN(newValue)) { + baseMidiNote.value = 69; + } else if (Math.round(newValue) != newValue) { + baseMidiNote.value = Math.round(newValue); + } +}); + watch( [ scaleName,