espnet2.train.dataset.score_loader
Less than 1 minute
espnet2.train.dataset.score_loader
espnet2.train.dataset.score_loader(path)
Load singing scores from a specified file path.
This function reads a singing score file and returns an adapter that can handle the structured data it contains. The singing score data includes tempo and note information for musical performance.
- Parameters:path (str) – The file path to the singing score data.
- Returns: An adapter object that provides access to the singing score data in a structured format.
- Return type:AdapterForSingingScoreScpReader
Examples
>>> scores = score_loader("path/to/singing_score.txt")
>>> tempo, notes = scores["utterance_id_A"]
>>> print(tempo) # Output: 120
>>> print(notes) # Output: [['start', 'end', 'syllable', 'midi', 'phones'], ...]
NOTE
The expected format of the singing score file is as follows:
utterance_id_A tempo_a start_1 end_1 syllable_1 midi_1 phones_1 … utterance_id_B tempo_b start_1 end_1 syllable_1 midi_1 phones_1 … …