Audio
Plinken’s audio engine provides low-latency recording and playback using your system’s audio hardware. Audio is processed in real time on a dedicated thread with support for multi-track recording, plugin processing, and live monitoring.
Audio Engine Architecture
Section titled “Audio Engine Architecture”The engine runs on a dedicated audio thread separate from the UI. Key components:
| Component | Description |
|---|---|
| Player | Schedules and mixes audio regions for playback |
| Input Capture | Records audio from input devices |
| Live Mixer | Real-time track mixing with volume, pan, mute, solo |
| Plugin Chain | Per-track AU/CLAP/VST3 plugin processing |
| Metronome | Click generator synced to tempo and time signature |
| Clock | Sample-accurate timing with tick↔sample conversion |
| Peak Meters | Per-track level metering for UI display |
| Noise/Tone Generator | Built-in test signals for calibration |
Recording Audio
Section titled “Recording Audio”Step by Step
Section titled “Step by Step”- Create or select an audio track
- Arm the track for recording — click the record arm button or use
track:toggle-record - Arm transport recording — press R or use
transport:toggle-record - Press Space to start recording
- Press Space to stop — the recorded audio is saved as a WAV asset and a region is created on the track
Recording Commands
Section titled “Recording Commands”| Command | Description |
|---|---|
audio:start-recording | Start recording audio on the armed track |
audio:stop-recording | Stop recording and create the audio region |
audio:process-recording | Process recording buffer (called internally each frame) |
Recording Properties
Section titled “Recording Properties”| Property | Type | Default | Description |
|---|---|---|---|
recording | bool | false | Whether audio recording is active |
armed_track_id | u8? | None | Track armed for recording |
samples_recorded | i64 | 0 | Number of samples recorded so far |
Lua Example
Section titled “Lua Example”-- Arm track 1 for recordingpl.cmd("track:toggle-record", { track_id = 1 })
-- Arm transportpl.cmd("transport:toggle-record")
-- Start playback (begins recording on armed tracks)pl.cmd("transport:toggle-play")
-- Later: stop playback (finalizes recording)pl.cmd("transport:toggle-play")Recording Architecture
Section titled “Recording Architecture”The recording system uses a lock-free ring buffer to minimize audio thread impact:
- Audio thread — Pushes raw samples to a ring buffer (~100ns per callback)
- Background thread — Drains the ring buffer and writes to WAV file
- Main thread — Calls
stop_recording()to finalize the asset and region
This architecture keeps the audio callback minimal and glitch-free, even during long recordings.
Audio Settings
Section titled “Audio Settings”Configure audio devices in Settings > Audio (⌘,):
| Setting | Description |
|---|---|
| Audio Input | Recording input device |
| Audio Output | Playback output device |
| Sample Rate | Audio sample rate (44100, 48000, 96000 Hz, etc.) |
| Block Size | Buffer size — lower = less latency, higher = more stability |
Platform Support
Section titled “Platform Support”| Platform | Audio Backend |
|---|---|
| macOS | CoreAudio (native, lowest latency) |
| Windows | WASAPI / ASIO |
| Linux | CPAL fallback |
Audio Regions
Section titled “Audio Regions”Audio regions reference WAV/AIFF asset files and have sample-accurate positioning:
| Property | Type | Description |
|---|---|---|
start | i64 | Start position in samples |
end | i64 | End position in samples |
asset_id | string | Referenced audio asset |
gain | f64 | Region gain (default 1.0) |
pan | f64 | Region pan (−1.0 to +1.0) |
fade_in | f64 | Fade-in duration |
fade_out | f64 | Fade-out duration |
warp_enabled | bool | Time-stretch / warp mode |
Sample ↔ Tick Conversion
Section titled “Sample ↔ Tick Conversion”At default settings (48 kHz, 120 BPM, 960 PPQ):
samples_per_tick = sample_rate × 60 / (tempo × PPQ) = 48000 × 60 / (120 × 960) ≈ 25.0 samples per tickBounce (Export)
Section titled “Bounce (Export)”Export your project to an audio file via Project > Bounce (⌘B). The bounce panel lets you configure:
| Setting | Description |
|---|---|
| Format | WAV, AIFF, MP3, AAC |
| Sample Rate | Output sample rate |
| Bit Depth | 16-bit, 24-bit, 32-bit float |
| Range | Full project or selection |
| Normalize | Peak or loudness normalization |
Split Audio (Stem Separation)
Section titled “Split Audio (Stem Separation)”Separate a mixed audio file into individual stems using AI-powered source separation.
Open: Create > Split Audio (⌘⇧U)
Stem Separation Commands
Section titled “Stem Separation Commands”| Command | Shortcut | Description |
|---|---|---|
split-audio:toggle-visible | ⌘⇧U | Show/hide the Split Audio panel |
split-audio:pick-file | — | Open file picker for audio file |
split-audio:start-separate | — | Start background separation job |
split-audio:poll-job | — | Check separation job status |
split-audio:download-stems | — | Download stems from processing server |
split-audio:register-stem | — | Register a downloaded stem as asset |
split-audio:register-stems | — | Register all downloaded stems |
split-audio:import-stem | — | Import stem into project as track |
Lua Example
Section titled “Lua Example”-- Open split audio panelpl.cmd("split-audio:toggle-visible")
-- Pick a file and start separationpl.cmd("split-audio:pick-file")pl.cmd("split-audio:start-separate")After separation, stems (vocals, drums, bass, other) can be imported as individual tracks for remixing.
Audio to MIDI
Section titled “Audio to MIDI”Convert monophonic audio recordings to MIDI note data using pitch detection. Open from Create > Audio to MIDI. The detected pitches are converted to MIDI regions that you can edit and route to any instrument.
Transcribe
Section titled “Transcribe”Transcribe speech from audio recordings to text using Whisper. Open from Create > Transcribe. Useful for:
- Creating lyrics from vocal takes
- Generating text regions from dialogue
- Adding captions to video projects
Plugin Processing
Section titled “Plugin Processing”Each track supports a plugin chain for real-time audio processing:
| Plugin Format | Platform |
|---|---|
| AU (Audio Unit) | macOS |
| CLAP | All platforms |
| VST3 | All platforms |
Plugins are loaded and managed through the plugin host system. See Plugins for details.
Latency Compensation
Section titled “Latency Compensation”Plinken automatically queries each plugin’s reported latency and stores it per-track (latency_samples). This enables delay compensation when mixing tracks with different plugin chain latencies.
See Also
Section titled “See Also”- Transport — Playback, recording, and tempo controls
- Timeline — Track and region management
- Mixer — Level, pan, and effect controls
- Plugins — Plugin formats and management
- Settings > Audio — Audio device configuration