From cb069089c07132240cbdd17775d0033026ce4ca9 Mon Sep 17 00:00:00 2001 From: michalcourson Date: Fri, 5 Dec 2025 18:37:20 -0500 Subject: [PATCH] some ui for #13 --- Assets/web/src/App.js | 89 +++++++++++++--------- Assets/web/src/Components/AutoTuneInfo.js | 81 +++++++++++++++++--- Assets/web/src/Components/MidiNoteInfo.js | 4 +- Assets/web/src/Components/PianoKeyboard.js | 61 ++++++++------- Source/PluginEditor.cpp | 2 +- 5 files changed, 156 insertions(+), 81 deletions(-) diff --git a/Assets/web/src/App.js b/Assets/web/src/App.js index 7a4a894..f925b50 100644 --- a/Assets/web/src/App.js +++ b/Assets/web/src/App.js @@ -53,53 +53,66 @@ function App() {
{/* Left Column */}
-
-
- -
-
- -
-
- -
-
- -
-
-
- -
-
-
-
-
- -
-
- -
+
+
+
+ +
+
+
-
- -
-
- +
+
+ +
+
+ +
-
-
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
-
- -
-
- + +
+
+ +
+
+ +
diff --git a/Assets/web/src/Components/AutoTuneInfo.js b/Assets/web/src/Components/AutoTuneInfo.js index 11066fc..e05a070 100644 --- a/Assets/web/src/Components/AutoTuneInfo.js +++ b/Assets/web/src/Components/AutoTuneInfo.js @@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef } from "react"; import CenterGrowSlider from "./CenterGrowSlider.js"; import AutoTuneDataReceiver from "../DataRecievers/AutoTuneDataReceiver.js"; +import PianoKeyboard from "./PianoKeyboard.js"; // import { Slider } from "@mui/material"; // import { styled } from "@mui/material/styles"; @@ -11,6 +12,8 @@ export default function AutoTuneInfo() { const [inputCents, setInputCents] = useState(0); const [outputCents, setOutputCents] = useState(0); const [autotuneNote, setAutotuneNote] = useState(0); + const [showPopup, setShowPopup] = useState(false); + const [autoTuneKey, setAutoTuneKey] = useState(""); const dataReceiverRef = useRef(null); const isActiveRef = useRef(true); @@ -56,19 +59,73 @@ export default function AutoTuneInfo() { }, []); return ( -
-

- {getCharfromNoteIndex(autotuneNote)} -

-
-
- +
+
+

+ {getCharfromNoteIndex(autotuneNote)} +

+
+
+ +
+
+ +
-
- +
+
+ +
+
diff --git a/Assets/web/src/Components/MidiNoteInfo.js b/Assets/web/src/Components/MidiNoteInfo.js index 077a3c5..1b4516e 100644 --- a/Assets/web/src/Components/MidiNoteInfo.js +++ b/Assets/web/src/Components/MidiNoteInfo.js @@ -31,8 +31,8 @@ export default function MidiNoteInfo() { }, []); return ( -
- +
+
); } diff --git a/Assets/web/src/Components/PianoKeyboard.js b/Assets/web/src/Components/PianoKeyboard.js index ec3f22d..748bb72 100644 --- a/Assets/web/src/Components/PianoKeyboard.js +++ b/Assets/web/src/Components/PianoKeyboard.js @@ -17,8 +17,8 @@ const NOTE_NAMES = [ const WHITE_KEYS = [0, 2, 4, 5, 7, 9, 11]; // C2 = 36, C5 = 72 -const LOWEST_MIDI = 24; -const HIGHEST_MIDI = 84; +// const LOWEST_MIDI = 24; +// const HIGHEST_MIDI = 84; function getNoteName(midi) { const octave = Math.floor(midi / 12) - 1; @@ -30,7 +30,12 @@ function isWhiteKey(midi) { return WHITE_KEYS.includes(midi % 12); } -export default function PianoKeyboard({ heldNotes }) { +export default function PianoKeyboard({ + heldNotes, + LOWEST_MIDI, + HIGHEST_MIDI, + showNoteNames = true, +}) { const heldMap = {}; heldNotes.forEach((n) => (heldMap[n.midi] = n.voice)); @@ -78,11 +83,9 @@ export default function PianoKeyboard({ heldNotes }) {
@@ -123,28 +126,30 @@ export default function PianoKeyboard({ heldNotes }) { borderBottomRightRadius: i === whiteKeys.length - 1 ? 6 : 0, }} > -
- {k.noteName} - {k.held && ( - - {k.voice} - - )} -
+ {showNoteNames && ( +
+ {k.noteName} + {k.held && ( + + {k.voice} + + )} +
+ )}
))}
diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 9d2d38c..296db8e 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -181,7 +181,7 @@ WebViewPluginAudioProcessorEditor::WebViewPluginAudioProcessorEditor(WebViewPlug webComponent->goToURL (WebBrowserComponent::getResourceProviderRoot()); #endif - setSize(800, 390); + setSize(800, 436); startTimerHz(60);