module Patch::IO::MIDI::Action

Find and identify MIDI Actions

Public Instance Methods

find_by_index(actions, index) click to toggle source

Find an action in the given patch for the given cc index @param [Array<Hash>] actions @param [Fixnum] index @return [Hash]

# File lib/patch/io/midi/action.rb, line 30
def find_by_index(actions, index)
  midi_actions(actions).find do |action|
    action[:midi][:index] == index
  end
end
midi?(action) click to toggle source

Is the given action MIDI? @param [Hash] action @return [Boolean]

# File lib/patch/io/midi/action.rb, line 15
def midi?(action)
  !action[:midi].nil? && !action[:midi][:index].nil?
end
midi_actions(actions) click to toggle source

Filter the given actions only to return MIDI actions @param [Array<Hash>] actions @return [Array<Hash>]

# File lib/patch/io/midi/action.rb, line 22
def midi_actions(actions)
  actions.select { |action| midi?(action) }
end