From 323eccb6f1cafcd342a41c09fe5bca76889fb1e5 Mon Sep 17 00:00:00 2001 From: mesheets <16882600+mesheets@users.noreply.github.com> Date: Sat, 20 Jul 2024 11:30:57 -0400 Subject: [PATCH] Update musical scale constants --- include/dmusic.h | 8 + xs/lisp/front.c | 375 +++++++++++++++++++++++++++-------------------- 2 files changed, 223 insertions(+), 160 deletions(-) diff --git a/include/dmusic.h b/include/dmusic.h index edf6f5e..0f23c30 100644 --- a/include/dmusic.h +++ b/include/dmusic.h @@ -103,6 +103,7 @@ extern "C" { #define PITCH_A0 1 #define PITCH_Am0 2 #define PITCH_Bb0 2 +#define PITCH_Hb0 2 #define PITCH_B0 3 #define PITCH_H0 3 #define PITCH_C1 4 @@ -121,6 +122,7 @@ extern "C" { #define PITCH_A1 13 #define PITCH_Am1 14 #define PITCH_Bb1 14 +#define PITCH_Hb1 14 #define PITCH_B1 15 #define PITCH_H1 15 #define PITCH_C2 16 @@ -139,6 +141,7 @@ extern "C" { #define PITCH_A2 25 #define PITCH_Am2 26 #define PITCH_Bb2 26 +#define PITCH_Hb2 26 #define PITCH_B2 27 #define PITCH_H2 27 #define PITCH_C3 28 @@ -157,6 +160,7 @@ extern "C" { #define PITCH_A3 37 #define PITCH_Am3 38 #define PITCH_Bb3 38 +#define PITCH_Hb3 38 #define PITCH_B3 39 #define PITCH_H3 39 #define PITCH_C4 40 @@ -175,6 +179,7 @@ extern "C" { #define PITCH_A4 49 #define PITCH_Am4 50 #define PITCH_Bb4 50 +#define PITCH_Hb4 50 #define PITCH_B4 51 #define PITCH_H4 51 #define PITCH_C5 52 @@ -193,6 +198,7 @@ extern "C" { #define PITCH_A5 61 #define PITCH_Am5 62 #define PITCH_Bb5 62 +#define PITCH_Hb5 62 #define PITCH_B5 63 #define PITCH_H5 63 #define PITCH_C6 64 @@ -211,6 +217,7 @@ extern "C" { #define PITCH_A6 73 #define PITCH_Am6 74 #define PITCH_Bb6 74 +#define PITCH_Hb6 74 #define PITCH_B6 75 #define PITCH_H6 75 #define PITCH_C7 76 @@ -229,6 +236,7 @@ extern "C" { #define PITCH_A7 85 #define PITCH_Am7 86 #define PITCH_Bb7 86 +#define PITCH_Hb7 86 #define PITCH_B7 87 #define PITCH_H7 87 #define PITCH_C8 88 diff --git a/xs/lisp/front.c b/xs/lisp/front.c index c428a65..92d7470 100644 --- a/xs/lisp/front.c +++ b/xs/lisp/front.c @@ -1088,202 +1088,257 @@ void initReader() { defReaderConstant("pause", PITCH_PAUSE); defReaderConstant("rest", PITCH_REST); - defReaderConstant("A0", 0); - defReaderConstant("Am0", 1); - defReaderConstant("H0", 2); - defReaderConstant("C1", 3); - defReaderConstant("Cm1", 4); - defReaderConstant("D1", 5); - defReaderConstant("Dm1", 6); - defReaderConstant("E1", 7); - defReaderConstant("F1", 8); - defReaderConstant("Fm1", 9); - defReaderConstant("G1", 10); - defReaderConstant("Gm1", 11); - defReaderConstant("A1", 12); - defReaderConstant("Am1", 13); - defReaderConstant("H1", 14); - defReaderConstant("C2", 15); - defReaderConstant("Cm2", 16); - defReaderConstant("D2", 17); - defReaderConstant("Dm2", 18); - defReaderConstant("E2", 19); - defReaderConstant("F2", 20); - defReaderConstant("Fm2", 21); - defReaderConstant("G2", 22); - defReaderConstant("Gm2", 23); - defReaderConstant("A2", 24); - defReaderConstant("Am2", 25); - defReaderConstant("H2", 26); - defReaderConstant("C3", 27); - defReaderConstant("Cm3", 28); - defReaderConstant("D3", 29); - defReaderConstant("Dm3", 30); - defReaderConstant("E3", 31); - defReaderConstant("F3", 32); - defReaderConstant("Fm3", 33); - defReaderConstant("G3", 34); - defReaderConstant("Gm3", 35); - defReaderConstant("A3", 36); - defReaderConstant("Am3", 37); - defReaderConstant("H3", 38); - defReaderConstant("C4", 39); - defReaderConstant("Cm4", 40); - defReaderConstant("D4", 41); - defReaderConstant("Dm4", 42); - defReaderConstant("E4", 43); - defReaderConstant("F4", 44); - defReaderConstant("Fm4", 45); - defReaderConstant("G4", 46); - defReaderConstant("Gm4", 47); - defReaderConstant("A4", 48); - defReaderConstant("Am4", 49); - defReaderConstant("H4", 50); - defReaderConstant("C5", 51); - defReaderConstant("Cm5", 52); - defReaderConstant("D5", 53); - defReaderConstant("Dm5", 54); - defReaderConstant("E5", 55); - defReaderConstant("F5", 56); - defReaderConstant("Fm5", 57); - defReaderConstant("G5", 58); - defReaderConstant("Gm5", 59); - defReaderConstant("A5", 60); - defReaderConstant("Am5", 61); - defReaderConstant("H5", 62); - defReaderConstant("C6", 63); - defReaderConstant("Cm6", 64); - defReaderConstant("D6", 65); - defReaderConstant("Dm6", 66); - defReaderConstant("E6", 67); - defReaderConstant("F6", 68); - defReaderConstant("Fm6", 69); - defReaderConstant("G6", 70); - defReaderConstant("Gm6", 71); - defReaderConstant("A6", 72); - defReaderConstant("Am6", 73); - defReaderConstant("H6", 74); - defReaderConstant("C7", 75); - defReaderConstant("Cm7", 76); - defReaderConstant("D7", 77); - defReaderConstant("Dm7", 78); - defReaderConstant("E7", 79); - defReaderConstant("F7", 80); - defReaderConstant("Fm7", 81); - defReaderConstant("G7", 82); - defReaderConstant("Gm7", 83); - defReaderConstant("A7", 84); - defReaderConstant("Am7", 85); - defReaderConstant("H7", 86); - defReaderConstant("C8", 87); - defReaderConstant("Cm8", 88); - defReaderConstant("D8", 89); - defReaderConstant("Dm8", 90); - defReaderConstant("E8", 91); - defReaderConstant("F8", 92); - defReaderConstant("Fm8", 93); - defReaderConstant("G8", 94); - defReaderConstant("Gm8", 95); - defReaderConstant("A8", 96); - - defReaderConstant("La0", 0); - defReaderConstant("La#0", 1); - defReaderConstant("Si0", 2); - defReaderConstant("Do1", 3); - defReaderConstant("Do#1", 4); - defReaderConstant("Re1", 5); - defReaderConstant("Re#1", 6); - defReaderConstant("Mi1", 7); - defReaderConstant("Fa1", 8); - defReaderConstant("Fa#1", 9); - defReaderConstant("So1", 10); + defReaderConstant("A0" , PITCH_A0 ); + defReaderConstant("Am0", PITCH_Am0); + defReaderConstant("Bb0", PITCH_Bb0); + defReaderConstant("Hb0", PITCH_Hb0); + defReaderConstant("B0" , PITCH_B0 ); + defReaderConstant("H0" , PITCH_H0 ); + defReaderConstant("C1" , PITCH_C1 ); + defReaderConstant("Cm1", PITCH_Cm1); + defReaderConstant("Db1", PITCH_Db1); + defReaderConstant("D1" , PITCH_D1 ); + defReaderConstant("Dm1", PITCH_Dm1); + defReaderConstant("Eb1", PITCH_Eb1); + defReaderConstant("E1" , PITCH_E1 ); + defReaderConstant("F1" , PITCH_F1 ); + defReaderConstant("Fm1", PITCH_Fm1); + defReaderConstant("Gb1", PITCH_Gb1); + defReaderConstant("G1" , PITCH_G1 ); + defReaderConstant("Gm1", PITCH_Gm1); + defReaderConstant("Ab1", PITCH_Ab1); + defReaderConstant("A1" , PITCH_A1 ); + defReaderConstant("Am1", PITCH_Am1); + defReaderConstant("Bb1", PITCH_Bb1); + defReaderConstant("Hb1", PITCH_Hb1); + defReaderConstant("B1" , PITCH_B1 ); + defReaderConstant("H1" , PITCH_H1 ); + defReaderConstant("C2" , PITCH_C2 ); + defReaderConstant("Cm2", PITCH_Cm2); + defReaderConstant("Db2", PITCH_Db2); + defReaderConstant("D2" , PITCH_D2 ); + defReaderConstant("Dm2", PITCH_Dm2); + defReaderConstant("Eb2", PITCH_Eb2); + defReaderConstant("E2" , PITCH_E2 ); + defReaderConstant("F2" , PITCH_F2 ); + defReaderConstant("Fm2", PITCH_Fm2); + defReaderConstant("Gb2", PITCH_Gb2); + defReaderConstant("G2" , PITCH_G2 ); + defReaderConstant("Gm2", PITCH_Gm2); + defReaderConstant("Ab2", PITCH_Ab2); + defReaderConstant("A2" , PITCH_A2 ); + defReaderConstant("Am2", PITCH_Am2); + defReaderConstant("Bb2", PITCH_Bb2); + defReaderConstant("Hb2", PITCH_Hb2); + defReaderConstant("B2" , PITCH_B2 ); + defReaderConstant("H2" , PITCH_H2 ); + defReaderConstant("C3" , PITCH_C3 ); + defReaderConstant("Cm3", PITCH_Cm3); + defReaderConstant("Dd3", PITCH_Dd3); + defReaderConstant("D3" , PITCH_D3 ); + defReaderConstant("Dm3", PITCH_Dm3); + defReaderConstant("Eb3", PITCH_Eb3); + defReaderConstant("E3" , PITCH_E3 ); + defReaderConstant("F3" , PITCH_F3 ); + defReaderConstant("Fm3", PITCH_Fm3); + defReaderConstant("Gb3", PITCH_Gb3); + defReaderConstant("G3" , PITCH_G3 ); + defReaderConstant("Gm3", PITCH_Gm3); + defReaderConstant("Ab3", PITCH_Ab3); + defReaderConstant("A3" , PITCH_A3 ); + defReaderConstant("Am3", PITCH_Am3); + defReaderConstant("Bb3", PITCH_Bb3); + defReaderConstant("Hb3", PITCH_Hb3); + defReaderConstant("B3" , PITCH_B3 ); + defReaderConstant("H3" , PITCH_H3 ); + defReaderConstant("C4" , PITCH_C4 ); + defReaderConstant("Cm4", PITCH_Cm4); + defReaderConstant("Db4", PITCH_Db4); + defReaderConstant("D4" , PITCH_D4 ); + defReaderConstant("Dm4", PITCH_Dm4); + defReaderConstant("Eb4", PITCH_Eb4); + defReaderConstant("E4" , PITCH_E4 ); + defReaderConstant("F4" , PITCH_F4 ); + defReaderConstant("Fm4", PITCH_Fm4); + defReaderConstant("Gb4", PITCH_Gb4); + defReaderConstant("G4" , PITCH_G4 ); + defReaderConstant("Gm4", PITCH_Gm4); + defReaderConstant("Ab4", PITCH_Ab4); + defReaderConstant("A4" , PITCH_A4 ); + defReaderConstant("Am4", PITCH_Am4); + defReaderConstant("Bb4", PITCH_Bb4); + defReaderConstant("Hb4", PITCH_Hb4); + defReaderConstant("B4" , PITCH_B4 ); + defReaderConstant("H4" , PITCH_H4 ); + defReaderConstant("C5" , PITCH_C5 ); + defReaderConstant("Cm5", PITCH_Cm5); + defReaderConstant("Db5", PITCH_Db5); + defReaderConstant("D5" , PITCH_D5 ); + defReaderConstant("Dm5", PITCH_Dm5); + defReaderConstant("Eb5", PITCH_Eb5); + defReaderConstant("E5" , PITCH_E5 ); + defReaderConstant("F5" , PITCH_F5 ); + defReaderConstant("Fm5", PITCH_Fm5); + defReaderConstant("Gb5", PITCH_Gb5); + defReaderConstant("G5" , PITCH_G5 ); + defReaderConstant("Gm5", PITCH_Gm5); + defReaderConstant("Ab5", PITCH_Ab5); + defReaderConstant("A5" , PITCH_A5 ); + defReaderConstant("Am5", PITCH_Am5); + defReaderConstant("Bb5", PITCH_Bb5); + defReaderConstant("Hb5", PITCH_Hb5); + defReaderConstant("B5" , PITCH_B5 ); + defReaderConstant("H5" , PITCH_H5 ); + defReaderConstant("C6" , PITCH_C6 ); + defReaderConstant("Cm6", PITCH_Cm6); + defReaderConstant("Db6", PITCH_Db6); + defReaderConstant("D6" , PITCH_D6 ); + defReaderConstant("Dm6", PITCH_Dm6); + defReaderConstant("Eb6", PITCH_Eb6); + defReaderConstant("E6" , PITCH_E6 ); + defReaderConstant("F6" , PITCH_F6 ); + defReaderConstant("Fm6", PITCH_Fm6); + defReaderConstant("Gb6", PITCH_Gb6); + defReaderConstant("G6" , PITCH_G6 ); + defReaderConstant("Gm6", PITCH_Gm6); + defReaderConstant("Ab6", PITCH_Ab6); + defReaderConstant("A6" , PITCH_A6 ); + defReaderConstant("Am6", PITCH_Am6); + defReaderConstant("Bb6", PITCH_Bb6); + defReaderConstant("Hb6", PITCH_Hb6); + defReaderConstant("B6" , PITCH_B6 ); + defReaderConstant("H6" , PITCH_H6 ); + defReaderConstant("C7" , PITCH_C7 ); + defReaderConstant("Cm7", PITCH_Cm7); + defReaderConstant("Db7", PITCH_Db7); + defReaderConstant("D7" , PITCH_D7 ); + defReaderConstant("Dm7", PITCH_Dm7); + defReaderConstant("Eb7", PITCH_Eb7); + defReaderConstant("E7" , PITCH_E7 ); + defReaderConstant("F7" , PITCH_F7 ); + defReaderConstant("Fm7", PITCH_Fm7); + defReaderConstant("Gb7", PITCH_Gb7); + defReaderConstant("G7" , PITCH_G7 ); + defReaderConstant("Gm7", PITCH_Gm7); + defReaderConstant("Ab7", PITCH_Ab7); + defReaderConstant("A7" , PITCH_A7 ); + defReaderConstant("Am7", PITCH_Am7); + defReaderConstant("Bb7", PITCH_Bb7); + defReaderConstant("Hb7", PITCH_Hb7); + defReaderConstant("B7" , PITCH_B7 ); + defReaderConstant("H7" , PITCH_H7 ); + defReaderConstant("C8" , PITCH_C8 ); + defReaderConstant("Cm8", PITCH_Cm8); + defReaderConstant("Db8", PITCH_Db8); + defReaderConstant("D8" , PITCH_D8 ); + defReaderConstant("Dm8", PITCH_Dm8); + defReaderConstant("Eb8", PITCH_Eb8); + defReaderConstant("E8" , PITCH_E8 ); + defReaderConstant("F8" , PITCH_F8 ); + defReaderConstant("Fm8", PITCH_Fm8); + defReaderConstant("Gb8", PITCH_Gb8); + defReaderConstant("G8" , PITCH_G8 ); + defReaderConstant("Gm8", PITCH_Gm8); + defReaderConstant("A8" , PITCH_A8 ); + + defReaderConstant("La0" , 0); + defReaderConstant("La#0", 1); + defReaderConstant("Si0" , 2); + defReaderConstant("Do1" , 3); + defReaderConstant("Do#1", 4); + defReaderConstant("Re1" , 5); + defReaderConstant("Re#1", 6); + defReaderConstant("Mi1" , 7); + defReaderConstant("Fa1" , 8); + defReaderConstant("Fa#1", 9); + defReaderConstant("So1" , 10); defReaderConstant("So#1", 11); - defReaderConstant("La1", 12); + defReaderConstant("La1" , 12); defReaderConstant("La#1", 13); - defReaderConstant("Si1", 14); - defReaderConstant("Do2", 15); + defReaderConstant("Si1" , 14); + defReaderConstant("Do2" , 15); defReaderConstant("Do#2", 16); - defReaderConstant("Re2", 17); + defReaderConstant("Re2" , 17); defReaderConstant("Re#2", 18); - defReaderConstant("Mi2", 19); - defReaderConstant("Fa2", 20); + defReaderConstant("Mi2" , 19); + defReaderConstant("Fa2" , 20); defReaderConstant("Fa#2", 21); - defReaderConstant("So2", 22); + defReaderConstant("So2" , 22); defReaderConstant("So#2", 23); - defReaderConstant("La2", 24); + defReaderConstant("La2" , 24); defReaderConstant("La#2", 25); - defReaderConstant("Si2", 26); - defReaderConstant("Do3", 27); + defReaderConstant("Si2" , 26); + defReaderConstant("Do3" , 27); defReaderConstant("Do#3", 28); - defReaderConstant("Re3", 29); + defReaderConstant("Re3" , 29); defReaderConstant("Re#3", 30); - defReaderConstant("Mi3", 31); - defReaderConstant("Fa3", 32); + defReaderConstant("Mi3" , 31); + defReaderConstant("Fa3" , 32); defReaderConstant("Fa#3", 33); - defReaderConstant("So3", 34); + defReaderConstant("So3" , 34); defReaderConstant("So#3", 35); - defReaderConstant("La3", 36); + defReaderConstant("La3" , 36); defReaderConstant("La#3", 37); - defReaderConstant("Si3", 38); - defReaderConstant("Do4", 39); + defReaderConstant("Si3" , 38); + defReaderConstant("Do4" , 39); defReaderConstant("Do#4", 40); - defReaderConstant("Re4", 41); + defReaderConstant("Re4" , 41); defReaderConstant("Re#4", 42); - defReaderConstant("Mi4", 43); - defReaderConstant("Fa4", 44); + defReaderConstant("Mi4" , 43); + defReaderConstant("Fa4" , 44); defReaderConstant("Fa#4", 45); - defReaderConstant("So4", 46); + defReaderConstant("So4" , 46); defReaderConstant("So#4", 47); - defReaderConstant("La4", 48); + defReaderConstant("La4" , 48); defReaderConstant("La#4", 49); - defReaderConstant("Si4", 50); - defReaderConstant("Do5", 51); + defReaderConstant("Si4" , 50); + defReaderConstant("Do5" , 51); defReaderConstant("Do#5", 52); - defReaderConstant("Re5", 53); + defReaderConstant("Re5" , 53); defReaderConstant("Re#5", 54); - defReaderConstant("Mi5", 55); - defReaderConstant("Fa5", 56); + defReaderConstant("Mi5" , 55); + defReaderConstant("Fa5" , 56); defReaderConstant("Fa#5", 57); - defReaderConstant("So5", 58); + defReaderConstant("So5" , 58); defReaderConstant("So#5", 59); - defReaderConstant("La5", 60); + defReaderConstant("La5" , 60); defReaderConstant("La#5", 61); - defReaderConstant("Si5", 62); - defReaderConstant("Do6", 63); + defReaderConstant("Si5" , 62); + defReaderConstant("Do6" , 63); defReaderConstant("Do#6", 64); - defReaderConstant("Re6", 65); + defReaderConstant("Re6" , 65); defReaderConstant("Re#6", 66); - defReaderConstant("Mi6", 67); - defReaderConstant("Fa6", 68); + defReaderConstant("Mi6" , 67); + defReaderConstant("Fa6" , 68); defReaderConstant("Fa#6", 69); - defReaderConstant("So6", 70); + defReaderConstant("So6" , 70); defReaderConstant("So#6", 71); - defReaderConstant("La6", 72); + defReaderConstant("La6" , 72); defReaderConstant("La#6", 73); - defReaderConstant("Si6", 74); - defReaderConstant("Do7", 75); + defReaderConstant("Si6" , 74); + defReaderConstant("Do7" , 75); defReaderConstant("Do#7", 76); - defReaderConstant("Re7", 77); + defReaderConstant("Re7" , 77); defReaderConstant("Re#7", 78); - defReaderConstant("Mi7", 79); - defReaderConstant("Fa7", 80); + defReaderConstant("Mi7" , 79); + defReaderConstant("Fa7" , 80); defReaderConstant("Fa#7", 81); - defReaderConstant("So7", 82); + defReaderConstant("So7" , 82); defReaderConstant("So#7", 83); - defReaderConstant("La7", 84); + defReaderConstant("La7" , 84); defReaderConstant("La#7", 85); - defReaderConstant("Si7", 86); - defReaderConstant("Do8", 87); + defReaderConstant("Si7" , 86); + defReaderConstant("Do8" , 87); defReaderConstant("Do#8", 88); - defReaderConstant("Re8", 89); + defReaderConstant("Re8" , 89); defReaderConstant("Re#8", 90); - defReaderConstant("Mi8", 91); - defReaderConstant("Fa8", 92); + defReaderConstant("Mi8" , 91); + defReaderConstant("Fa8" , 92); defReaderConstant("Fa#8", 93); - defReaderConstant("So8", 94); + defReaderConstant("So8" , 94); defReaderConstant("So#8", 95); - defReaderConstant("La8", 96); - + defReaderConstant("La8" , 96); + } // The Printer