Skip to content

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.

The engine runs on a dedicated audio thread separate from the UI. Key components:

ComponentDescription
PlayerSchedules and mixes audio regions for playback
Input CaptureRecords audio from input devices
Live MixerReal-time track mixing with volume, pan, mute, solo
Plugin ChainPer-track AU/CLAP/VST3 plugin processing
MetronomeClick generator synced to tempo and time signature
ClockSample-accurate timing with tick↔sample conversion
Peak MetersPer-track level metering for UI display
Noise/Tone GeneratorBuilt-in test signals for calibration
  1. Create or select an audio track
  2. Arm the track for recording — click the record arm button or use track:toggle-record
  3. Arm transport recording — press R or use transport:toggle-record
  4. Press Space to start recording
  5. Press Space to stop — the recorded audio is saved as a WAV asset and a region is created on the track
CommandDescription
audio:start-recordingStart recording audio on the armed track
audio:stop-recordingStop recording and create the audio region
audio:process-recordingProcess recording buffer (called internally each frame)
PropertyTypeDefaultDescription
recordingboolfalseWhether audio recording is active
armed_track_idu8?NoneTrack armed for recording
samples_recordedi640Number of samples recorded so far
-- Arm track 1 for recording
pl.cmd("track:toggle-record", { track_id = 1 })
-- Arm transport
pl.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")

The recording system uses a lock-free ring buffer to minimize audio thread impact:

  1. Audio thread — Pushes raw samples to a ring buffer (~100ns per callback)
  2. Background thread — Drains the ring buffer and writes to WAV file
  3. 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.

Configure audio devices in Settings > Audio (⌘,):

SettingDescription
Audio InputRecording input device
Audio OutputPlayback output device
Sample RateAudio sample rate (44100, 48000, 96000 Hz, etc.)
Block SizeBuffer size — lower = less latency, higher = more stability
PlatformAudio Backend
macOSCoreAudio (native, lowest latency)
WindowsWASAPI / ASIO
LinuxCPAL fallback

Audio regions reference WAV/AIFF asset files and have sample-accurate positioning:

PropertyTypeDescription
starti64Start position in samples
endi64End position in samples
asset_idstringReferenced audio asset
gainf64Region gain (default 1.0)
panf64Region pan (−1.0 to +1.0)
fade_inf64Fade-in duration
fade_outf64Fade-out duration
warp_enabledboolTime-stretch / warp mode

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 tick

Export your project to an audio file via Project > Bounce (⌘B). The bounce panel lets you configure:

SettingDescription
FormatWAV, AIFF, MP3, AAC
Sample RateOutput sample rate
Bit Depth16-bit, 24-bit, 32-bit float
RangeFull project or selection
NormalizePeak or loudness normalization

Separate a mixed audio file into individual stems using AI-powered source separation.

Open: Create > Split Audio (⌘⇧U)

CommandShortcutDescription
split-audio:toggle-visible⌘⇧UShow/hide the Split Audio panel
split-audio:pick-fileOpen file picker for audio file
split-audio:start-separateStart background separation job
split-audio:poll-jobCheck separation job status
split-audio:download-stemsDownload stems from processing server
split-audio:register-stemRegister a downloaded stem as asset
split-audio:register-stemsRegister all downloaded stems
split-audio:import-stemImport stem into project as track
-- Open split audio panel
pl.cmd("split-audio:toggle-visible")
-- Pick a file and start separation
pl.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.

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 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

Each track supports a plugin chain for real-time audio processing:

Plugin FormatPlatform
AU (Audio Unit)macOS
CLAPAll platforms
VST3All platforms

Plugins are loaded and managed through the plugin host system. See Plugins for details.

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.

  • 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