diff --git a/src/path.py b/src/path.py index 4b1a916..5fbb95d 100644 --- a/src/path.py +++ b/src/path.py @@ -176,8 +176,10 @@ class Path: next_cents = destination_chord.pitches[voice_idx].to_cents() if curr_cents != next_cents: change_after[voice_idx] += 1 - if change_after[voice_idx] >= threshold: - change_after[voice_idx] = 0 + else: + change_after[voice_idx] = sustain_after[voice_idx] / 10 + if change_after[voice_idx] >= (threshold*1): + change_after[voice_idx] = sustain_after[voice_idx] / 10 step = PathStep( source_node=source_node, @@ -268,7 +270,7 @@ class Path: if target_norm: w *= target_norm[i] * config.get("weight_target_register", 1) - step.weight = w**8 + step.weight = w**16 weights.append(w) step.normalized_scores = { @@ -388,7 +390,7 @@ class Path: if current_cents[voice_idx] != candidate_cents[voice_idx]: sum_changing += sustain_counts[voice_idx] - return sum_changing + return sum_changing**2 def _factor_rgr_voice_movement( self, @@ -421,7 +423,7 @@ class Path: if current_cents[voice_idx] != candidate_cents[voice_idx]: sum_repeating += change_counts[voice_idx] - return sum_repeating + return sum_repeating**8 def _factor_harmonic_compactness( self, diff --git a/webapp/generate.html b/webapp/generate.html index 493f42e..700b171 100644 --- a/webapp/generate.html +++ b/webapp/generate.html @@ -483,6 +483,7 @@