diff --git a/src/components/subeditors/sequencer.tsx b/src/components/subeditors/sequencer.tsx index c982d3a3b..bd9790523 100644 --- a/src/components/subeditors/sequencer.tsx +++ b/src/components/subeditors/sequencer.tsx @@ -136,6 +136,19 @@ export default function SequencerEditor(props: EditorProps) { const preventContextMenu = (event: MouseEvent) => { event.preventDefault(); } window.addEventListener('contextmenu', preventContextMenu) + /** + * Clear the sequencer editor. + * This function: + * - Clears the cells from the sequencer + * - Sets the lastDraw (used for drawing lines) to null + * - Clears the text in the editor + */ + const clearSequencer = () => { + cells.value = {}; // Remove all cells from the sequencer + lastDraw.value = null; // Reset the draw cursor + props.text.value = ""; // Clear the text in the editor + } + // Sync text changes with cells useSignalEffect(() => { const newCells = tuneToCells(textToTune(props.text.value)) @@ -196,6 +209,15 @@ export default function SequencerEditor(props: EditorProps) { beat.value = 0 }} /> +