Class: MIDI::NoteOn

Inherits:
NoteEvent show all
Defined in:
lib/midilib/event.rb

Constant Summary

Constants inherited from NoteEvent

MIDI::NoteEvent::PITCHES

Instance Attribute Summary collapse

Attributes inherited from NoteEvent

#note, #velocity

Attributes inherited from ChannelEvent

#channel

Attributes inherited from Event

#delta_time, #print_channel_numbers_from_one, #print_decimal_numbers, #print_note_names, #status, #time_from_start

Instance Method Summary collapse

Methods inherited from NoteEvent

#data_as_bytes, #note_to_s, #pch_oct

Methods inherited from Event

#<=>, #channel_to_s, #data_as_bytes, #number_to_s, #quantize_to

Constructor Details

#initialize(channel = 0, note = 64, velocity = 64, delta_time = 0) ⇒ NoteOn

Returns a new instance of NoteOn.



136
137
138
# File 'lib/midilib/event.rb', line 136

def initialize(channel = 0, note = 64, velocity = 64, delta_time = 0)
  super(NOTE_ON, channel, note, velocity, delta_time)
end

Instance Attribute Details

#offObject

Returns the value of attribute off.



135
136
137
# File 'lib/midilib/event.rb', line 135

def off
  @off
end

Instance Method Details

#to_sObject



140
141
142
143
# File 'lib/midilib/event.rb', line 140

def to_s
  return super <<
    "on #{note_to_s} #{number_to_s(@velocity)}"
end