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