Command-line usage
More information will be added soon
MIDI path convention
Please note that the command-line utilities assume a certain MIDI filepath convention and structure. Suppose that one wants to calculate a distributional discrepancy between two sets of MIDI performances (e.g., sets real and generated). Then, these performances should be located in separate directories structured in the following way:
real/
├── liszt_liebestraum/
│ ├── lang_lang.mid
│ ├── kissin.mid
├── ravel_le_tombeau_de_couperin/
│ ├── yuja_wang.mid
│ ├── martha_argerich.mid
│ ├── seong_jin_cho.mid
gen/
├── liszt_liebestraum/
│ ├── perf_0.mid
│ ├── perf_1.mid
│ ├── perf_2.mid
│ ├── perf_3.mid
├── ravel_le_tombeau_de_couperin/
│ ├── perf_0.mid
│ ├── perf_1.mid
Note that the naming of the pieces in both sets should match, whereas the naming of performances can be arbitrary.
Extracting Aria embeddings
pereval-embed-aria
Options:
--checkpoint_paththe path to the Aria checkpoint--evaluation_dirthe directory containing MIDI performances
Extracts Aria embeddings. The embeddings are saved as a single file aria_emb_fix.pt in evaluation_dir.
Aligning scores and performances
pereval-save-alignment
Options:
--score_dira directory with MIDI scores--evaluation_dira directory with MIDI performances
Calculates the note alignment using Parangonar’s TheGlueNoteMatcher (requires GPU). Saves the .match alignment files in evaluation_dir.
Attribute-scoped correlations
pereval-correlation
Options:
--real_dira directory with MIDI performances--gen_dira directory with MIDI performances--real_alignment_dirthe directory with alignments for--real_dir--gen_alignment_dirthe directory with alignments for--gen_dir--score_dirthe directory with MIDI scores--output_filenamethe filename for output correlations (e.g.,inter-correlation.pt)
Calculates attribute-scoped Pearson correlations between sets of performances. Saves the correlations into a dictionary with torch tensors.
Density estimation for KL-divergence calcualtion
pereval-kde
Options:
--evaluation_dira directory with MIDI performances--score_dira directory with MIDI scores--output_filenamethe filename for output correlation (e.g.,kde.skops)
Calculates Kernel Density Estimators (KDE) needed for calculating attribute-scoped KL-divergence. Saves KDE as a sklearn model into a .skops file.
Shift notes
pereval-shift-notes
Options:
--evaluation_dira directory with MIDI performances--output_diran output directory with modified MIDI performances--shiftthe number of notes to shift
Shifts (truncates the first few) notes in performances. Described in Section 4.2 of the ISMIR paper. Creates a new directory with modified performances.
Transferring velocities
pereval-permute-velocity
Options:
--evaluation_dira directory with MIDI performances--output_diran output directory with modified MIDI performances
Transfers the velocities of the notes between performances. See Section 4.2 of the ISMIR paper for more details.