From b1315a5b9431ff95913701c4ebe851fbfb7474e3 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Sun, 1 Dec 2024 17:51:11 -0500 Subject: [PATCH] Fix sort order on single notes The notes are supposed to be presented in the order they appear on a keyboard, but the "scientific pitch notation" has octaves that start with C and end with B, so we were accidentally sorting A and B for each octave before all the other notes in the octave. --- _includes/note_variables.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/note_variables.html b/_includes/note_variables.html index 846ff84..2d19468 100644 --- a/_includes/note_variables.html +++ b/_includes/note_variables.html @@ -64,7 +64,7 @@ {% assign note_class = "note-" | append: note_base | replace: "#", "-sharp" | replace: "b", "-flat" %} {% assign absolute_class = "note-" | append: note_base | append: number | replace: "#", "-sharp" | replace: "b", "-flat" %} - {% capture sort_key %}{{ number }}{{ letter }}{% if accidental == "#" %}1{% elsif accidental == "b" %}3{% else %}2{% endif %}{% endcapture %} + {% capture sort_key %}{{ number }}{% case letter %}{% when 'A' %}H{% when 'B' %}I{% else %}{{ letter }}{% endcase %}{% if accidental == "#" %}1{% elsif accidental == "b" %}3{% else %}2{% endif %}{% endcapture %} {% assign note_info = "" | split: "|" %} {% assign note_info = note_info | push : sort_key %}