Class: SMF::NoteOff

Inherits:
VoiceMessage show all
Defined in:
lib/smf.rb

Instance Attribute Summary collapse

Attributes inherited from ChannelMessage

#ch

Attributes inherited from Event

#offset

Instance Method Summary collapse

Methods inherited from Event

#<=>, #eql?, #hash

Constructor Details

#initialize(offset, ch, note, vel) ⇒ NoteOff

Returns a new instance of NoteOff.



318
319
320
321
322
# File 'lib/smf.rb', line 318

def initialize(offset, ch, note, vel)
  # note:0/2**7-1, vel:0/2**7-1
  super(offset, ch)
  @note, @vel = note, vel
end

Instance Attribute Details

#noteObject

Returns the value of attribute note.



324
325
326
# File 'lib/smf.rb', line 324

def note
  @note
end

Instance Method Details

#==(other) ⇒ Object



333
334
335
# File 'lib/smf.rb', line 333

def == (other)
  super && note == other.note && vel == other.vel
end

#fake?Boolean

Returns:

  • (Boolean)


328
# File 'lib/smf.rb', line 328

def fake?() @vel.nil? end

#velObject Also known as: velocity



326
# File 'lib/smf.rb', line 326

def vel() @vel || 64 end

#vel=(vel) ⇒ Object Also known as: velocity=



327
# File 'lib/smf.rb', line 327

def vel=(vel) @vel = vel end