Q Light Controller+ Documentation

repository·master·Indexed 23 days ago

https://github.com/mcallegari/qlcplus

An open-source software suite for controlling lighting fixtures via DMX, Art-Net, sACN, MIDI, OSC, HID, and OS2L. Designed for live performance and architectural lighting, it supports Linux, Windows (10+), macOS (10.12+), and Raspberry Pi. The documentation covers core engine components including the Audio class for playback, the BeatTracker for tempo estimation, ChannelsGroup for DMX channel management, and the Collection class for managing sets of functions.

Tokens
9.7K
Snippets
9
Records
55
Agent score
81%

What's inside QLC+

  1. Overview of Q Light Controller+ (QLC+)

    master

    QLC+ is an open-source lighting control software designed for live shows, theatre, architectural installations, and venues. It provides a user-friendly interface to control a wide variety of lighting hardware using multiple protocols.

    Supported Platforms:

    • Linux
    • Windows (10+)
    • macOS (10.12+)
    • Raspberry Pi
  2. How the BeatTracker works in QLC+

    master

    The BeatTracker is a C++ implementation of a beat-tracking algorithm that adapts to QLC+'s AudioCapture contract. It processes interleaved int16 PCM input and provides two main outputs: a boolean indicating if a beat occurred (driving beatDetected()) and a BPM estimate via the bpm() getter.

    The system consists of two main stages connected by an onset-strength stream:

    1. BeatOnsetExtractor: Processes audio in 512-sample hops. It uses a 4096-sample Hann window FFT, analyzes energy increases across three frequency bands (low, mid, high), and applies per-band saturation to ensure backbeats (like kick/snare alternation) are detected reliably.
    2. AutoBpmDetector: Analyzes the onset stream every 2 seconds of audio time using an 8-second window. It uses unbiased autocorrelation and a harmonic comb score on a fractional BPM grid (50–240 BPM) to estimate tempo. A temporal belief filter and an 'octave-raise walk' are used to ensure stability and resolve octave ambiguities.

    Instead of reacting to individual onsets, the tracker emits beats based on a predicted beat grid, which ensures steady output even on syncopated material.

    /* 
    Conceptual flow:
    int16 PCM blocks -> BeatOnsetExtractor -> onset value per 512-sample hop
                                                  |
                                                  v
                                           AutoBpmDetector -> BPM estimate, 
                                                             confidence, 
                                                             predicted beat grid
    */
  3. BeatTracker behavior and performance characteristics

    master

    When integrating or using the BeatTracker, expect the following behaviors:

    • Initialization Time: The first BPM estimate typically appears after ~4 seconds of music. It is usually accurate within 4–8 seconds.
    • Tempo Changes: If the live tempo changes, the tracker takes approximately 12–16 seconds to re-lock. This delay is a trade-off for the stability provided by the belief filter and median-of-3 reporting.
    • Octave Limits: Material dominated by 8th-note energy (e.g., heavy hi-hat patterns) may occasionally be read as an octave higher than the actual tempo.
    • Silence Handling: During silence, the onset stream drops to zero, confidence collapses, and the tracker stops emitting beats and reporting BPM.
    • Audio Format Support: The tracker supports any sample rate (time constants are derived from it) and any channel count (interleaved frames are averaged to mono).
    • CPU Usage: Approximately 1.3% of a single CPU core at 44.1 kHz.
  4. Get support and documentation for QLC+

    master

    If you need help using QLC+, you can access the following resources:

    • Official Documentation: Detailed guides on features and usage can be found at docs.qlcplus.org.
    • Support & Bug Reports: Refer to SUPPORT.md in the repository for guidance on finding help.
    • Community Forum: For feedback, submitting new fixtures, or discussing ideas, visit the QLC+ Forum.
  5. Where to get help with QLC+

    master

    Depending on your needs, use the following channels for support:

    • General Support & Community: Use the QLC+ Forum for general questions and community interaction.
    • Self-Service: Consult the Official Documentation for guides and technical details.
    • Technical Bug Reporting: Use GitHub Issues specifically for reporting reproducible bugs or contributing code. This channel is intended for experienced developers.
    • Professional Services: For advanced consulting, custom development, or priority support, you can book a session.
  6. How to report a bug effectively

    master

    To ensure bugs are diagnosed and fixed quickly, include the following details when submitting a GitHub issue:

    • QLC+ Version: (e.g., 4.14.0)
    • Operating System: (e.g., Windows 11, Ubuntu 22.04, macOS Ventura)
    • Steps to Reproduce: Clear, step-by-step instructions to trigger the issue.
    • Expected Behavior: A description of what you expected to happen.
    • Actual Behavior: A description of what actually happened.
    • Additional Info: Attach relevant logs, screenshots, or sample files.
  7. Build QLC+ from source

    master

    Developers looking to compile QLC+ should refer to the GitHub Wiki for comprehensive compilation guides and platform-specific instructions.

    Note for regular contributors: If you are frequently updating the source via git pull, you may occasionally encounter compiler warnings or unresolved symbols due to dependencies between objects. In such cases, a full package recompilation may be required rather than an incremental update.

  8. Contribute to QLC+ development

    master

    The community welcomes contributions to improve QLC+.

    Guidelines:

    • Major Changes: If you are planning a significant contribution, start a discussion thread in the Development Forum first.
    • General Contributions: Follow the rules and procedures outlined in the CONTRIBUTING.md file.
    • Issues: You can find confirmed issues that need attention via the GitHub issues page.
  9. Use RGBScript for programmable RGB lighting logic

    master

    RGBScript is a class used to implement advanced, programmable RGB lighting algorithms using JavaScript. It inherits from RGBAlgorithm and allows users to define complex color mapping logic via external script files.

    Core Workflow

    1. Load a script: Use load(fileName) to point to a JavaScript file.
    2. Evaluate: Call evaluate() to validate the script's contents and ensure it adheres to the expected interface.
    3. Configure Properties: Use setProperty(propertyName, value) to pass configuration parameters to the script. These properties are exposed via the properties() method.
    4. Execution: The engine executes the script's internal functions (like rgbMap) to determine color outputs based on the provided size and step parameters.

    Script Interface Requirements

    For an RGBScript to function correctly, the JavaScript file must implement specific functions that the engine calls:

    • rgbMap(size, rgb, step, map): The primary function for calculating color mappings.
    • rgbMapStepCount(size): Returns the number of steps for the given size.
    • rgbMapSetColors(colors)
    • rgbMapGetColors()

    Note that RGBScript also supports XML serialization via loadXML and saveXML for integration with QLC+ project files.

  10. Manage lighting performances with the Show class

    master

    The Show class is a specialized Function used to manage complex lighting performances. It acts as a container for multiple Track objects and ShowFunction objects, allowing for synchronized playback. A Show can be configured with different time divisions (e.g., standard time or musical BPM) to coordinate the timing of its components.

    Key capabilities include:

    • Managing a collection of Track objects.
    • Controlling playback via preRun, write, and postRun methods.
    • Configuring musical timing using TimeDivision.
    • Accessing specific tracks or show functions by their unique IDs.
  11. Use the Track class to manage lighting event sequences

    master

    The Track class is used to manage sequences of lighting events, typically by associating a track with a Scene and a collection of ShowFunction objects. A track can be muted, renamed, and associated with a specific Show via a showId.

    Key capabilities include:

    • Sequence Management: Adding, removing, and retrieving ShowFunction objects.
    • Muting: Toggling the mute state to silence a track.
    • Scene Association: Linking a track to a specific Scene ID.
    • Persistence: Loading and saving track data via XML.