TesseraRange

Public facade for batch vocal range analysis, search vector creation, and song matching.

What is Vocal Range Analysis?

Given a pitch contour, this facade:

  1. Estimates the singer's comfortable range (lower/upper pitch, octaves).

  2. Creates a 13-dim search vector — a sigmoid-normalized histogram of pitch distribution in 4-semitone bins — used for matching singers to songs.

  3. Matches singer vs song vectors via inner-product similarity with a gender-based octave offset.

When to Use

ScenarioUse ThisWhy
Estimate range from a complete recordingcomputeVocalRangeBatch analysis in one call
Create a singer/song vector for matchingcomputeSearchVector13-dim feature vector
Match a singer against a songcomputeMatchInner-product + difficulty rating
Interactive "find your range" guided flowUse TesseraRangeSessionPhase-driven with observable state
Multi-metric batch analysisUse Tessera.analyzeIncludes range as one of the metrics

Quick Start

Kotlin

val rangeResult = TesseraRange.computeVocalRange(contour)
if (rangeResult != null) {
println("${rangeResult.range.lower.noteLabel} to ${rangeResult.range.upper.noteLabel}")
val match = TesseraRange.computeMatch(rangeResult.searchVector, songVec, Gender.MALE)
println("Difficulty: ${match.difficulty}/5")
}

Swift

if let result = TesseraRange.computeVocalRange(contour: contour) {
print("\(result.range.lower.noteLabel) to \(result.range.upper.noteLabel)")
let match = TesseraRange.computeMatch(
singerVector: result.searchVector, songVector: songVec, singerGender: .male
)
print("Difficulty: \(match.difficulty)/5")
}

Common Pitfalls

  1. computeVocalRange returns null for insufficient data: Not enough voiced frames to estimate a range. Not an error — domain outcome per ADR-022.

  2. Singer vector: normalize = false; song vector: normalize = true: The asymmetry is by design — singer vectors are raw magnitude, song vectors are L1-normalized for inner-product comparison.

  3. Contour must have ≥ 2 samples: Throws per ADR-022.

See also

For interactive guided range detection

Bundle of range + search vector

Similarity + difficulty result

Configuration for histogram bins and sigmoid gain

For multi-metric batch analysis including range

Functions

Link copied to clipboard
fun computeMatch(singerVector: FloatArray, songVector: FloatArray, singerGender: Gender, config: SearchVectorConfig = SearchVectorConfig.DEFAULT): VocalRangeMatch

Match a singer vector against a song vector.

Link copied to clipboard
fun computeSearchVector(contour: PitchContour, normalize: Boolean = true, config: SearchVectorConfig = SearchVectorConfig.DEFAULT): FloatArray

Compute a vocal range search vector from a pitch contour.

Link copied to clipboard
fun computeVocalRange(contour: PitchContour, ratioSumInRange: Float = 0.9f, config: SearchVectorConfig = SearchVectorConfig.DEFAULT): VocalRangeResult?

Compute the vocal range and search vector from a pitch contour.