View source: R/pivot_note_on_off.R
pivot_wide_notes | R Documentation |
note_on
and note_off
events in the same line (long to wide)Write note_on
and note_off
events in the same line (long to wide)
pivot_wide_notes(df_measures)
df_measures |
data.frame resulting of miditapyr$mido_midi_df() and then running tab_measures() (see example) |
A data.frame with the following columns pivoted to wide: c("m", "b", "t", "ticks", "time", "velocity"). Every column is pivoted to wide with the suffix "_note_on" & "_note_off" showing the values of the original column as a prefix. See ?tab_measures
for an explanation of the meaning of these columns.
Other Pivot midi frame functions:
pivot_long_notes()
## Not run:
mid_file_str <- system.file("extdata", "test_midi_file.mid", package = "pyramidi")
mido_mid_file <- mido$MidiFile(mid_file_str)
dfc <- miditapyr$frame_midi(mido_mid_file)
ticks_per_beat = mido_mid_file$ticks_per_beat
df <- dfc %>%
miditapyr$unnest_midi()
## End(Not run)
## Not run:
dfm <- tab_measures(df, ticks_per_beat)
library(zeallot)
c(df_meta, df_notes) %<-% miditapyr$split_df(dfm)
df_notes %>% pivot_wide_notes()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.