Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Reaper

Allows control of an instance of Reaper via OSC.

example
// Create an instance of Reaper using default settings
const reaper = new Reaper();
// Start OSC
reaper.startOsc();
// Give the port a chance to open, then tell Reaper to start playback
setTimeout(() => {reaper.transport.play();}, 100);

Hierarchy

  • Reaper

Implements

  • INotifyPropertyChanged

Constructors

constructor

Accessors

isMetronomeEnabled

  • get isMetronomeEnabled(): boolean
  • Indicates whether the metronome is enabled

    Returns boolean

isReady

  • get isReady(): boolean
  • Indicates whether OSC is ready to send and receive messages

    Returns boolean

master

tracks

  • get tracks(): readonly Track[]
  • The current bank of tracks

    Returns readonly Track[]

transport

Methods

onPropertyChanged

  • onPropertyChanged(property: string, callback: function): void
  • Parameters

    • property: string
    • callback: function
        • (): void
        • Returns void

    Returns void

onReady

  • onReady(callback: function): void
  • An event that can be subscribed to for notification when OSC is ready

    Parameters

    • callback: function
        • (): void
        • Returns void

    Returns void

refreshControlSurfaces

  • refreshControlSurfaces(): void
  • Triggers the action Control surface: Refresh all surfaces (Command ID: 41743)

    Returns void

sendOscMessage

startOsc

  • startOsc(): void
  • Open the OSC port and start listening for messages

    Returns void

stopOsc

  • stopOsc(): void

toggleMetronome

  • toggleMetronome(): void

triggerAction

  • triggerAction(commandId: string | number, value?: null | number): void
  • Trigger a Reaper action

    example
    // Trigger action 'Track: Toggle mute for master track'
    reaper.triggerAction(14);
    // Trigger SWS Extension action 'SWS/S&M: Live Config #1 - Apply config (MIDI/OSC only)' with a CC value of 3, selects config #3
    reaper.triggerAction('_S&M_LIVECFG_APPLY1', 3);
    // Trigger action 'Track: Set volume for track 01 (MIDI CC/OSC only)' with a value of 0.75, sets volume of track 1 to +0.0dB
    reaper.triggerAction(20, 0.7156)
    

    Parameters

    • commandId: string | number

      The Command ID of the action to be triggered.

    • value: null | number = null

      The value to send for the action. Note that some actions expect the CC value (0-127) while others expect a decimal value between 0 and 1.

    Returns void

Generated using TypeDoc