Class: MIDIInstrument::NoteEvent
- Inherits:
-
Object
- Object
- MIDIInstrument::NoteEvent
- Extended by:
- Forwardable
- Defined in:
- lib/midi-instrument/note_event.rb
Overview
An NoteEvent is a pairing of a MIDI NoteOn and NoteOff message. Its duration can correspond to sequencer ticks
Instance Attribute Summary collapse
-
#finish ⇒ Object
readonly
Returns the value of attribute finish.
-
#length ⇒ Object
(also: #duration)
readonly
Returns the value of attribute length.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
-
#initialize(start_message, duration, options = {}) ⇒ NoteEvent
constructor
A new instance of NoteEvent.
Constructor Details
#initialize(start_message, duration, options = {}) ⇒ NoteEvent
Returns a new instance of NoteEvent.
20 21 22 23 24 25 |
# File 'lib/midi-instrument/note_event.rb', line 20 def initialize(, duration, = {}) @start = @length = duration @finish = [:finish] || .to_note_off end |
Instance Attribute Details
#finish ⇒ Object (readonly)
Returns the value of attribute finish.
8 9 10 |
# File 'lib/midi-instrument/note_event.rb', line 8 def finish @finish end |
#length ⇒ Object (readonly) Also known as: duration
Returns the value of attribute length.
8 9 10 |
# File 'lib/midi-instrument/note_event.rb', line 8 def length @length end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
8 9 10 |
# File 'lib/midi-instrument/note_event.rb', line 8 def start @start end |