A web-based patch manager and real-time editor for the Korg Monologue synthesizer, featuring bidirectional MIDI communication and a complete hardware-mirrored interface.
- Full Panel UI: All Monologue parameters accessible through web interface
- Real-time Sync: Hardware changes instantly reflected in UI and vice versa
- Invertible Parameters: INT knobs with NORM/INV toggle functionality
- Visual Feedback: Color-coded controls matching hardware design
- Bidirectional Control: Send and receive MIDI CC messages
- Hardware Sync: Turn knobs on Monologue to see UI update in real-time
- Parameter Feedback: Elegant loop prevention for smooth interaction
- SysEx Support: Full program dump encoding/decoding
- Comprehensive Test Suite: Playwright E2E tests for all controls
- MIDI Testing: Mock MIDI environment for reliable automation
- Parameter Validation: Round-trip encode/decode verification
- Hardware Simulation: Test hardware interactions without physical device
- Node.js 18+
- Chrome/Edge browser (for Web MIDI API)
- Korg Monologue (optional for full experience)
-
Clone and install:
git clone <repository-url> cd monolab npm install
-
Set up environment:
cp .env.example .env.local
-
Start development server:
npm run dev
-
Open browser to
http://localhost:3000
npm run docker:dev- Connect your Korg Monologue via USB
- Allow MIDI access when prompted by browser
- Turn knobs on hardware β see UI controls move in real-time
- Adjust UI controls β hear changes on the synthesizer
- Toggle INT knobs between NORM/INV modes for creative modulation
Invertible Parameters (INT Knobs):
- EG and LFO intensity knobs support positive/negative values
- Click NORM/INV toggle to flip parameter sign
- Visual feedback with color changes when inverted
- Hardware integration maintains toggle state
src/
βββ app/ # Next.js app directory
β βββ layout.tsx # Root layout with providers
β βββ page.tsx # Main application page
β βββ api/patches/ # Patch save/load API routes
βββ components/
β βββ Panel.tsx # Main hardware panel component
β βββ PanelWithMIDI.tsx # Panel with MIDI integration
β βββ controlGroups/ # Reusable control components
β β βββ Knob.tsx # Rotary knob control
β β βββ InvertToggle.tsx # NORM/INV toggle button
β β βββ SwitchContainer.tsx # Multi-position switches
β βββ panelSections/ # Hardware section components
β βββ Envelope.tsx # EG section with INT knob
β βββ LFO.tsx # LFO section with INT knob
β βββ Filter.tsx # VCF controls
β βββ VCO1.tsx # VCO1 oscillator
β βββ VCO2.tsx # VCO2 oscillator
β βββ Mixer.tsx # Level controls
βββ lib/
β βββ sysex/ # SysEx encode/decode system
β βββ services/ # Business logic services
β βββ utils/ # Helper utilities
βββ types/ # TypeScript definitions
βββ utils/ # MIDI and conversion utilities
βββ tests/ # Playwright E2E tests
Component Hierarchy:
PanelWithMIDIβPanelβ Section Components β Control Groups- Separation of concerns: MIDI logic separate from UI components
- Reusable control components with consistent interfaces
MIDI System:
simple-midi.ts: Core MIDI communication with feedback preventionmidi-cc.ts: Parameter to MIDI CC mapping and conversionconversions.ts: Value conversion utilities for different parameter types
Test Architecture:
- Comprehensive E2E tests using Playwright
- Mock MIDI can act as a virtual device to send and recieve midi
Parameter Control:
- All Monologue parameters mapped to MIDI CC values
- Bidirectional communication with elegant feedback loop prevention
- Special handling for invertible parameters (EG/LFO intensity)
Key MIDI CCs:
Drive: CC 5 (0-127)
VCO1 Shape: CC 16 (0-127)
VCO2 Pitch: CC 17 (0-127)
VCO1 Mix: CC 32 (0-127)
VCO2 Mix: CC 33 (0-127)
Cutoff: CC 74 (0-127)
Resonance: CC 71 (0-127)
Attack: CC 73 (0-127)
Decay: CC 75 (0-127)
EG INT: CC 25 (0-127, internally -511 to +511)
LFO Rate: CC 76 (0-127)
LFO INT: CC 26 (0-127, internally -511 to +511)
- Complete Hardware Panel UI - All Monologue sections represented
- Bidirectional MIDI Communication - Real-time hardware β software sync
- Invertible INT Knobs - EG/LFO intensity with NORM/INV toggles
- Comprehensive Test Suite - E2E tests for all controls and MIDI interactions
- Parameter Feedback Prevention - Elegant loop prevention for smooth UX
- SysEx System - Full program dump encoding/decoding (foundation)
- Responsive Design - Works on desktop and mobile devices
- Patch Save/Load System - Database integration and persistence
- Hardware Dump Integration - Capture real SysEx from device
- UI Polish - Visual improvements and user experience refinements
Phase 1: Core Patch Management (Next)
- Complete patch save/load functionality
- Hardware program dump capture
- Patch library with search/filter
- Import/export SysEx files
Phase 2: Sharing & Collaboration
- Patch sharing via URLs
- Public patch library
- User accounts and authentication
- Patch versioning and forking
Phase 3: Creative Tools
- Patch randomizer/generator
- Parameter comparison/diff tools
- Patch audition with built-in sequencer
- Advanced categorization and tagging
The Monologue's EG and LFO intensity parameters are invertible, meaning they can have positive or negative values. This is represented in the UI with special INT knobs that have NORM/INV toggle buttons.
Value Range:
- Internal range:
-511to+511(sysex) - MIDI CC range:
0to127(standard) - Visual angle: Same for both positive and negative values
State Management:
- Knob value determines sign:
props.intensity < 0= inverted - Toggle button reflects current state visually
- Clicking toggle flips the sign while preserving magnitude
- Zero value requires knob movement before toggle is visible
Key Design Decisions:
- Separate Components: Toggle button outside knob component for cleaner state management
- Visual Consistency: Same knob angle for +250 and -250 values
- Test IDs: Specific test targeting for reliable automation
- Zero Handling: Toggle only effective when knob is away from center
- Tests move knob away from zero before testing toggle functionality
- Mock MIDI environment simulates hardware interactions
- Specific test IDs ensure reliable element targeting
# Run all E2E tests
npm run test:playwright
# Run tests in UI mode
npm run test:playwright:ui
# Run tests in headed mode (see browser)
npm run test:playwright:headed
# Run specific test file
npm run test:playwright -- tests/midi-cc/intKnobs.spec.ts- Parameter Tests: Verify MIDI CC output for all controls
- Hardware Simulation: Mock MIDI input to test UI updates
- INT Knob Tests: Special tests for invertible parameter functionality
- Visual Tests: Screenshot comparison for UI consistency
# Run SysEx encode/decode tests
npm test
# Run with verbose debug output
MONOLOGUE_SYSEX_TEST_DEBUG=1 npm testCurrent implementation includes foundation for patch management:
- SysEx encoding/decoding system
- Database schema with deduplication
- API endpoints for patch operations
- Validation and safety checks
Next Steps:
- Connect real hardware SysEx capture
- Implement patch library UI
- Add authentication for user patches
- Enable import/export functionality
# Database
DATABASE_URL="postgresql://..."
DIRECT_URL="postgresql://..." # For migrations
# Development
NEXT_PUBLIC_CLASSROOM_MODE="false" # Enables debug features
MONOLOGUE_SYSEX_TEST_DEBUG="1" # Verbose test output- Fork the repository
- Create a feature branch
- Run tests:
npm test && npm run test:playwright - Submit a pull request
- TypeScript with strict mode
- Prettier for formatting
- ESLint for code quality
- Test-driven development for new features
- Update MIDI CC mapping in
midi-cc.ts - Add UI controls in appropriate panel section
- Create E2E tests for the new parameter
- Update documentation
MIT License - see LICENSE file for details.
- Korg for the Monologue synthesizer
- Web MIDI API community
- Next.js and React teams
- Playwright testing framework
The project includes a comprehensive SysEx test suite (roundβtrip encode/decode, full parameter extraction, validation, diff, and safety wrappers).
By default tests run quietly. To enable verbose diagnostic logging for roundβtrip and parameter extraction tests, set an environment variable:
MONOLOGUE_SYSEX_TEST_DEBUG=1 npm test --silentOr for a single run (non watch mode):
MONOLOGUE_SYSEX_TEST_DEBUG=1 npx vitest --runWhat it shows when enabled:
- Roundβtrip parse/encode status per SysEx dump
- Parameter extraction summaries (patch name, drive, key oscillator + filter values)
- Placeholder TODO traces for future extended spec assertions
Leave the flag unset for CI or routine local runs to keep output minimal.
- Place new test files in
src/lib/sysex/tests/. - Import from
src/lib/sysex/index.tswhere possible (public API) instead of deep paths. - If adding large fixture data, store raw dumps under
src/lib/sysex/tests/data/. - Keep noisy inspection logs behind the
MONOLOGUE_SYSEX_TEST_DEBUGgate.
See the full Monolab Functional Specification below for the complete vision.
Monolab is a web-based patch manager and editor for the Korg Monologue, enabling real-time two-way communication between hardware and browser UI.
-
Receive patch from synth
- Request current program from the Monologue (SysEx dump β parsed β displayed in UI).
- Option to save into library.
-
Send patch to synth
- Select stored patch β serialize to SysEx β send to hardware.
- Option to overwrite current buffer or write to a bank slot.
-
UI β Hardware parameter changes
- User tweaks sliders/knobs in the web UI.
- WebMIDI sends CC messages in real-time to the synth.
-
Hardware β UI parameter changes
- User tweaks knobs/faders on the Monologue.
- Monologue sends CC/SysEx parameter updates.
- React state updates β UI instantly reflects hardware changes.
-
Edit patch parameters in UI
- All Monologue parameters exposed as interactive controls.
- Changes saved to current patch state.
-
Save patch to library
- Save current patch with metadata (name, tags, author, version).
- Stored in persistent DB.
-
Load patch from library
- Search/filter patches.
- Load into UI state.
- Option to send to synth immediately.
-
Search & filter patches
- By name, tag, category, or date.
-
Organize patches
- Basic banks/collections support.
-
Export / Import patches
- Export single patch as SysEx.
- Import SysEx file β convert into patch entry.
-
Persistence
- Patches stored in a persistent backend database.
- User library survives refresh and device changes.
- Patch sharing via URL
- Encode SysEx dump in URL-safe format (e.g., Base64 or compressed string).
- Open shared URL β Monolab decodes SysEx β loads patch into editor.
- No login required.
-
Device detection
- List connected MIDI devices.
- User selects Monologue input/output ports.
-
App settings
- Default MIDI port.
- Theme (dark/light mode).
-
Patch versioning
- Save multiple versions of a patch.
- Restore history.
-
Tagging & advanced metadata
- Categorization (e.g., βLeadβ, βBassβ, βFXβ).
- Notes/annotations.
-
Batch export/import
- Export bank as
.syx. - Import full banks.
- Export bank as
-
Patch randomizer
- Generate new sounds with parameter ranges.
-
Patch comparison / diff
- Visualize parameter differences between patches.
-
Patch audition
- Play demo sequence/arpeggiator to preview patch.
- MVP = Real-time patch editing + library with persistence + import/export + URL sharing.
- Phase 2+ = Advanced library tools + randomizer + audition features.
This ensures Monolab starts with core patch management and true bi-directional sync, while enabling easy patch sharing as a core differentiator.