CalibraNoteEval

Offline note/exercise evaluation for scales, arpeggios, and svara patterns.

What is Note Evaluation?

Note evaluation scores how accurately a student performs individual notes in a sequence. Unlike melody evaluation (which compares complete phrases), note evaluation scores each note separately.

Use it for:

  • Scale practice: Sa Re Ga Ma Pa... with per-note feedback

  • Arpeggio exercises: Broken chord practice

  • Interval training: Jumping between specific notes

  • Svara patterns: Indian classical music exercises

When to Use

ScenarioUse This?Why
Evaluate scales/exercisesYesPer-note scoring
Evaluate complete songsNoUse CalibraMelodyEval
Real-time scoringNoUse CalibraLiveEval
Just detect pitchNoUse CalibraPitch

Quick Start

Kotlin

val pattern = ExercisePattern(
noteFrequencies = listOf(261.63f, 293.66f, 329.63f), // C4, D4, E4
noteDurations = listOf(500, 500, 500), // 500ms each
notesPerLoop = 3
)

val studentContour = pitchExtractor.extract(studentAudio, 16000)
val result = CalibraNoteEval.evaluate(pattern, studentContour, referenceKeyHz = 261.63f)

println("Score: ${result.scorePercent}%")
result.noteResults.forEach { note ->
println("Note ${note.noteIndex}: ${note.scorePercent}%")
}

Swift

let pattern = ExercisePattern(
noteFrequencies: [261.63, 293.66, 329.63], // C4, D4, E4
noteDurations: [500, 500, 500],
notesPerLoop: 3
)

let studentContour = pitchExtractor.extract(audio: studentAudio, sampleRate: 16000)
let result = CalibraNoteEval.evaluate(
pattern: pattern,
student: studentContour,
referenceKeyHz: 261.63
)

print("Score: \(result.scorePercent)%")
for note in result.noteResults {
print("Note \(note.noteIndex): \(note.scorePercent)%")
}

Key Transposition

When students sing in a different key than the reference:

Kotlin

val result = CalibraNoteEval.evaluate(
pattern = pattern,
student = studentContour,
referenceKeyHz = 261.63f, // Reference in C
studentKeyHz = 277.18f, // Student sings in C#
leewaySamples = 100 // Allow timing flexibility
)

Platform Notes

iOS

  • Audio must be 16kHz mono; use SonixDecoder/SonixResampler to convert

  • Use @ShouldRefineInSwift methods with provided Swift extensions

Android

  • Audio must be 16kHz mono; use SonixDecoder/SonixResampler to convert

  • Works with any pitch contour from CalibraPitch

Common Pitfalls

  1. Wrong audio sample rate: Audio must be 16kHz; use SonixResampler if needed

  2. Mismatched note count: Pattern and student must have same number of notes

  3. Forgetting key transposition: Set studentKeyHz if student sings in different key

See also

For complete melody/song evaluation

For real-time evaluation during singing

For defining note patterns

For understanding evaluation results

Functions

Link copied to clipboard
fun evaluate(pattern: ExercisePattern, student: PitchContour, referenceKeyHz: Float, studentKeyHz: Float = 0.0f, config: NoteEvalConfig = NoteEvalConfig.DEFAULT): ExerciseResult

Evaluate with configuration object.

fun evaluate(pattern: ExercisePattern, student: PitchContour, referenceKeyHz: Float, studentKeyHz: Float = 0.0f, preset: NoteEvalPreset): ExerciseResult

Evaluate with preset.

fun evaluate(pattern: ExercisePattern, student: PitchContour, referenceKeyHz: Float, studentKeyHz: Float = 0.0f, scoreType: Int = 0, leewaySamples: Int = 0): ExerciseResult

Evaluate a note/exercise performance.