Class: Patch::IO::MIDI::Output
- Inherits:
-
Object
- Object
- Patch::IO::MIDI::Output
- Defined in:
- lib/patch/io/midi/output.rb
Overview
MIDI Output functions
Instance Attribute Summary collapse
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id, device, options = {}) ⇒ Output
constructor
A new instance of Output.
-
#puts(patch, patch_messages) ⇒ Array<MIDIMessage>
Convert Patch::Message objects to MIDI and send.
Constructor Details
#initialize(id, device, options = {}) ⇒ Output
Returns a new instance of Output.
16 17 18 19 20 |
# File 'lib/patch/io/midi/output.rb', line 16 def initialize(id, device, = {}) @log = [:log] @id = id @device = get_output(device) end |
Instance Attribute Details
#device ⇒ Object (readonly)
Returns the value of attribute device.
10 11 12 |
# File 'lib/patch/io/midi/output.rb', line 10 def device @device end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/patch/io/midi/output.rb', line 10 def id @id end |
Instance Method Details
#puts(patch, patch_messages) ⇒ Array<MIDIMessage>
Convert Patch::Message objects to MIDI and send
26 27 28 29 30 31 |
# File 'lib/patch/io/midi/output.rb', line 26 def puts(patch, ) = [].flatten = ::Patch::IO::MIDI::Message.(patch, ) @device.puts() unless .empty? end |