Module: MIDIInstrument::API::Input

Included in:
Node
Defined in:
lib/midi-instrument/api.rb

Overview

Input convenience methods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
# File 'lib/midi-instrument/api.rb', line 9

def self.included(base)
  base.send(:extend, Forwardable)
  base.send(:def_delegators, :@input, :omni_on)
end

Instance Method Details

#inputsArray<UniMIDI::Input>

MIDI input devices

Returns:

  • (Array<UniMIDI::Input>)


16
17
18
# File 'lib/midi-instrument/api.rb', line 16

def inputs
  @input.devices
end

#receive_channelFixnum? Also known as: rx_channel

MIDI channel messages will only be acknowledged if they have this optional specified channel

Returns:

  • (Fixnum, nil)


22
23
24
# File 'lib/midi-instrument/api.rb', line 22

def receive_channel
  @input.channel
end

#receive_channel=(channel) ⇒ Fixnum? Also known as: rx_channel=

Set the receive channel

Returns:

  • (Fixnum, nil)


29
30
31
# File 'lib/midi-instrument/api.rb', line 29

def receive_channel=(channel)
  @input.channel = channel
end