module Diamond::API::MIDI

MIDI convenience methods

Public Class Methods

included(base) click to toggle source
# File lib/diamond/api.rb, line 9
def self.included(base)
  base.send(:extend, Forwardable)
  base.send(:def_delegators, 
            :@midi,
            :<<,
            :add,
            :mute,
            :mute=,
            :omni_on, 
            :remove,
            :rx_channel, 
            :receive_channel,
            :rx_channel=,
            :receive_channel=,
            :toggle_mute,
            :tx_channel, 
            :transmit_channel,
            :tx_channel=,
            :transmit_channel=
           )
end

Public Instance Methods

add_midi_source(source) click to toggle source

Add a MIDI input @param [UniMIDI::Input] source @return [Array<UniMIDI::Input>]

# File lib/diamond/api.rb, line 34
def add_midi_source(source)
  @midi.inputs << source
end
midi_sources() click to toggle source

MIDI inputs associated with this instrument @return [Array<UniMIDI::Input>]

# File lib/diamond/api.rb, line 47
def midi_sources
  @midi.inputs
end
mute?() click to toggle source

Is the instrument MIDI output muted? @return [Boolean]

# File lib/diamond/api.rb, line 53
def mute?
  @midi.output.mute?
end
Also aliased as: muted?
muted?()
Alias for: mute?
remove_midi_source(source) click to toggle source

Remove a MIDI input @param [UniMIDI::Input] source @return [Array<UniMIDI::Input>]

# File lib/diamond/api.rb, line 41
def remove_midi_source(source)
  @midi.inputs.delete(source)
end