Class: Fluent::MIDIInput
- Inherits:
-
Input
- Object
- Input
- Fluent::MIDIInput
- Defined in:
- lib/fluent/plugin/in_midi.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ MIDIInput
constructor
A new instance of MIDIInput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ MIDIInput
Returns a new instance of MIDIInput.
8 9 10 11 |
# File 'lib/fluent/plugin/in_midi.rb', line 8 def initialize super require 'rtmidi' end |
Instance Method Details
#configure(conf) ⇒ Object
13 14 15 |
# File 'lib/fluent/plugin/in_midi.rb', line 13 def configure(conf) super end |
#shutdown ⇒ Object
31 32 33 |
# File 'lib/fluent/plugin/in_midi.rb', line 31 def shutdown @input.close_port end |
#start ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fluent/plugin/in_midi.rb', line 17 def start super @input = RtMidi::In.new @input. do |byte1, byte2, byte3| record = { 'status' => byte1, 'note' => byte2, 'velocity' => byte3, } Engine.emit(@tag, Engine.now, record) end @input.open_port(@port) end |