Save
This commit is contained in:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user