Array of PatternNote objects to reverse
New array with reversed scale degrees but original rhythmic structure
const original = [
{ scaleDegree: "I", noteDuration: "4n", isTarget: true },
{ scaleDegree: "II", noteDuration: "8n", isTarget: false },
{ scaleDegree: "III", noteDuration: "4n", isTarget: true }
];
const reversed = reversePatternNotes(original);
// Result: [
// { scaleDegree: "III", noteDuration: "4n", isTarget: true },
// { scaleDegree: "II", noteDuration: "8n", isTarget: false },
// { scaleDegree: "I", noteDuration: "4n", isTarget: true }
// ]
Reverses the melodic direction of a pattern by inverting the scale degrees.
This function creates a retrograde version of a pattern where the scale degrees are reversed in order while preserving the original rhythmic structure and target note designations. This is useful for creating variations of existing patterns or for pedagogical exercises.
The function maintains the same note durations, target designations, and velocity values in their original positions, but assigns the scale degrees in reverse order.