Class: Topaz::MIDISyncOutput
- Inherits:
-
Object
- Object
- Topaz::MIDISyncOutput
- Defined in:
- lib/topaz/midi_sync_output.rb
Overview
Send clock messages via MIDI
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#clock(*a) ⇒ Object
Send a clock tick message.
-
#initialize(output) ⇒ MIDISyncOutput
constructor
A new instance of MIDISyncOutput.
-
#start(*a) ⇒ Object
Send a start message.
-
#stop(*a) ⇒ Object
Send a stop message.
Constructor Details
#initialize(output) ⇒ MIDISyncOutput
Returns a new instance of MIDISyncOutput.
8 9 10 |
# File 'lib/topaz/midi_sync_output.rb', line 8 def initialize(output) @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
6 7 8 |
# File 'lib/topaz/midi_sync_output.rb', line 6 def output @output end |
Instance Method Details
#clock(*a) ⇒ Object
Send a clock tick message
25 26 27 28 |
# File 'lib/topaz/midi_sync_output.rb', line 25 def clock(*a) clock = MIDIMessage::SystemRealtime["Clock"].new.to_a @output.puts(clock) end |
#start(*a) ⇒ Object
Send a start message
13 14 15 16 |
# File 'lib/topaz/midi_sync_output.rb', line 13 def start(*a) start = MIDIMessage::SystemRealtime["Start"].new.to_a @output.puts(start) end |
#stop(*a) ⇒ Object
Send a stop message
19 20 21 22 |
# File 'lib/topaz/midi_sync_output.rb', line 19 def stop(*a) stop = MIDIMessage::SystemRealtime["Stop"].new.to_a @output.puts(stop) end |