Class: MusaLCEServer::Daw
- Inherits:
-
Object
- Object
- MusaLCEServer::Daw
- Defined in:
- lib/daw.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#clock ⇒ Object
readonly
Returns the value of attribute clock.
-
#sequencer ⇒ Object
readonly
Returns the value of attribute sequencer.
-
#tracks ⇒ Object
readonly
Returns the value of attribute tracks.
Class Method Summary collapse
Instance Method Summary collapse
- #continue ⇒ Object
- #goto(position) ⇒ Object
-
#initialize ⇒ Daw
constructor
A new instance of Daw.
- #panic! ⇒ Object
- #play ⇒ Object
- #record ⇒ Object
- #reload ⇒ Object
- #stop ⇒ Object
- #sync ⇒ Object
- #track(name, all: false) ⇒ Object
Constructor Details
#initialize ⇒ Daw
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/daw.rb', line 16 def initialize osc_server = OSC::EMServer.new(11_011) osc_client = OSC::Client.new('localhost', 10_001) Thread.new { osc_server.run } @sequencer = Musa::Sequencer::Sequencer.new 4, 24, dsl_context_class: MusaLCE_Context, do_log: true @clock = Musa::Clock::InputMidiClock.new do_log: true, logger: @sequencer.logger transport = Musa::Transport::Transport.new @clock, sequencer: @sequencer transport.after_stop do sequencer.reset end @midi_devices = MIDIDevices.new(@sequencer) @tracks, @handler = daw_initialize(midi_devices: @midi_devices, clock: @clock, osc_server: osc_server, osc_client: osc_client, logger: @sequencer.logger) @handler.version @handler.sync Thread.new { transport.start } end |
Instance Attribute Details
#clock ⇒ Object (readonly)
Returns the value of attribute clock.
41 42 43 |
# File 'lib/daw.rb', line 41 def clock @clock end |
#sequencer ⇒ Object (readonly)
Returns the value of attribute sequencer.
41 42 43 |
# File 'lib/daw.rb', line 41 def sequencer @sequencer end |
#tracks ⇒ Object (readonly)
Returns the value of attribute tracks.
41 42 43 |
# File 'lib/daw.rb', line 41 def tracks @tracks end |
Class Method Details
.daw_controller_for(daw_id) ⇒ Object
12 13 14 |
# File 'lib/daw.rb', line 12 def self.daw_controller_for(daw_id) @@daws[daw_id].new end |
.register(daw_id, daw_class) ⇒ Object
7 8 9 10 |
# File 'lib/daw.rb', line 7 def self.register(daw_id, daw_class) @@daws ||= {} @@daws[daw_id] = daw_class end |
Instance Method Details
#continue ⇒ Object
53 |
# File 'lib/daw.rb', line 53 def continue; end |
#goto(position) ⇒ Object
55 |
# File 'lib/daw.rb', line 55 def goto(position); end |
#panic! ⇒ Object
59 60 61 62 63 |
# File 'lib/daw.rb', line 59 def panic! @tracks.each do |track| track.out.all_notes_off end end |
#play ⇒ Object
49 |
# File 'lib/daw.rb', line 49 def play; end |
#record ⇒ Object
57 |
# File 'lib/daw.rb', line 57 def record; end |
#reload ⇒ Object
69 70 71 |
# File 'lib/daw.rb', line 69 def reload @handler.reload end |
#stop ⇒ Object
51 |
# File 'lib/daw.rb', line 51 def stop; end |
#sync ⇒ Object
65 66 67 |
# File 'lib/daw.rb', line 65 def sync @handler.sync end |
#track(name, all: false) ⇒ Object
45 46 47 |
# File 'lib/daw.rb', line 45 def track(name, all: false) raise NotImplementedError end |