Class: MusaLCEServer::MusaLCE_Context Private

Inherits:
Musa::Sequencer::Sequencer::DSLContext
  • Object
show all
Includes:
Musa::REPL::CustomizableDSLContext
Defined in:
lib/daw.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

DSL context for the MusaLCE REPL environment.

Extends the Musa-DSL sequencer context with REPL customization capabilities, allowing users to import additional modules and access the binding for evaluation.

Instance Method Summary collapse

Instance Method Details

#binderBinding

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the binding for this context.

Used by the REPL for evaluating user code.

Returns:

  • (Binding)

    the context binding



261
262
263
# File 'lib/daw.rb', line 261

def binder
  @__binder ||= binding
end

#import(*modules) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Imports modules into this context.

Allows users to extend the REPL environment with additional functionality by including modules.

Examples:

import(MyHelperModule, AnotherModule)

Parameters:

  • modules (Array<Module>)

    modules to include



275
276
277
278
279
# File 'lib/daw.rb', line 275

def import(*modules)
  modules.each do |m|
    self.class.include(m)
  end
end

#surfaceSurface

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The surface holds typed controls keyed by event name. Controls appear in the inventory once Pulso Bridge advertises them over OSC; before that, +surface[:event]+ returns +nil+.

Examples:

single-line state write via Control#set

on :launch_chorus do |payload|
  launch :chorus_section
  surface[:launch_chorus]&.set(enabled: true, message: "Chorus on")
end

reading state to toggle

on :master_mute do
  surface[:master_mute]&.toggle!
end

Returns:

  • (Surface)

    the active control surface (Stream Deck and similar hardware reached via Pulso Bridge).



298
299
300
301
# File 'lib/daw.rb', line 298

def surface
  MusaLCEServer.surface or
    raise 'No Surface available (DAW not initialized)'
end