Class Track
Contains all Track's data
Info:
- License: MIT
- Author: Pedro Alves Valentim
Functions
Track:new ([name]) | Creates a new Track |
Methods
Functions
- Track:new ([name])
-
Creates a new Track
Parameters:
- name string a name metadata to the Track (optional)
Returns:
-
new Track object
Methods
- Track:add_events (events, map_function)
-
Adds an event-list (or single event) to the track. These events can be
MetaEvents
,NoteEvents
orProgramChangeEvents
.Parameters:
- events a single event or event-list (array of events).
- map_function
function to be applied to
events
(being it an array or not).
Returns:
-
new Track object
See also:
- Track:get_events (filter)
-
Gets events from Track
Parameters:
- filter
string
a string to filter events by type. The valid values are
meta
,note
andprogram-change
.
Returns:
-
events table
See also:
- filter
string
a string to filter events by type. The valid values are
- Track:set_tempo (bpm)
-
Sets Track's tempo
Parameters:
- bpm number the tempo in beats per minute.
Returns:
-
Track with tempo
-
Track:set_time_signature (num, den[, midi_clocks_tick=
24
[, notes_midi_clock=8
]]) -
Sets Track's time signature
Parameters:
- num int signature's numerator (top number)
- den int signature's denominator (bottom number)
- midi_clocks_tick
number of MIDI clocks per ticks
(default
24
) - notes_midi_clock
number of notes per MIDI clock
(default
8
)
Returns:
-
Track with time signature
See also:
- Track:set_key_signature (sf, mi)
-
Sets Track's key signature
Parameters:
- sf number of sharps or flats
- mi [opt=0] major or minor (0 or 1)
Returns:
-
Track with key signature
See also:
- Track:set_text (text)
-
Sets text to Track
Parameters:
- text string the text to be added
Returns:
-
Track with text
See also:
- Track:set_copyright (copyright)
-
Sets copyright to Track
Parameters:
- copyright string the copyright to be added
Returns:
-
Track with copyright
See also:
- Track:set_name (name)
-
Sets a name to Track
Parameters:
- name string the name to be added
Returns:
-
Track with a name
See also:
- Track:set_instrument_name (instrument_name)
-
Sets instrument name to Track
Parameters:
- instrument_name string the instrument name to be added
Returns:
-
Track with instrument name
See also:
- Track:set_lyric (lyric)
-
Sets lyric to Track
Parameters:
- lyric string the lyric text to be added
Returns:
-
Track with the lyric
See also:
- Track:set_marker (marker)
-
Sets marker text to Track
Parameters:
- marker string the marker text to be added
Returns:
-
Track with the marker text
See also:
- Track:set_cue_point (cue_point)
-
Sets cue point to Track
Parameters:
- cue_point string the cue point text to be added
Returns:
-
Track with the cue point
See also:
- Track:poly_mode_on ()
-
Activates poly mode
Returns:
-
Track with poly mode activated
- Track:get_tempo ()
-
Gets tempo from Track
Returns:
-
Track's tempo
See also:
- Track:get_time_signature ()
-
Gets time signature from Track
Returns:
-
Track's time signature
See also:
- Track:get_key_signature ()
-
Gets key signature from Track
Returns:
-
Track's key signature
See also:
- Track:get_text ()
-
Gets text from Track
Returns:
-
Track's text
See also:
- Track:get_copyright ()
-
Gets copyright from Track
Returns:
-
Track's copyright
See also:
- Track:get_name ()
-
Gets name from Track
Returns:
-
Track's name
See also:
- Track:get_instrument_name ()
-
Gets instrument name from Track
Returns:
-
Track's instrument name
See also:
- Track:get_lyric ()
-
Gets lyric from Track
Returns:
-
Track's lyric
See also:
- Track:get_marker ()
-
Gets marker from Track
Returns:
-
Track's marker
See also:
- Track:get_cue_point ()
-
Gets cue point from Track
Returns:
-
Track's cue point
See also: