Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/patchmaster/predicates.rb
Instance Method Summary collapse
- #channel ⇒ Object
- #channel? ⇒ Boolean (also: #chan?)
- #controller? ⇒ Boolean (also: #ctrl?)
- #high_nibble ⇒ Object
-
#note? ⇒ Boolean
Returns true if self is a status byte for a message that targets a note (note on, note off, or poly pressure).
- #note_off? ⇒ Boolean (also: #off?)
- #note_on? ⇒ Boolean (also: #on?)
- #pitch_bend? ⇒ Boolean (also: #pb?)
- #poly_pressure? ⇒ Boolean (also: #poly_press?)
- #program_change? ⇒ Boolean (also: #pc?)
- #realtime? ⇒ Boolean (also: #rt?)
- #system? ⇒ Boolean (also: #sys?)
Instance Method Details
#channel ⇒ Object
9 10 11 |
# File 'lib/patchmaster/predicates.rb', line 9 def channel self & 0x0f end |
#channel? ⇒ Boolean Also known as: chan?
13 14 15 |
# File 'lib/patchmaster/predicates.rb', line 13 def channel? self >= PM::NOTE_ON && self < PM::SYSEX end |
#controller? ⇒ Boolean Also known as: ctrl?
39 40 41 |
# File 'lib/patchmaster/predicates.rb', line 39 def controller? (self & 0xf0) == PM::CONTROLLER end |
#high_nibble ⇒ Object
5 6 7 |
# File 'lib/patchmaster/predicates.rb', line 5 def high_nibble self & 0xf0 end |
#note? ⇒ Boolean
Returns true if self is a status byte for a message that targets a note (note on, note off, or poly pressure).
35 36 37 |
# File 'lib/patchmaster/predicates.rb', line 35 def note? self >= PM::NOTE_OFF && self < PM::CONTROLLER end |
#note_off? ⇒ Boolean Also known as: off?
23 24 25 |
# File 'lib/patchmaster/predicates.rb', line 23 def note_off? (self & 0xf0) == PM::NOTE_OFF end |
#note_on? ⇒ Boolean Also known as: on?
18 19 20 |
# File 'lib/patchmaster/predicates.rb', line 18 def note_on? (self & 0xf0) == PM::NOTE_ON end |
#pitch_bend? ⇒ Boolean Also known as: pb?
49 50 51 |
# File 'lib/patchmaster/predicates.rb', line 49 def pitch_bend? (self & 0xf0) == PM::PITCH_BEND end |
#poly_pressure? ⇒ Boolean Also known as: poly_press?
28 29 30 |
# File 'lib/patchmaster/predicates.rb', line 28 def poly_pressure? (self & 0xf0) == PM::POLY_PRESSURE end |
#program_change? ⇒ Boolean Also known as: pc?
44 45 46 |
# File 'lib/patchmaster/predicates.rb', line 44 def program_change? (self & 0xf0) == PM::PROGRAM_CHANGE end |
#realtime? ⇒ Boolean Also known as: rt?
59 60 61 |
# File 'lib/patchmaster/predicates.rb', line 59 def realtime? self >= 0xf8 && self <= 0xff end |