Start target range from first chord average
- Target now begins at average cents of starting chord - Progress adds target_octaves on top of starting position - More accurate register targeting
This commit is contained in:
parent
cc3c1ab971
commit
0dbdfe02cb
|
|
@ -362,8 +362,11 @@ class PathFinder:
|
||||||
max_path = config.get("max_path", 50)
|
max_path = config.get("max_path", 50)
|
||||||
target_cents = target_octaves * 1200
|
target_cents = target_octaves * 1200
|
||||||
|
|
||||||
|
start_avg_cents = sum(p.to_cents() for p in path[0].pitches) / len(
|
||||||
|
path[0].pitches
|
||||||
|
)
|
||||||
progress = len(path) / max_path
|
progress = len(path) / max_path
|
||||||
current_target = progress * target_cents
|
current_target = start_avg_cents + (progress * target_cents)
|
||||||
|
|
||||||
current_chord = path[-1]
|
current_chord = path[-1]
|
||||||
current_avg_cents = sum(p.to_cents() for p in current_chord.pitches) / len(
|
current_avg_cents = sum(p.to_cents() for p in current_chord.pitches) / len(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue