Skip to contents

Copy the midi_df, add cumulative time column, keep only note_on messages

Usage

copy_midi_df_track(midi_df, track_num = 0)

Arguments

midi_df

A dataframe representing a midi file returned from midi_to_object().

track_num

An integer indicating track number to select. Default is 0.

Value

A filtered data frame containing messages for the selected track

Details

This function filters an imported midi_df for a specific track and makes a copy of midi_df. The imported midi_df comes from the midi_to_object() function, and represents the output of pyramidi::miditapyr$unnest_midi(message_list_df). I make copies of this sometimes out of caution. Currently, it is used to preserve the meta messages from the imported midi files.

Examples

if (FALSE) {
copy_track_0 = copy_midi_df_track(midi_df, track_num = 0)
}