more debug strings

This commit is contained in:
2026-03-12 15:06:58 -06:00
parent 0be0c3c0c9
commit a3bb1cf11b
2 changed files with 22 additions and 14 deletions

5
src/testdata/sandbox.txt vendored Normal file
View File

@@ -0,0 +1,5 @@
. a . b . c
2a2 2b2 2c2
. d . e . f
2d2 2e2 2f2

View File

@@ -84,21 +84,24 @@ impl Tone {
} }
pub fn string(&self) -> String { pub fn string(&self) -> String {
match self.i32() { let v = self.i32();
57|69 => "a", let modifier = if v > 0 && v < 57 { "-" } else if v >= 69 { "+" } else { "" };
58|70 => "a+", modifier.to_string() + match v {
59|71 => "b", 45|57|69 => "a",
60|72 => "c", 46|58|70 => "a+",
61|73 => "c+", 47|59|71 => "b",
62|74 => "d", 48|60|72 => "c",
63|75 => "d+", 49|61|73 => "c+",
64|76 => "e", 50|62|74 => "d",
65|77 => "f", 51|63|75 => "d+",
66|78 => "f+", 52|64|76 => "e",
67|79 => "g", 53|65|77 => "f",
68|80 => "g+", 54|66|78 => "f+",
55|67|79 => "g",
56|68|80 => "g+",
0 => " ",
_ => "?", _ => "?",
}.to_string() }
} }
} }