Class: MIDIMessage::Event::Note
- Inherits:
-
Object
- Object
- MIDIMessage::Event::Note
- Extended by:
- Forwardable
- Defined in:
- lib/midi-message/event/note.rb
Overview
an Event::Note is a pairing of a MIDI NoteOn and NoteOff message has a length that corresponds 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 = {}) ⇒ Note
constructor
A new instance of Note.
Constructor Details
#initialize(start_message, duration, options = {}) ⇒ Note
Returns a new instance of Note.
20 21 22 23 24 25 |
# File 'lib/midi-message/event/note.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.
12 13 14 |
# File 'lib/midi-message/event/note.rb', line 12 def finish @finish end |
#length ⇒ Object (readonly) Also known as: duration
Returns the value of attribute length.
12 13 14 |
# File 'lib/midi-message/event/note.rb', line 12 def length @length end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
12 13 14 |
# File 'lib/midi-message/event/note.rb', line 12 def start @start end |