Skip to contents

Import MIDI data and transform it into several useful R objects.

Usage

midi_to_object(file_path)

Arguments

file_path

A character string specifying the path to the MIDI file.

Value

A list of MIDI import objects, which includes:

  • miditapyr_object: A miditapyr object representing the complete MIDI file.

  • mido_object: A mido object representing the MIDI file.

  • message_list_df: A data frame of MIDI messages.

  • ticks_per_beat: The number of ticks per beat.

  • midi_df: A data frame of MIDI messages, fully unnested.

Details

This mostly wraps pyramidi functions that call miditapyr and mido.

Examples

if (FALSE) {
  midi_objects <- midi_to_object("path_to_your_midi_file.mid")
  list2env(midi_objects, .GlobalEnv) # add to global environment
}