# NOT RUN {
ticks_to_duration(c(120, 160))
ticks_to_duration(c(128, 192, 512), ticks_per_qtr = 384)
duration_to_ticks(c("t8", "8", "8.", "8.."))
duration_to_ticks(c("t8 8 8. 8.."), ticks_per_qtr = 384)
file <- system.file("example2.mid", package = "tabr")
if(require("tuneR")){
  x <- read_midi(file, ticks_per_qtr = 384)
  midi_metadata(x)
  midi_time(x)
  midi_key(x)
  midi_notes(x, channel = 0, noteworthy = FALSE)
  (x <- midi_notes(x, channel = 0))
  (x <- as_music(x$pitch, x$duration))
  # requires LilyPond installation
  if(tabr_options()$lilypond != ""){
    out <- file.path(tempdir(), "out.pdf")
    phrase(x) %>% track_bc() %>% score() %>% tab(out, details = FALSE)
  }
}
# }
Run the code above in your browser using DataLab