Module: Patch::IO::MIDI::Message
Overview
Convert between MIDI message objects and Patch::Message objects
Instance Method Summary collapse
- #to_midi_messages(patch, patch_messages) ⇒ Array<::MIDIMessage>
-
#to_patch_messages(patch, midi_messages) ⇒ Array<::Patch::Message>
Convert the given MIDI message to Patch::Message objects using the context of the given patch.
Instance Method Details
#to_midi_messages(patch, patch_messages) ⇒ Array<::MIDIMessage>
15 16 17 18 19 20 21 22 23 |
# File 'lib/patch/io/midi/message.rb', line 15 def (patch, ) = [].flatten = .map do || unless (action = patch.actions.at(.index)).nil? (action, ) unless action[:midi].nil? end end .compact end |
#to_patch_messages(patch, midi_messages) ⇒ Array<::Patch::Message>
Convert the given MIDI message to Patch::Message objects using the context of the given patch
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/patch/io/midi/message.rb', line 29 def (patch, ) = [].flatten = .map do || unless (action = Action.find_by_index(patch.actions, .index)).nil? index = patch.actions.index(action) (action, index, patch.name, ) end end .compact end |