Guides for developers
GitHub repositoryHomepage
  • Getting started
  • Core
    • Glossary
    • The structure of the LMMS core
      • Initializations and cleanups
        • For core
      • Accessing to core classes
    • The structure of an LMMS project
    • Tracks and track containers
      • Tracks and clips
      • Track containers
    • The pattern system
    • Play handles
      • NotePlayHandle
      • InstrumentPlayHandle
      • SamplePlayHandle
    • Instruments
      • The type of instruments
      • Processing in instruments
        • Per-note processing
    • Audio effects
    • Automation and controllers
      • Automation
        • Processing automation
      • Controllers
    • Controlling playback
    • The audio rendering engine of LMMS
      • Stage 1: collect play handles and process automation
      • Stage 2: render notes and instruments
      • Step 3: mix and master
    • Threading and synchronization
    • Data serialization
      • Overview
      • Relevant classes
      • Upgrading data files
    • Internal routing of events and signals
      • Audio signals
      • MIDI events
    • Audio and MIDI I/O
      • Supported backends and features
  • GUI
    • The initialization process of LMMS GUI
    • UI components of LMMS
  • Build system
    • CMake and LMMS
    • Source directory structure
    • Useful variables/macros
  • Plugin system
    • Plugin types
    • Plugin API
      • Sub-plugin API
    • Loading plugins from LMMS
  • Unit tests
    • Writing unit tests
Powered by GitBook
On this page
  • Audio engine and audio rendering
  • Mixer worker threads

Was this helpful?

  1. Core

The audio rendering engine of LMMS

Audio engine and audio rendering

LMMS has a class for audio rendering, named AudioEngine. AudioEngine::renderNextBuffer contains the main functionality of AudionEngine. Major works that the function does:

  1. Remove all finished PlayHandles

  2. Call Song::processNextBuffer to play songs and add PlayHandles

  3. Queue jobs for AudioEngineWorkerThread and wait for worker threads (PlayHandle, effects in instrument tracks/sample tracks, FX mixing)

  4. Call runChangesInModel to process pending non-automated changes

Mixer worker threads

AudioEngineWorkerThread processes ThreadableJobs queued in AudioEngine::renderNextBuffer. There are three kinds of jobs that AudioEngineWorkerThread runs.

  • AudioPort: Processes intermediate audio signals(Currently used for audio effects for tracks)

  • FxChannel: Processes audio effects per FX channel

  • PlayHandle: Plays notes/instruments/audio samples

PreviousControlling playbackNextStage 1: collect play handles and process automation

Last updated 2 years ago

Was this helpful?