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

English | ็ฎ€ไฝ“ไธญๆ–‡

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.

MIDI Editor TypeScript Vite

โœจ 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

  1. Import MIDI: click Import MIDI and select a .mid file
  2. Edit notes: drag notes in the piano roll to adjust time and pitch
  3. Add lyrics: edit lyrics in the right-side list, or use batch fill
  4. Align audio (optional): import reference audio for side-by-side editing
  5. 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