src.clean.gen_pretty_midi

Generates MIDI data in Python-compatible form and cleans

Functions

clean_pm_output(i, trial[, dic_name])

Clean raw prettymidi output: truncate start and stop times, map midi notes onto musical notes...

gen_pm_output(input_dir, **kwargs)

Iterates through MIDI BPM files in input directory and extracts data (onset, pitch, velocity) using PrettyMIDI

gen_raw_midi_output(input_dir, **kwargs)

Iterates through raw MIDI files in input directory and extracts data (onset, pitch, velocity) using PrettyMIDI

get_data_from_pm_object(pm)

Returns a flat list of onset start positions, midi pitch numbers, and velocity from a PrettyMIDI object

return_formatted_dic_from_filename(file[, ...])

Returns a dictionary containing file metadata, e.g.

return_list_of_files(input_dir)

Iterate through all folders in input directory and append MIDI files to list

return_list_of_raw_midi_files(input_dir)

Iterate through input directory, return formatted dictionary for every raw midi file

return_list_of_trials(f_list)

Returns list of lists corresponding to each trial

return_pm_output(f)

Loads a file into PrettyMIDI, then returns a dataframe ready for cleaning

src.clean.gen_pretty_midi.gen_pm_output(input_dir, **kwargs) list

Iterates through MIDI BPM files in input directory and extracts data (onset, pitch, velocity) using PrettyMIDI

src.clean.gen_pretty_midi.gen_raw_midi_output(input_dir, **kwargs) list

Iterates through raw MIDI files in input directory and extracts data (onset, pitch, velocity) using PrettyMIDI