Class NoteOffEvent
Abstraction of MIDI Note Off event.
Useful for arrangements NoteEvent can't be produce.
See also:
Info:
- License: MIT
- Author: Pedro Alves Valentim
Functions
NoteOffEvent:new (fields) | Creates a new NoteOffEvent. |
Methods
NoteOffEvent:print () | Prints event's data in a human-friendly style |
NoteOffEvent:set_pitch (pitch) | Sets NoteOffEvent's pitch |
NoteOffEvent:set_velocity (velocity) | Sets NoteOffEvent's velocity |
NoteOffEvent:set_channel (channel) | Sets NoteOffEvent's channel |
NoteOffEvent:set_timestamp (timestamp) | Sets NoteOffEvent's timestamp |
NoteOffEvent:get_pitch () | Gets pitch of NoteOffEvent |
NoteOffEvent:get_velocity () | Gets velocity of NoteOffEvent |
NoteOffEvent:get_channel () | Gets channel # of NoteOffEvent |
NoteOffEvent:get_timestamp () | Gets timestamp of NoteOffEvent |
Functions
- NoteOffEvent:new (fields)
-
Creates a new NoteOffEvent. Receives a
fields
table as parameter. This table is expected to have some (or all) of these fields:Name Type Description pitch string or number Note to be set off. Can be a string or valid MIDI note code. Format for string is C#4
.timestamp number Number of ticks between previous event and the execution of this event. Default: 0
velocity number How quickly the note should stop, values 1-100. Default: 50
channel number MIDI channel to use. Default: 1
Note:
pitch
is the only required fieldParameters:
- fields a table containing NoteOffEvent's properties
Returns:
-
new NoteOffEvent object
Methods
- NoteOffEvent:print ()
- Prints event's data in a human-friendly style
- NoteOffEvent:set_pitch (pitch)
-
Sets NoteOffEvent's pitch
Parameters:
- pitch takes the same values as the pitch field passed to the constructor.
Returns:
-
NoteOffEvent with new pitch
- NoteOffEvent:set_velocity (velocity)
-
Sets NoteOffEvent's velocity
Parameters:
- velocity number how quickly the note should stop. Values from 1-100.
Returns:
-
NoteOffEvent with new velocity
- NoteOffEvent:set_channel (channel)
-
Sets NoteOffEvent's channel
Parameters:
- channel number MIDI channel # (1-16).
Returns:
-
NoteOffEvent with new channel
- NoteOffEvent:set_timestamp (timestamp)
-
Sets NoteOffEvent's timestamp
Parameters:
- timestamp number value.
Returns:
-
NoteOffEvent with new timestamp
- NoteOffEvent:get_pitch ()
-
Gets pitch of NoteOffEvent
Returns:
-
NoteOffEvent's pitch value
- NoteOffEvent:get_velocity ()
-
Gets velocity of NoteOffEvent
Returns:
-
NoteOffEvent's velocity value
- NoteOffEvent:get_channel ()
-
Gets channel # of NoteOffEvent
Returns:
-
NoteOffEvent's channel value
- NoteOffEvent:get_timestamp ()
-
Gets timestamp of NoteOffEvent
Returns:
-
NoteOffEvent's timestamp value