Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/patchmaster/predicates.rb

Instance Method Summary collapse

Instance Method Details

#channelObject



9
10
11
# File 'lib/patchmaster/predicates.rb', line 9

def channel
  self & 0x0f
end

#channel?Boolean Also known as: chan?

Returns:

  • (Boolean)


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?

Returns:

  • (Boolean)


39
40
41
# File 'lib/patchmaster/predicates.rb', line 39

def controller?
  (self & 0xf0) == PM::CONTROLLER
end

#high_nibbleObject



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).

Returns:

  • (Boolean)


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?

Returns:

  • (Boolean)


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?

Returns:

  • (Boolean)


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?

Returns:

  • (Boolean)


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?

Returns:

  • (Boolean)


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?

Returns:

  • (Boolean)


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?

Returns:

  • (Boolean)


59
60
61
# File 'lib/patchmaster/predicates.rb', line 59

def realtime?
  self >= 0xf8 && self <= 0xff
end

#system?Boolean Also known as: sys?

Returns:

  • (Boolean)


54
55
56
# File 'lib/patchmaster/predicates.rb', line 54

def system?
  self >= PM::SYSEX && self <= PM::EOX
end