REAPER C/C++ Extension Plug-in mini-SDK

repository·main·Indexed 41 days ago

https://github.com/justinfrankel/reaper-sdk

A mini-SDK for developing C/C++ extension plug-ins for REAPER. It provides necessary headers, reference implementations, and specialized components such as the mpglib MP3 decoder for lightweight audio processing. The SDK includes configurations for MCU, OSC, HUI, and Web surfaces, and requires the WDL library for compilation.

Tokens
2.1K
Snippets
7
Records
10
Agent score
52%

What's inside REAPER SDK

  1. Overview of the mpglib MP3 decoder

    main

    The mpglib library is a 'light' version of the mpg123 package, stripped of unnecessary components to reduce size. It is specifically designed for embedded or space-constrained environments.

    Key Characteristics:

    • Supported Formats: Currently, only Layer 3 is enabled and supported. Layer 1 and Layer 2 are not tested.
    • Stability: The interface is intended to remain stable, with plans for a backport to the original mpg123 package.
    • Demo: The main.c file in the library directory contains a simple demo application that can be used to understand the library's basic usage.
  2. Overview of the REAPER C/C++ extension plug-in mini-SDK

    main

    The reaper-sdk is a mini-SDK designed for developing C/C++ extension plug-ins for REAPER. It provides the necessary headers and reference implementations to build custom extensions.

    Project Structure:

    • sdk/: Contains the header files required for developing your plug-in.
    • reaper-plugins/: Contains source code for some plug-ins included with REAPER. Note that these are provided for reference or LGPL compliance and should not be used as the primary model for well-designed plug-ins.
  3. Licensing and Legal considerations for mpglib

    main

    The mpglib portion of this library is licensed under LGPL.

    Important Legal Notices:

    • Patents: This software may contain patented algorithms depending on your country. Verify the legality of using/selling products based on this code in your jurisdiction before proceeding.
    • Copyright: Duplicating copyrighted music without explicit permission violates the rights of the owner.
    • Patching: If you submit significant patches, the maintainer requires explicit permission to allow for the possibility of selling the code to companies that cannot use LGPL-licensed software. If you do not grant this permission, your changes can still be distributed freely under LGPL.
  4. Set up WDL dependency for compilation

    main

    To compile most components of this SDK, you must include the WDL library. You can integrate it into your local repository by adding it as a git remote and merging the main branch. This allows the build system to find the necessary WDL files.

    git remote add wdl https://github.com/justinfrankel/WDL.git
    git fetch --all
    git merge --allow-unrelated-histories wdl/main
  5. Configure OSC (Open Sound Control) surfaces

    main

    The OSC configuration allows for network-based control of REAPER. You can define device identities, network addresses, and packet handling behavior.

    Network Settings:

    • Device name: Identifier for the OSC device.
    • Pattern config: Selection of the OSC pattern.
    • Mode: Operational mode for the OSC connection.
    • Device IP / Port: The remote device's network address.
    • Local IP / Listen port: The local machine's network address for receiving OSC messages.

    Advanced OSC Settings:

    • Allow binding messages to REAPER actions and FX learn: Enables deeper integration with REAPER's action system.
    • Outgoing max packet size: Adjust to prevent packet loss on unstable networks.
    • Wait between packets (ms): Delay between outgoing packets to manage network load.
    // OSC Configuration includes:
    // - Device name, Pattern config, Mode
    // - Device IP/Port and Local IP/Listen port
    // - Allow binding messages to REAPER actions and FX learn
    // - Outgoing max packet size
    // - Wait between packets (ms)
  6. Configure Web (WWW) surfaces

    main

    The Web surface configuration allows you to run a web server to control REAPER via a browser.

    Key Settings:

    • Run web server on port: Enable the server and specify the port.
    • Username:password: Authentication credentials (leave blank for none).
    • Default interface: Selection of the default web interface.
    • Use rc.reaper.fm: Option to use the external rc.reaper.fm interface.
    • Access URL: The read-only URL provided for accessing the interface.
    // Web Configuration includes:
    // - Port number for the web server
    // - Username:password authentication
    // - Default interface selection
    // - Use rc.reaper.fm option
    // - Access URL (read-only)
  7. Configure HUI (Hardware User Interface) surfaces

    main

    HUI configuration is used for MIDI-based Hardware User Interface integration. It is similar to MCU but focuses on fader counts and specific HUI mapping logic.

    Key Settings:

    • MIDI input/output: Select the appropriate MIDI ports.
    • Surface offset (tracks): Adjust which tracks the surface controls.
      • 0: First fader maps to Master.
      • 1: First fader maps to the first track.
    • Fader count: Number of faders (usually 8, but can be higher for multichannel HUI).
    // HUI Configuration includes:
    // - MIDI input/output selection
    // - Surface offset (tracks): 0 for Master, 1 for first track
    // - Fader count (default: 8)
  8. Configure MCU (Mackie Control Universal) surfaces

    main

    The MCU surface configuration allows you to set up MIDI-based Mackie Control Universal integration. You can specify MIDI input/output devices, track offsets, and specific behavioral tweaks.

    Key Settings:

    • MIDI input/output: Select the appropriate MIDI ports.
    • Surface offset (tracks): Adjust which tracks the surface controls.
    • Size tweak: A scaling parameter (recommended to leave at 9 unless you have specific requirements).

    Advanced MCU Options (IDD_SURFACEEDIT_MCU1):

    • Ignore fader moves when fader is not being touched: Prevents accidental movement updates.
    • Map F1-F8 to go to markers: Assigns marker navigation to function keys.
    • Ignore global bank offsets: Forces mapping to the tracks specified rather than using bank offsets.
    // Note: These settings are configured via the GUI dialogs defined in the resource file.
    // MCU Configuration includes:
    // - MIDI input/output selection
    // - Surface offset (tracks)
    // - Size tweak (default: 9)
    // - Ignore fader moves checkbox
    // - Map F1-F8 to markers checkbox
    // - Ignore global bank offsets checkbox
  9. MP3 Sink Configuration Dialog (IDD_MP3SINK_CFG)

    main

    The IDD_MP3SINK_CFG dialog is used to configure the settings for the MP3 sink (encoder). It allows users to select encoding modes, quality levels, bitrates, and stereo modes.

    Dialog Controls:
    - IDC_MODE (COMBOBOX): Select encoding Mode.
    - IDC_QUALITY (COMBOBOX): Select encoding Quality.
    - IDC_BITRATE (COMBOBOX): Select encoding Bitrate.
    - IDC_COMBO1 (COMBOBOX): Additional configuration dropdown.
    - IDC_STEREO_MODE (CONTROL): "Do not allow joint stereo" checkbox.
    - IDC_REPLAY_GAIN (CONTROL): "Write ReplayGain tag" checkbox.
    - IDC_LAMEVER (RTEXT): Displays the (lame version).
  10. MP3 File Properties Dialog (IDD_MP3ITEMINFO)

    main

    The IDD_MP3ITEMINFO dialog is used to display and interact with MP3 file metadata. It provides read-only views of the filename and file information, along with options for latency correction and image viewing.

    Dialog Controls:
    - IDC_NAME (EDITTEXT): Read-only filename display.
    - IDC_INFO (EDITTEXT): Read-only multi-line file information display.
    - IDC_CHECK1 (CONTROL): "Correct compressor latency/length (recommended)" checkbox.
    - IDC_BUTTON1 (PUSHBUTTON): "Image" button.
    - IDOK (DEFPUSHBUTTON): "Close" button.