The voice being imitated, in ascending onset order.
Where the answer enters, at what interval, and in what key.
The imitation as note events sorted by onset; [] when the chosen
span holds no sounding notes. Notes with a zero or negative duration never
sound and are not copied, so the answer can be shorter than the span. Every
other field of a copied note — its articulation, and its velocity through
velocityScale — comes across with it.
Answer a leading voice with an imitation of it.
The chosen span of the lead is copied so that its first note falls on
atBeat, keeping its internal rhythm; only the answer is returned, so the caller decides what to do with the two voices together. Pitches move byinterval: literally for a real answer, by scale degree for a tonal one, and upside down first wheninvertis set. Inversion mirrors about the first note of the copied span, so the answer starts where the transposition puts that note either way. In a tonal answer a pitch outside the key keeps its distance from the scale tone below it, and inversion mirrors that distance too — a chromatic passing note stays a chromatic passing note, on the other side. Where a mirrored chromatic note falls into a diatonic semitone the key leaves it no room, and it lands on the scale tone there, so a subject saturated with chromatic steps can answer with a pitch repeated.