From 19663ed6c50c8b57feb37dd25163a699d814e8b3 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 22 Mar 2026 20:55:52 -0400 Subject: [PATCH] Fix world_scales.py: correct gamelan tonic and scale names Gamelan uses its own tone names (nem, pi, barang, etc.), not Western note names. Fixed tonic from C4 to nem4 and added pelog nem/barang modes. Replaced miyako-bushi with iwato and kumoi (actual scale names in the system). Added ValueError to exception handling. Co-Authored-By: Claude Opus 4.6 (1M context) --- examples/world_scales.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/world_scales.py b/examples/world_scales.py index e43814e..811a970 100644 --- a/examples/world_scales.py +++ b/examples/world_scales.py @@ -28,19 +28,22 @@ systems = [ ]), ("japanese", "C4", [ ("hirajoshi", "Haunting pentatonic — koto music"), - ("miyako-bushi", "Urban folk — shamisen music"), - ("yo", "Bright pentatonic — folk songs, festival music"), ("in", "Dark pentatonic — court music, Buddhist chant"), - ("ritsu", "Elegant pentatonic — gagaku court music"), + ("yo", "Bright pentatonic — folk songs, festival music"), + ("iwato", "Sparse, mysterious — zen atmosphere"), + ("kumoi", "Gentle pentatonic — lyrical, nostalgic"), + ("ritsu", "Elegant heptatonic — gagaku court music"), ]), ("blues", "C4", [ ("blues", "The 6-note blues scale with the 'blue note'"), ("minor pentatonic", "The backbone of rock guitar solos"), ("major pentatonic", "Bright, open — country, folk, pop"), ]), - ("gamelan", "C4", [ + ("gamelan", "nem4", [ ("slendro", "5-note near-equal division — metallic, shimmering"), ("pelog", "7-note unequal — mysterious, otherworldly"), + ("pelog nem", "Pelog mode on nem — the most common mode"), + ("pelog barang", "Pelog mode on barang — bright, festive"), ]), ] @@ -58,7 +61,7 @@ for system_name, tonic, scales in systems: print(f" {scale_name:20s} {notes}") print(f" {'':20s} {description}") print() - except (KeyError, IndexError): + except (KeyError, IndexError, ValueError): print(f" {scale_name:20s} (not available)") print()