Module: MMPlayer::Instructions::MIDI
- Included in:
- Context
- Defined in:
- lib/mmplayer/instructions/midi.rb
Overview
Instructions for dealing with MIDI
Instance Method Summary collapse
-
#on_cc(index = nil, &callback) ⇒ Hash
(also: #cc)
Assign a callback for the given MIDI control change.
-
#on_note(note = nil, &callback) ⇒ Hash
(also: #note)
Assign a callback for a given MIDI note.
-
#on_system(command, &callback) ⇒ Hash
(also: #system)
Assign a callback for a given MIDI system command.
-
#receive_channel(num) ⇒ Object
(also: #rx_channel)
Set the MIDI channel to receive messages on.
Instance Method Details
#on_cc(index = nil, &callback) ⇒ Hash Also known as: cc
Assign a callback for the given MIDI control change
37 38 39 |
# File 'lib/mmplayer/instructions/midi.rb', line 37 def on_cc(index = nil, &callback) @midi.add_cc_callback(index, &callback) end |
#on_note(note = nil, &callback) ⇒ Hash Also known as: note
Assign a callback for a given MIDI note
28 29 30 |
# File 'lib/mmplayer/instructions/midi.rb', line 28 def on_note(note = nil, &callback) @midi.add_note_callback(note, &callback) end |
#on_system(command, &callback) ⇒ Hash Also known as: system
Assign a callback for a given MIDI system command
19 20 21 |
# File 'lib/mmplayer/instructions/midi.rb', line 19 def on_system(command, &callback) @midi.add_system_callback(command, &callback) end |
#receive_channel(num) ⇒ Object Also known as: rx_channel
Set the MIDI channel to receive messages on
10 11 12 |
# File 'lib/mmplayer/instructions/midi.rb', line 10 def receive_channel(num) @midi.channel = num end |