From ce830b004681b020de9a714a5b575143ffcb901f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20N=C3=A1poles=20L=C3=B3pez?= Date: Mon, 20 Jun 2022 14:00:21 -0400 Subject: [PATCH] Removing drum parts from music21.stream before processing. --- AugmentedNet/score_parser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/AugmentedNet/score_parser.py b/AugmentedNet/score_parser.py index 098c8e85..71cf0f57 100644 --- a/AugmentedNet/score_parser.py +++ b/AugmentedNet/score_parser.py @@ -37,7 +37,14 @@ def _m21Parse(f, fmt=None): - return music21.converter.parse(f, format=fmt) + s = music21.converter.parse(f, format=fmt) + perc = [ + p + for p in s.parts + if list(p.recurse().getElementsByClass("PercussionClef")) + ] + s.remove(perc, recurse=True) + return s def from_tsv(tsv, sep="\t"):