The candidate and its harmonic/voice-leading context.
The verdict, reason bitmask, and optional resolution guidance.
import { evaluateSafety, makeChord, majorKey, NoteSafety } from '@libraz/libcantus';
const result = evaluateSafety({
profile: 'pop',
candidatePitch: 60, // C over a C major chord
chord: makeChord(0, 'maj'),
key: majorKey(0),
otherVoices: [],
strongBeat: true,
});
result.safety === NoteSafety.Safe; // true — C is a chord tone
Evaluate the safety of placing a candidate pitch in a voice.
Reasons are merged from harmonic context (chord tone / tension / avoid / scale) and counterpoint (vertical dissonance, parallels, voice crossing). The
strictprofile treats avoid notes and parallels as dissonant;poptreats them as warnings. The final verdict is the worst severity among the reasons.