Pitching Score
data class PitchingScore(val intonationSystem: IntonationSystem, val score: Float, val tier: PitchingTier, val noteCount: Int) : Comparable<PitchingScore>
Overall intonation accuracy score for a performance.
Produced by com.musicmuni.voxatrace.accura.Accura.calculateScore. The score is in the range 0f..100f and rounded to one decimal place; see calculateScore for the grading scale.
Implements Comparable so scores can be sorted or compared across tuning systems (e.g., to pick whether a performance is better characterized as EQ or JI). Ordering is by score ascending.
Example
// Score the same performance against two tuning systems and pick the better fit.
// analyzePitching always returns non-null; calculateScore throws on an
// inconclusive result, so guard on error before scoring (ADR-022).
val eq = Accura.analyzePitching(contour, tonicHz, IntonationSystem.EQ).let {
if (it.error == null) Accura.calculateScore(it) else null
}
val ji = Accura.analyzePitching(contour, tonicHz, IntonationSystem.JI).let {
if (it.error == null) Accura.calculateScore(it) else null
}
val best = listOfNotNull(eq, ji).maxOrNull()
println("Best fit: ${best?.intonationSystem} at ${best?.score}/100")Content copied to clipboard