+ } else if (prev->state == STATE_NOVA) {
+ // is this too close to a long bit?
+ double prev_ref = nova_lengths[prev->last_nova_pulse_type];
+ double long_pulse_would_be = last_length * (NOVA_LONG_PULSE_LENGTH / prev_ref);
+ double ratio_penalty = max(2.5 - length / long_pulse_would_be, 0.0);
+ double distance_penalty = max(1000.0 - length, 0.0);
+ cost = ratio_penalty * ratio_penalty + 1e-4 * distance_penalty;
+ } else {
+ // Make sure that marking things as pauses are not _that_ painless...
+ cost = 1e-4 * max(1000.0 - length, 0.0);