chartKeyOf function
O tom da rodada: o de key quando plan não tem keys: nem cycle:; senão,
o da lista ou do ciclo na rodada de turn (como no play-pattern).
Implementation
KeyTarget chartKeyOf(String key, KeyPlan plan, RoundTurn turn, Random rng) {
final fixed = keyTargetOf(key);
if (plan.keys == null && plan.cycle == null) return fixed;
final written = WrittenKey(fifths: fixed.fifths, lowest: 0, highest: 127);
return keyFor(plan, written, turn, rng) ?? fixed;
}