Class: MusaLCEServer::Live::Handler Private
- Defined in:
- lib/live/handler.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.
OSC message handler for Ableton Live.
Handles communication with the MusaLCE for Live MIDI Remote Script, processing incoming OSC messages for track registration and routing.
Instance Method Summary collapse
-
#initialize(osc_server, osc_client, tracks, logger:) ⇒ Handler
constructor
private
Creates a new Live handler.
-
#sync ⇒ void
private
Requests track information from Live.
Constructor Details
#initialize(osc_server, osc_client, tracks, logger:) ⇒ Handler
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.
Creates a new Live handler.
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 58 59 60 |
# File 'lib/live/handler.rb', line 18 def initialize(osc_server, osc_client, tracks, logger:) super() @server = osc_server @client = osc_client @tracks = tracks @logger = logger @server.add_method '/hello' do || @logger.info "Received /hello #{.to_a}!" sync end @server.add_method '/musalce4live/tracks' do || @tracks.grant_registry_collection(.to_a.each_slice(10).to_a) end @server.add_method '/musalce4live/track/name' do || .to_a.each_slice(2).to_a.each do |track_data| @tracks.grant_registry(track_data[0], track_data[1]) end end @server.add_method '/musalce4live/track/midi' do || .to_a.each_slice(3).to_a.each do |track_data| @tracks.grant_registry(track_data[0], *([nil] * 1), *track_data[1..]) end end @server.add_method '/musalce4live/track/audio' do || .to_a.each_slice(3).to_a.each do |track_data| @tracks.grant_registry(track_data[0], *([nil] * 3), *track_data[1..]) end end @server.add_method '/musalce4live/track/routings' do || .to_a.each_slice(5).to_a.each do |track_data| @tracks.grant_registry(track_data[0], *([nil] * 5), *track_data[1..]) end end end |
Instance Method Details
#sync ⇒ 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.
Requests track information from Live.
64 65 66 |
# File 'lib/live/handler.rb', line 64 def sync send_osc '/musalce4live/tracks' end |