-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #913 from dchiller/i910-compound-neumes
Fix missing pitches in neume ngrams + refactorings
- Loading branch information
Showing
12 changed files
with
194 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
""" | ||
Contains various neume-related constructs that are used throughout the backend, | ||
especially for MEI parsing and OMR search. | ||
""" | ||
|
||
from typing import Literal, Dict | ||
|
||
# NEUME_NAMES contains the currently-supported neumes. They are | ||
# included in the order used for UI (esp. as neume exemplars). | ||
# Ordering is by: | ||
# 1. The number of pitches in the neume (ascending) | ||
# 2. The the direction of the first interval in the neume (first ascending, | ||
# then pitch repetition, then descending) | ||
# 3+. The direction of following intervals in the neume (according to 2.) | ||
# N. The all-purpose "compound" neume at the end | ||
NEUME_NAMES = [ | ||
"punctum", | ||
"pes", | ||
"distropha", | ||
"clivis", | ||
"scandicus", | ||
"torculus", | ||
"tristopha", | ||
"pressus", | ||
"porrectus", | ||
"climacus", | ||
"scandicus-flexus", | ||
"torculus-resupinus", | ||
"pes-subpunctis", | ||
"porrectus-flexus", | ||
"climacus-resupinus", | ||
"scandicus-subpunctis", | ||
"porrectus-subpunctis", | ||
"compound", | ||
] | ||
|
||
NeumeName = Literal[ | ||
"punctum", | ||
"pes", | ||
"distropha", | ||
"clivis", | ||
"scandicus", | ||
"torculus", | ||
"tristopha", | ||
"pressus", | ||
"porrectus", | ||
"climacus", | ||
"scandicus-flexus", | ||
"torculus-resupinus", | ||
"pes-subpunctis", | ||
"porrectus-flexus", | ||
"climacus-resupinus", | ||
"scandicus-subpunctis", | ||
"porrectus-subpunctis", | ||
"compound", | ||
] | ||
|
||
# Mapping from neume contours to neume names | ||
NEUME_GROUPS: Dict[str, NeumeName] = { | ||
"": "punctum", | ||
"u": "pes", | ||
"r": "distropha", | ||
"d": "clivis", | ||
"uu": "scandicus", | ||
"ud": "torculus", | ||
"rr": "tristopha", | ||
"rd": "pressus", | ||
"du": "porrectus", | ||
"dd": "climacus", | ||
"uud": "scandicus-flexus", | ||
"udu": "torculus-resupinus", | ||
"udd": "pes-subpunctis", | ||
"dud": "porrectus-flexus", | ||
"ddu": "climacus-resupinus", | ||
"uudd": "scandicus-subpunctis", | ||
"dudd": "porrectus-subpunctis", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.