{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "from matplotlib import pyplot as plt\n", "\n", "from anticipation.config import *\n", "from anticipation.vocab import *\n", "\n", "import alignment as am\n", "\n", "from anticipation.sample import generate, generate2\n", "from anticipation.convert import midi_to_events, midi_to_compound, events_to_midi\n", "from train.midi_preprocess import convert_midi\n", "\n", "from anticipation.tokenize import tokenize2, maybe_tokenize, tokenize3\n", "\n", "import anticipation.ops as ops\n", "\n", "from tqdm import tqdm" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv('asap-dataset-master/metadata.csv')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | composer | \n", "title | \n", "folder | \n", "xml_score | \n", "midi_score | \n", "midi_performance | \n", "performance_annotations | \n", "midi_score_annotations | \n", "maestro_midi_performance | \n", "maestro_audio_performance | \n", "start | \n", "end | \n", "audio_performance | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "Bach | \n", "Fugue_bwv_846 | \n", "Bach/Fugue/bwv_846 | \n", "Bach/Fugue/bwv_846/xml_score.musicxml | \n", "Bach/Fugue/bwv_846/midi_score.mid | \n", "Bach/Fugue/bwv_846/Shi05M.mid | \n", "Bach/Fugue/bwv_846/Shi05M_annotations.txt | \n", "Bach/Fugue/bwv_846/midi_score_annotations.txt | \n", "{maestro}/2006/MIDI-Unprocessed_19_R1_2006_01-... | \n", "{maestro}/2006/MIDI-Unprocessed_19_R1_2006_01-... | \n", "144.567708 | \n", "NaN | \n", "Bach/Fugue/bwv_846/Shi05M.wav | \n", "
| 1 | \n", "Bach | \n", "Fugue_bwv_848 | \n", "Bach/Fugue/bwv_848 | \n", "Bach/Fugue/bwv_848/xml_score.musicxml | \n", "Bach/Fugue/bwv_848/midi_score.mid | \n", "Bach/Fugue/bwv_848/Denisova06M.mid | \n", "Bach/Fugue/bwv_848/Denisova06M_annotations.txt | \n", "Bach/Fugue/bwv_848/midi_score_annotations.txt | \n", "{maestro}/2008/MIDI-Unprocessed_02_R1_2008_01-... | \n", "{maestro}/2008/MIDI-Unprocessed_02_R1_2008_01-... | \n", "69.317708 | \n", "NaN | \n", "Bach/Fugue/bwv_848/Denisova06M.wav | \n", "
| 2 | \n", "Bach | \n", "Fugue_bwv_848 | \n", "Bach/Fugue/bwv_848 | \n", "Bach/Fugue/bwv_848/xml_score.musicxml | \n", "Bach/Fugue/bwv_848/midi_score.mid | \n", "Bach/Fugue/bwv_848/Lee01M.mid | \n", "Bach/Fugue/bwv_848/Lee01M_annotations.txt | \n", "Bach/Fugue/bwv_848/midi_score_annotations.txt | \n", "{maestro}/2011/MIDI-Unprocessed_08_R1_2011_MID... | \n", "{maestro}/2011/MIDI-Unprocessed_08_R1_2011_MID... | \n", "74.795573 | \n", "NaN | \n", "Bach/Fugue/bwv_848/Lee01M.wav | \n", "
| 3 | \n", "Bach | \n", "Fugue_bwv_848 | \n", "Bach/Fugue/bwv_848 | \n", "Bach/Fugue/bwv_848/xml_score.musicxml | \n", "Bach/Fugue/bwv_848/midi_score.mid | \n", "Bach/Fugue/bwv_848/LeeSH01M.mid | \n", "Bach/Fugue/bwv_848/LeeSH01M_annotations.txt | \n", "Bach/Fugue/bwv_848/midi_score_annotations.txt | \n", "{maestro}/2017/MIDI-Unprocessed_049_PIANO049_M... | \n", "{maestro}/2017/MIDI-Unprocessed_049_PIANO049_M... | \n", "83.644792 | \n", "NaN | \n", "Bach/Fugue/bwv_848/LeeSH01M.wav | \n", "
| 4 | \n", "Bach | \n", "Fugue_bwv_848 | \n", "Bach/Fugue/bwv_848 | \n", "Bach/Fugue/bwv_848/xml_score.musicxml | \n", "Bach/Fugue/bwv_848/midi_score.mid | \n", "Bach/Fugue/bwv_848/Lin04M.mid | \n", "Bach/Fugue/bwv_848/Lin04M_annotations.txt | \n", "Bach/Fugue/bwv_848/midi_score_annotations.txt | \n", "{maestro}/2008/MIDI-Unprocessed_10_R1_2008_01-... | \n", "{maestro}/2008/MIDI-Unprocessed_10_R1_2008_01-... | \n", "75.373698 | \n", "NaN | \n", "Bach/Fugue/bwv_848/Lin04M.wav | \n", "