hw-score-sim 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hw_score_sim/__init__.py +152 -0
- hw_score_sim/catalog.py +733 -0
- hw_score_sim/cli.py +480 -0
- hw_score_sim/glyph_variants.py +2737 -0
- hw_score_sim/layout_quirks.py +542 -0
- hw_score_sim/ml_export.py +867 -0
- hw_score_sim/musescore_compat.py +1919 -0
- hw_score_sim/renderer.py +2043 -0
- hw_score_sim/rest_variants.py +1146 -0
- hw_score_sim/sampler.py +559 -0
- hw_score_sim/stroke_engine.py +824 -0
- hw_score_sim/structural_glyphs.py +1424 -0
- hw_score_sim/style_packs/baroque_classical.json +291 -0
- hw_score_sim/style_packs/everyday_student_folk.json +306 -0
- hw_score_sim/style_packs/jazz_studio_copyist.json +241 -0
- hw_score_sim/style_packs/modernist_20c.json +304 -0
- hw_score_sim/style_packs/romantic_autographs.json +313 -0
- hw_score_sim/style_packs/wild_20c_avantgarde_film_studio.json +1281 -0
- hw_score_sim/style_packs/wild_extreme_degraded_everyday.json +1278 -0
- hw_score_sim/style_packs/wild_historical_renaissance_baroque.json +1278 -0
- hw_score_sim/style_packs/wild_jazz_pop_world_vernacular.json +1282 -0
- hw_score_sim/style_packs/wild_romantic_virtuoso_autographs.json +1291 -0
- hw_score_sim/styles.py +1720 -0
- hw_score_sim-0.1.0.dist-info/METADATA +260 -0
- hw_score_sim-0.1.0.dist-info/RECORD +29 -0
- hw_score_sim-0.1.0.dist-info/WHEEL +5 -0
- hw_score_sim-0.1.0.dist-info/entry_points.txt +3 -0
- hw_score_sim-0.1.0.dist-info/licenses/LICENSE +21 -0
- hw_score_sim-0.1.0.dist-info/top_level.txt +1 -0
hw_score_sim/__init__.py
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"""Procedural handwritten sheet-music rendering engine (`hw-score-sim`)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .ml_export import (
|
|
6
|
+
HandwrittenScoreDataset,
|
|
7
|
+
RenderSample,
|
|
8
|
+
export_dataset_sample,
|
|
9
|
+
render_sample,
|
|
10
|
+
to_coco_annotations,
|
|
11
|
+
to_hf_generator,
|
|
12
|
+
to_yolo_labels,
|
|
13
|
+
)
|
|
14
|
+
from .musescore_compat import (
|
|
15
|
+
MeasureData,
|
|
16
|
+
NoteEvent,
|
|
17
|
+
ParsedScore,
|
|
18
|
+
PartData,
|
|
19
|
+
RestEvent,
|
|
20
|
+
export_score_to_musicxml,
|
|
21
|
+
parse_score,
|
|
22
|
+
)
|
|
23
|
+
from .renderer import (
|
|
24
|
+
StaffLayout,
|
|
25
|
+
SystemLayout,
|
|
26
|
+
layout_score_pages,
|
|
27
|
+
render_score,
|
|
28
|
+
render_score_handwritten,
|
|
29
|
+
)
|
|
30
|
+
from .rest_variants import (
|
|
31
|
+
ALL_NEW_PAUSE_ARCHETYPES,
|
|
32
|
+
BAR_REST_ARCHETYPES,
|
|
33
|
+
FLAGGED_REST_ARCHETYPES,
|
|
34
|
+
NEW_QUARTER_REST_ARCHETYPES,
|
|
35
|
+
draw_pause_variant,
|
|
36
|
+
)
|
|
37
|
+
from .structural_glyphs import (
|
|
38
|
+
BARLINE_ARCHETYPES,
|
|
39
|
+
CLEF_ARCHETYPES,
|
|
40
|
+
KEYSIG_ARCHETYPES,
|
|
41
|
+
)
|
|
42
|
+
from .styles import (
|
|
43
|
+
BEAM_ARCHETYPES,
|
|
44
|
+
BEAM_GROUPING_MODES,
|
|
45
|
+
BEAM_SLOPE_STYLES,
|
|
46
|
+
FLAG_ARCHETYPES,
|
|
47
|
+
LEDGER_STYLES,
|
|
48
|
+
NOTEHEAD_ARCHETYPES,
|
|
49
|
+
PAPER_TYPES,
|
|
50
|
+
REST_ARCHETYPES,
|
|
51
|
+
SCRIBE_STYLES,
|
|
52
|
+
STEM_ARCHETYPES,
|
|
53
|
+
get_style,
|
|
54
|
+
interpolate_styles,
|
|
55
|
+
list_styles,
|
|
56
|
+
register_style,
|
|
57
|
+
reload_style_packs,
|
|
58
|
+
sample_random_scribe,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
__version__ = "0.1.0"
|
|
62
|
+
|
|
63
|
+
__all__ = [
|
|
64
|
+
"__version__",
|
|
65
|
+
# Primary rendering & parsing facade
|
|
66
|
+
"render_score",
|
|
67
|
+
"render_score_handwritten",
|
|
68
|
+
"parse_score",
|
|
69
|
+
"layout_score_pages",
|
|
70
|
+
"export_score_to_musicxml",
|
|
71
|
+
# Generic ML export & in-memory rendering
|
|
72
|
+
"RenderSample",
|
|
73
|
+
"render_sample",
|
|
74
|
+
"to_coco_annotations",
|
|
75
|
+
"to_yolo_labels",
|
|
76
|
+
"export_dataset_sample",
|
|
77
|
+
"HandwrittenScoreDataset",
|
|
78
|
+
"to_hf_generator",
|
|
79
|
+
# Style registry & procedural scribe sampling
|
|
80
|
+
"SCRIBE_STYLES",
|
|
81
|
+
"list_styles",
|
|
82
|
+
"get_style",
|
|
83
|
+
"register_style",
|
|
84
|
+
"reload_style_packs",
|
|
85
|
+
"sample_random_scribe",
|
|
86
|
+
"interpolate_styles",
|
|
87
|
+
# Glyph & layout archetype registries
|
|
88
|
+
"NOTEHEAD_ARCHETYPES",
|
|
89
|
+
"STEM_ARCHETYPES",
|
|
90
|
+
"FLAG_ARCHETYPES",
|
|
91
|
+
"BEAM_ARCHETYPES",
|
|
92
|
+
"BEAM_SLOPE_STYLES",
|
|
93
|
+
"BEAM_GROUPING_MODES",
|
|
94
|
+
"CLEF_ARCHETYPES",
|
|
95
|
+
"KEYSIG_ARCHETYPES",
|
|
96
|
+
"BARLINE_ARCHETYPES",
|
|
97
|
+
"REST_ARCHETYPES",
|
|
98
|
+
"NEW_QUARTER_REST_ARCHETYPES",
|
|
99
|
+
"FLAGGED_REST_ARCHETYPES",
|
|
100
|
+
"BAR_REST_ARCHETYPES",
|
|
101
|
+
"ALL_NEW_PAUSE_ARCHETYPES",
|
|
102
|
+
"draw_pause_variant",
|
|
103
|
+
"LEDGER_STYLES",
|
|
104
|
+
"PAPER_TYPES",
|
|
105
|
+
# Data structures
|
|
106
|
+
"ParsedScore",
|
|
107
|
+
"PartData",
|
|
108
|
+
"MeasureData",
|
|
109
|
+
"NoteEvent",
|
|
110
|
+
"RestEvent",
|
|
111
|
+
"StaffLayout",
|
|
112
|
+
"SystemLayout",
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
# Optional re-exports from sibling modules (sampler & catalog)
|
|
116
|
+
try:
|
|
117
|
+
from .sampler import (
|
|
118
|
+
DIFFICULTY_PRESETS,
|
|
119
|
+
INK_PRESETS,
|
|
120
|
+
PAPER_PRESETS,
|
|
121
|
+
ScribeSampler,
|
|
122
|
+
apply_ink_and_paper,
|
|
123
|
+
derive_seed,
|
|
124
|
+
)
|
|
125
|
+
except ImportError:
|
|
126
|
+
pass
|
|
127
|
+
else:
|
|
128
|
+
__all__.extend(
|
|
129
|
+
[
|
|
130
|
+
"ScribeSampler",
|
|
131
|
+
"derive_seed",
|
|
132
|
+
"DIFFICULTY_PRESETS",
|
|
133
|
+
"INK_PRESETS",
|
|
134
|
+
"PAPER_PRESETS",
|
|
135
|
+
"apply_ink_and_paper",
|
|
136
|
+
]
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
try:
|
|
140
|
+
from .catalog import (
|
|
141
|
+
describe_style,
|
|
142
|
+
filter_styles,
|
|
143
|
+
)
|
|
144
|
+
except ImportError:
|
|
145
|
+
pass
|
|
146
|
+
else:
|
|
147
|
+
__all__.extend(
|
|
148
|
+
[
|
|
149
|
+
"filter_styles",
|
|
150
|
+
"describe_style",
|
|
151
|
+
]
|
|
152
|
+
)
|