Symbolic music alignment
Project description
Parangonar
Parangonar is a Python package for note alignment of symbolic music. Parangonar uses Partitura as file I/O utility. Note alignments produced py Parangonar can be visualized using the web tool Parangonda
Installation
The easiest way to install the package is via pip
from the PyPI (Python
Package Index):
pip install parangonar
This will install the latest release of the package and will install all dependencies automatically.
Quickstart
The following code loads the contents of a a previously aligned performance and score alignment file (encoded in the match file format).
A new alignment is computed using a hierarchical DTW-based note matcher and the resulting alignment are compared to the ground truth:
import parangonar as pa
import partitura as pt
perf_match, groundtruth_alignment, score_match = pt.load_match(
filename= pa.EXAMPLE,
create_score=True
)
# compute note arrays from the loaded score and performance
pna_match = perf_match.note_array()
sna_match = score_match.note_array()
# match the notes in the note arrays
sdm = pa.AutomaticNoteMatcher()
pred_alignment = sdm(sna_match,
pna_match,
verbose_time=True)
# compute f-score and print the results
print('------------------')
types = ['match','insertion', 'deletion']
for alignment_type in types:
precision, recall, f_score = pa.fscore_alignments(pred_alignment,
groundtruth_alignment,
alignment_type)
print('Evaluate ',alignment_type)
print('Precision: ',format(precision, '.3f'),
'Recall ',format(recall, '.3f'),
'F-Score ',format(f_score, '.3f'))
print('------------------')
License
The code in this package is licensed under the Apache 2.0 License. For details, please see the LICENSE file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for parangonar-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a71f85d98e64a798d6e44dc742ea575a0079974dbb8bc1aabb594962a08cb551 |
|
MD5 | 696e2eb48b54c6eed22604c80aab6cc2 |
|
BLAKE2b-256 | c9bdde78aaa7f67a63f4f5cb346f2e727496e42957f3650e8e73ce11f366d8a9 |