+2
-1
@@ -15,6 +15,7 @@ import generator.pitch
|
||||
STANDARD_TUNING = ((6, 40), (5, 45), (4, 50), (3, 55), (2, 59), (1, 64))
|
||||
MIN_FRET = 0
|
||||
MAX_FRET = 20
|
||||
PREFERRED_MAX_FRET = 12
|
||||
MAX_FRET_SPAN = 4
|
||||
WRITTEN_GUITAR_OCTAVE_OFFSET = 12
|
||||
ACOUSTIC_STRINGS = ((6, 4, 3), (6, 4, 3, 2), (5, 4, 3), (5, 3, 2), (5, 4, 3, 2))
|
||||
@@ -44,7 +45,7 @@ def voicing_cost(positions: tuple[TabPosition, ...], profile: str = '', allowed:
|
||||
classes = {p.midi % 12 for p in positions}
|
||||
above = sum(p.midi > max(melody) for p in positions) if melody else 0
|
||||
span = compactness(positions)
|
||||
effort = 2 * max(frets, default=0) + span
|
||||
effort = 2 * max(0, max(frets, default=0) - PREFERRED_MAX_FRET) + span
|
||||
if profile == 'acoustic':
|
||||
effort += 2 * span + 2 * max(0, len(frets) - 1)
|
||||
return VoicingCost(max(0, 4 - len(positions)) if profile == 'electric' else 0,
|
||||
|
||||
Reference in New Issue
Block a user