Overview
The virtual keyboard allows you to play and record MIDI notes using your computer’s QWERTY keyboard. It’s perfect for quick melody sketches, testing sounds, or recording when you don’t have a MIDI controller available.Enabling the Virtual Keyboard
The virtual keyboard is enabled by default. Toggle it on/off programmatically:The virtual keyboard only sends MIDI to tracks with Record Enabled active. Enable recording on your target MIDI track before playing.
Keyboard Layout
The virtual keyboard uses a two-row piano layout:Key Mapping
- White Keys
- Black Keys
Complete Mapping
Control Keys
Octave Shifting
Z Key
Shift down by one octave (-12 semitones)
X Key
Shift up by one octave (+12 semitones)
Velocity Control
C Key
Decrease velocity by 10
V Key
Increase velocity by 10
Playback Control
Spacebar: Start/stop playbackPlaying Notes
The virtual keyboard listens for key presses and sends MIDI events to record-enabled tracks:Multi-Track Recording
The virtual keyboard can send MIDI to multiple tracks simultaneously:Input System Integration
Lumix uses two input systems for keyboard detection:ImGui Input (UI Context)
Veldrid Input (Global Context)
Recording Workflow
Step-by-Step
-
Create a MIDI track
- Add a new MIDI track to your project
- Load a VST instrument for sound
-
Enable recording
- Click the record button on the track header
- The track must have
RecordOnStartenabled
-
Set up your keyboard
- Adjust octave with Z/X keys
- Set desired velocity with C/V keys
-
Start recording
- Press spacebar to start playback
- Play notes on your keyboard
- Notes are recorded in real-time
-
Stop and review
- Press spacebar again to stop
- Review and edit in the piano roll
Best Practices
Latency Compensation
Latency Compensation
If you experience latency between key presses and sound, adjust your audio buffer size in the audio settings. Smaller buffers reduce latency but require more CPU.
Velocity Dynamics
Velocity Dynamics
Since keyboard keys don’t have velocity sensitivity, set velocity before recording:
- Soft passages: 40-70
- Medium dynamics: 80-100
- Loud sections: 110-127
Octave Management
Octave Management
Remember your current octave shift! The info box displays the current offset when you change octaves. Reset to 0 by pressing Z or X until the display shows “Octave shift: 0”.
Avoiding Stuck Notes
Avoiding Stuck Notes
If notes get stuck (continue playing after release):
- Click outside the application window to release all keys
- The virtual keyboard automatically sends note-off events when the mouse is released
Advanced Features
State Tracking
The virtual keyboard tracks whether any key is currently pressed:Automatic Note-Off
Notes are automatically released when focus is lost:Keyboard Shortcuts Reference
| Key | Function | Note |
|---|---|---|
| A-K | Play notes | White and black keys |
| W, E, T, Y, U | Sharp notes | Black keys |
| Z | Octave down | -12 semitones |
| X | Octave up | +12 semitones |
| C | Velocity down | -10 per press |
| V | Velocity up | +10 per press |
| Space | Play/stop | Toggle playback |
Control keys (Z, X, C, V) only work when no musical notes are being held down.
Troubleshooting
No Sound When Playing
- Check that the virtual keyboard is enabled
- Verify record is enabled on at least one MIDI track
- Ensure the track has a VST instrument loaded
- Check track volume and mute status
Keys Not Responding
- Make sure the Lumix window has focus
- Check if another application is capturing keyboard input
- Verify the virtual keyboard is not disabled
Octave Won’t Change
- Release all note keys before pressing Z or X
- The
_isKeyDownflag prevents octave changes during playback
Integration with MIDI Controllers
The virtual keyboard works alongside hardware MIDI controllers. You can use both simultaneously:- Virtual keyboard: Quick melodies and testing
- MIDI controller: Velocity-sensitive performance with sustain pedal
See Also
- MIDI Tracks - Managing MIDI tracks and recording
- Piano Roll - Editing recorded MIDI notes
- MIDI Clips - Working with MIDI clip data
- VST Plugins - Loading instruments for playback