PitchingScore

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")

See also

Constructors

Link copied to clipboard
constructor(intonationSystem: IntonationSystem, score: Float, tier: PitchingTier, noteCount: Int)

Properties

Link copied to clipboard

Which intonation system the performance was graded against.

Link copied to clipboard

Number of detected notes contributing to the score.

Link copied to clipboard

Overall score in the range 0f..100f, rounded to one decimal place.

Link copied to clipboard

Qualitative tier — the banded view of score.

Functions

Link copied to clipboard
open operator override fun compareTo(other: PitchingScore): Int

Compare by score ascending. Scores within 1e-6 of each other are treated as equal.