From 2b422d55fe89dfd8e790824a18ed1a06ee2655f4 Mon Sep 17 00:00:00 2001 From: Michael Winter Date: Thu, 12 Mar 2026 18:18:40 +0100 Subject: [PATCH] Fix output to preserve internal tuple order - Remove sorted_by_frequency from write functions - Output now uses internal chord._pitches order instead of sorted --- compact_sets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact_sets.py b/compact_sets.py index 481ec04..214b8d4 100644 --- a/compact_sets.py +++ b/compact_sets.py @@ -843,7 +843,7 @@ def write_chord_sequence(seq: list[Chord], path: str) -> None: serializable = [] for chord in seq: chord_data = [] - for pitch in chord.sorted_by_frequency(): + for pitch in chord._pitches: chord_data.append( { "hs_array": list(pitch.hs_array), @@ -868,7 +868,7 @@ def write_chord_sequence_readable(seq: list[Chord], path: str) -> None: with open(path, "w") as f: f.write("(\n") for i, chord in enumerate(seq): - arrays = tuple(p.hs_array for p in chord.sorted_by_frequency()) + arrays = tuple(p.hs_array for p in chord._pitches) f.write(f" {arrays},\n") f.write(")\n")