Top Level Namespace
Defined Under Namespace
Modules: Bitwig, Live Classes: Daw, Handler, MIDIDevice, MIDIDevices
Instance Method Summary collapse
Instance Method Details
#run(daw_name) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/musalce-server.rb', line 9 def 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) do |main_thread:, daw:| @keep_proc_context_on_with = true @__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 reset # TODO puts 'reset: missing operation' end def shutdown @__main_thread.wakeup end @__repl = Musa::REPL::REPL.new(binding, highlight_exception: false) end sleep end |