Class: MIDI::NoteOffEvent
- Inherits:
-
NoteEvent
- Object
- Event
- ChannelEvent
- NoteEvent
- MIDI::NoteOffEvent
- Defined in:
- lib/midilib/event.rb
Constant Summary
Constants inherited from NoteEvent
Instance Attribute Summary collapse
-
#on ⇒ Object
Returns the value of attribute on.
Attributes inherited from NoteEvent
Attributes inherited from ChannelEvent
Attributes inherited from Event
#delta_time, #print_decimal_numbers, #print_note_names, #status, #time_from_start
Instance Method Summary collapse
-
#initialize(channel = 0, note = 64, velocity = 64, delta_time = 0) ⇒ NoteOffEvent
constructor
A new instance of NoteOffEvent.
- #to_s ⇒ Object
Methods inherited from NoteEvent
#data_as_bytes, #note_to_s, #pch_oct
Methods inherited from Event
#<=>, #channel?, #data_as_bytes, #meta?, #note?, #note_off?, #note_on?, #number_to_s, #quantize_to, #realtime?, #system?
Constructor Details
#initialize(channel = 0, note = 64, velocity = 64, delta_time = 0) ⇒ NoteOffEvent
Returns a new instance of NoteOffEvent.
183 184 185 186 |
# File 'lib/midilib/event.rb', line 183 def initialize(channel = 0, note = 64, velocity = 64, delta_time = 0) super(NOTE_OFF, channel, note, velocity, delta_time) @is_note_off = true end |
Instance Attribute Details
#on ⇒ Object
Returns the value of attribute on.
182 183 184 |
# File 'lib/midilib/event.rb', line 182 def on @on end |
Instance Method Details
#to_s ⇒ Object
187 188 189 190 |
# File 'lib/midilib/event.rb', line 187 def to_s return super << "off #{note_to_s} #{number_to_s(@velocity)}" end |