Class: Zgomot::Drivers::Driver
Direct Known Subclasses
Constant Summary collapse
- ON =
MIDI commands
Note on
0x90
- OFF =
Note off
0x80
- PA =
Polyphonic aftertouch
0xa0
- CC =
Control change
0xb0
- PC =
Program change
0xc0
- CA =
Channel aftertouch
0xd0
- PB =
Pitch bend
0xe0
Instance Method Summary collapse
- #aftertouch(note, channel, pressure) ⇒ Object
- #channel_aftertouch(channel, pressure) ⇒ Object
-
#close ⇒ Object
——————————————————————————————————— Driver API ———————————————————————————————————.
- #control_change(number, channel, value) ⇒ Object
-
#initialize ⇒ Driver
constructor
A new instance of Driver.
- #note_off(note, channel, velocity = 0) ⇒ Object
- #note_on(note, channel, velocity) ⇒ Object
- #pitch_bend(channel, value) ⇒ Object
- #program_change(channel, program) ⇒ Object
- #write(*args) ⇒ Object
Constructor Details
#initialize ⇒ Driver
Returns a new instance of Driver.
29 30 31 |
# File 'lib/zgomot/drivers/driver.rb', line 29 def initialize open end |
Instance Method Details
#aftertouch(note, channel, pressure) ⇒ Object
41 42 43 |
# File 'lib/zgomot/drivers/driver.rb', line 41 def aftertouch(note, channel, pressure) write(PA | channel, note, pressure) end |
#channel_aftertouch(channel, pressure) ⇒ Object
53 54 55 |
# File 'lib/zgomot/drivers/driver.rb', line 53 def channel_aftertouch(channel, pressure) write(CA | channel, pressure) end |
#close ⇒ Object
Driver API
64 65 66 |
# File 'lib/zgomot/drivers/driver.rb', line 64 def close raise NotImplementedError, "You must implement #close in your driver." end |
#control_change(number, channel, value) ⇒ Object
45 46 47 |
# File 'lib/zgomot/drivers/driver.rb', line 45 def control_change(number, channel, value) write(CC | channel, number, value) end |
#note_off(note, channel, velocity = 0) ⇒ Object
37 38 39 |
# File 'lib/zgomot/drivers/driver.rb', line 37 def note_off(note, channel, velocity = 0) write(OFF | channel, note, velocity) end |
#note_on(note, channel, velocity) ⇒ Object
33 34 35 |
# File 'lib/zgomot/drivers/driver.rb', line 33 def note_on(note, channel, velocity) write(ON | channel, note, velocity) end |
#pitch_bend(channel, value) ⇒ Object
57 58 59 |
# File 'lib/zgomot/drivers/driver.rb', line 57 def pitch_bend(channel, value) write(PB | channel, value) end |
#program_change(channel, program) ⇒ Object
49 50 51 |
# File 'lib/zgomot/drivers/driver.rb', line 49 def program_change(channel, program) write(PC | channel, program) end |
#write(*args) ⇒ Object
68 69 70 |
# File 'lib/zgomot/drivers/driver.rb', line 68 def write(*args) raise NotImplementedError, "You must implement #write in your driver." end |