Skip to contents

Merge dataframes transformed back to long format, remove added columns and transform to the right chronological order in order to replace the original midi_frame_unnested object.

Usage

merge_midi_frames(df_meta, df_notes_long, df_not_notes)

Arguments

df_meta, df_notes_long, df_not_notes

Dataframes in the format of split_midi_frame().

Value

Merges the input dataframes, arranges by i_track & (absolute) ticks, and calculates time (in relative ticks since the last event).

See also

Other Split/merge meta/notes/non-note events: split_midi_frame()

Examples

if (FALSE) {
midi_file_string <- system.file("extdata", "test_midi_file.mid", package = "pyramidi")
mf <- miditapyr$MidiFrames(midi_file_string)

dfm <- tab_measures(mf$midi_frame_unnested$df, ticks_per_beat = mf$midi_file$ticks_per_beat)

l <- split_midi_frame(dfm)

df_notes_long <- pivot_long_notes(l$df_notes_wide)

merge_midi_frames(l$df_meta, df_notes_long, l$df_not_notes)
}