diff --git a/frontend/src/pages/AudiotrackManager/AudiotrackEditor.tsx b/frontend/src/pages/AudiotrackManager/AudiotrackEditor.tsx index c827ae1..9d4a5d4 100644 --- a/frontend/src/pages/AudiotrackManager/AudiotrackEditor.tsx +++ b/frontend/src/pages/AudiotrackManager/AudiotrackEditor.tsx @@ -487,7 +487,7 @@ const AudiotrackEditor: FC<{ setPrompt: (prompt: string) => void }> = observer(( } } } - const result = globalMessages.map(m => midiMessageToToken(m)).join(''); + const result = (' ' + globalMessages.map(m => midiMessageToToken(m)).join('')).trim(); commonStore.setCompositionSubmittedPrompt(result); setPrompt(result); }}> diff --git a/frontend/src/pages/Composition.tsx b/frontend/src/pages/Composition.tsx index 037c9be..e16e60c 100644 --- a/frontend/src/pages/Composition.tsx +++ b/frontend/src/pages/Composition.tsx @@ -98,6 +98,13 @@ const CompositionPanel: FC = observer(() => { } }, []); + useEffect(() => { + if (!(commonStore.activeMidiDeviceIndex in commonStore.midiPorts)) { + commonStore.setActiveMidiDeviceIndex(-1); + CloseMidiPort(); + } + }, [commonStore.midiPorts]); + const generateNs = (autoPlay: boolean) => { fetch(getServerRoot(port) + '/text-to-midi', { method: 'POST', @@ -270,7 +277,9 @@ const CompositionPanel: FC = observer(() => { content={
{ if (data.optionValue) {