Module: MusaLCEServer
- Defined in:
- lib/version.rb,
lib/daw.rb,
lib/surface.rb,
lib/live/live.rb,
lib/live/tracks.rb,
lib/live/handler.rb,
lib/midi-devices.rb,
lib/bitwig/bitwig.rb,
lib/bitwig/tracks.rb,
lib/bitwig/handler.rb,
lib/musalce-server.rb,
lib/surface-bridge.rb,
lib/bitwig/controllers.rb
Overview
Musa Live Coding Environment Server.
This module provides the main entry point for the MusaLCE server, which enables live coding with Ableton Live 11+ and Bitwig Studio 5+.
The server provides:
- OSC communication with DAW controller extensions
- MIDI device management and routing
- A REPL (Read-Eval-Print-Loop) for interactive live coding
- Integration with Musa-DSL sequencer for music composition
Defined Under Namespace
Modules: Bitwig, Live Classes: Control, Daw, Encoder, Handler, MIDIDevice, MIDIDevices, MusaLCE_Context, Surface, SurfaceBridge, Toggle, Trigger
Constant Summary collapse
- VERSION =
Current version of the musalce-server gem.
'0.8.0'.freeze
Class Attribute Summary collapse
-
.surface ⇒ Object
Returns the value of attribute surface.
Class Method Summary collapse
-
.run(daw_name) ⇒ void
Starts the MusaLCE server for the specified DAW.
Class Attribute Details
.surface ⇒ Object
Returns the value of attribute surface.
12 13 14 |
# File 'lib/daw.rb', line 12 def surface @surface end |
Class Method Details
.run(daw_name) ⇒ void
This method returns an undefined value.
Starts the MusaLCE server for the specified DAW.
This method initializes the DAW controller, sets up the REPL environment,
and starts the main server loop. The server runs until shutdown is called from the REPL.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/musalce-server.rb', line 44 def self.run(daw_name) raise ArgumentError, 'A daw must be specified. Options: \'bitwig\' or \'live\'' unless daw_name raise ArgumentError, "Incompatible DAW '#{daw_name}'. Options: 'bitwig' or 'live'" unless %w[bitwig live].include?(daw_name) main_thread = Thread.current daw = Daw.daw_controller_for(daw_name.to_sym) daw.sequencer.with(main_thread: main_thread, daw: daw, keep_block_context: false) do |main_thread:, daw:| @__main_thread = main_thread @__daw = daw alias __puts puts alias __require_relative require_relative def puts(...) @__repl.puts(...) end def require_relative(filename, from_server: false) if from_server require_relative filename else # @user_pathname is injected from REPL require @user_pathname.dirname + filename end end def daw @__daw end def reload @__daw.reload end def shutdown @__main_thread.wakeup end @__repl = Musa::REPL::REPL.new(binding, highlight_exception: false) end sleep end |