menghao
Optimize interface layout, improve sentence-based filling, and add transposition function.
82c8054 metadata
title: SoulX Singer Midi Editor
emoji: ๐จ
colorFrom: yellow
colorTo: gray
sdk: docker
app_port: 7860
pinned: false
license: apache-2.0
short_description: Midi Editor for SoulX-Singer
๐น MIDI Editor - Web-based Singing MIDI Editor
A full-featured web MIDI editor for singing voice preprocess. It supports real-time drag editing of MIDI notes, lyric editing, audio waveform alignment, and importing/exporting MIDI files with lyrics.
โจ Features
๐ผ Piano Roll Editing
- Visual note editing: Full range from C1 to C8 with intuitive piano key layout
- Drag operations:
- Move notes: drag note blocks to adjust position and pitch
- Resize start: drag the left edge to adjust start time
- Resize end: drag the right edge to adjust end time
- Quick pitch adjust:
- Command/Ctrl + Up/Down to nudge selected note pitch
- Use the Transpose control in the toolbar to shift all notes at once
- Double-click to add: Add new notes quickly in empty areas
- Piano key preview: Click a key on the left to audition the pitch
๐ Zoom & Navigation
- Horizontal zoom
- Vertical zoom
- Dynamic snapping: finer snap granularity at higher zoom (min 0.01s)
- Auto scroll: keep the playhead visible during playback
๐ Lyric Editing
- Inline editing: edit lyrics for each note in the side list
- Batch fill: enter lyrics and auto-fill notes in order
- Fill from selection: start batch fill from the currently selected note
- Precise fields: edit PITCH, START, and END directly
- Confirm edits: press Enter or click โ to confirm, avoiding accidental changes
๐ต Audio Alignment
- Waveform display: import audio to display waveform, synced with the MIDI timeline
- Formats: MP3, WAV, OGG, FLAC, M4A, AAC
- Sync playback: play audio and MIDI together with independent volume control
- Click to seek: click waveform or timeline to seek
โ ๏ธ Overlap Detection
- Visual highlight: overlapping notes blink in red
- One-click fix: remove all overlaps automatically
๐ฅ Import & Export
- MIDI import: parse standard MIDI files with automatic lyric metadata extraction
- MIDI export: export MIDI files with lyric information
๐จ UI & UX
- Theme toggle: light and dark modes
- Responsive layout: adapts to window size
- SVG grid: cross-browser grid rendering
- Status feedback: real-time state and error tips
๐ Quick Start
Requirements
- Node.js 18+
- npm or yarn
Install
# Install dependencies
npm install
# Start dev server
npm run dev
# Expose to LAN
npm run dev -- --host 0.0.0.0
Build
# Build for production
npm run build
# Preview build
npm run preview
๐ Usage
Basic Workflow
- Import MIDI: click Import MIDI and select a .mid file
- Edit notes: drag notes in the piano roll to adjust time and pitch
- Add lyrics: edit lyrics in the right-side list, or use batch fill
- Align audio (optional): import reference audio for side-by-side editing
- Export: click Export MIDI to save
Shortcuts
| Action | Description |
|---|---|
| Double-click piano roll | Add a new note |
| Double-click note | Edit lyric |
| Drag note | Move note and pitch |
| Drag note edges | Resize note |
| Backspace / Delete | Delete selected note |
| Enter | Confirm value edits |
| Escape | Cancel value edits |
| Ctrl(Command) + Wheel | Horizontal zoom |
| Ctrl(Command) + Shift(Option) + Wheel | Vertical zoom |
Playback Controls
| Button | Description |
|---|---|
| โฎ | Go to start |
| โช | Back 2 seconds |
| โถ / โธ | Play / Pause |
| โฉ | Forward 2 seconds |
| โญ | Go to end |
| Selection | Play selected region |
๐ Tech Stack
- Frontend: React 19 + TypeScript
- Build: Vite 7
- State: Zustand
- Audio: Tone.js
- Waveform: WaveSurfer.js
- MIDI: @tonejs/midi
- Styles: CSS with custom variables
๐ Project Structure
.
โโโ eslint.config.js
โโโ index.html
โโโ package.json
โโโ postcss.config.js
โโโ README.md
โโโ README_CN.md
โโโ tailwind.config.js
โโโ tsconfig.app.json
โโโ tsconfig.json
โโโ tsconfig.node.json
โโโ vite.config.ts
โโโ public/
โโโ src/
โโโ App.css # Main styles (theme variables, layout, components)
โโโ App.tsx # Main app component (transport, import/export, transpose)
โโโ constants.ts # Constants (grid width, row height, pitch range)
โโโ i18n.ts # Internationalization (zh/en translations, smart lyric tokenizer)
โโโ index.css # Global styles (Tailwind, root font, theme gradients)
โโโ main.tsx # React entry point
โโโ types.ts # Type definitions (NoteEvent, TimeSignature, etc.)
โโโ components/
โ โโโ AudioTrack.tsx # Audio waveform display component
โ โโโ LyricTable.tsx # Lyric editing table component
โ โโโ PianoRoll.tsx # Piano roll editor component
โโโ lib/
โ โโโ midi.ts # MIDI import/export utilities (UTF-8 lyric encoding)
โโโ store/
โโโ useMidiStore.ts # Zustand state management