This commit is contained in:
khodowany
2026-10-04 15:51:18 -05:00
parent 405066eb43
commit f234dd6d51
54 changed files with 2104 additions and 330 deletions
+6 -7
View File
@@ -47,10 +47,9 @@ def for_part(part, analysis=None):
strings = (1, 2, 3, 4, 5, 6)
if analysis is None or not analysis.melody:
return Instrument(part, strings)
# Analysis contains the prepared concert source. Electric melody is written
# two octaves up and sounds one down (parts.build_measure), hence +12.
# Use the source voice, never the highest added harmonization voice.
shift = generator.vocabulary.role(part + '_solo').get('register_offset', 12 if part == 'electric' else 0)
notes = tuple(n for n in analysis.melody if n.end > analysis.body_offset)
return Instrument(part, strings, weighted_center(notes) + shift,
(min(n.pitch.number() for n in notes) + shift, max(n.pitch.number() for n in notes) + shift))
# Source identity is independent of sounding register. Roles have soft,
# overlapping centers; all legal positions remain available to both guitars.
center=generator.vocabulary.role(part+'_solo').get('register_center',57 if part=='acoustic' else 62)
notes=tuple(n for n in analysis.melody if n.end>analysis.body_offset)
return Instrument(part,strings,center,
(min(n.pitch.number() for n in notes),max(n.pitch.number() for n in notes)))