Skip to content

Commit

Permalink
try logging messages to textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcichra committed Jul 24, 2022
1 parent a4c8020 commit c447335
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gui/src/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function Home() {

const [pianoChannel, setPianoChannel] = useState<number>(1);

const [midiLog, setMidiLog] = useState<string>("");

const websocket = useRef<WebSocket>();

const firstNote = MidiNumbers.fromNote("c3");
Expand Down Expand Up @@ -130,6 +132,7 @@ function Home() {
};
websocket.current.onmessage = (event) => {
console.log("Socket Message: ", event.data);
setMidiLog(midiLog + "\n" + event.data)
};
}

Expand Down Expand Up @@ -265,6 +268,9 @@ function Home() {
width={1000}
keyboardShortcuts={keyboardShortcuts}
/>
<textarea id="midilog">
{midiLog}
</textarea>
</div>
</div>
);
Expand Down

0 comments on commit c447335

Please sign in to comment.