ref: acc598bd8ee24161fc1ebcf7032e511187fbcfa9
parent: ac088f11139fcbafed579dbd487a39a2ffd0a116
author: cancel <cancel@cancel.fm>
date: Sun Jan 19 16:12:30 EST 2020
Cleanup
--- a/sim.c
+++ b/sim.c
@@ -99,12 +99,12 @@
// Returns UINT8_MAX if not a valid note.
static U8 midi_note_number_of(Glyph g) {
- int deg, sharp = (g & 1 << 5) >> 5; // sharp=1 if lowercase
- g &= ~(1 << 5); // make uppercase
- if (g < 'A' || g > 'Z') // A through Z only
+ int sharp = (g & 1 << 5) >> 5; // sharp=1 if lowercase
+ g &= ~(1 << 5); // make uppercase
+ if (g < 'A' || g > 'Z') // A through Z only
return UINT8_MAX;
// We want C=0, D=1, E=2, etc. A and B are equivalent to H and I.
- deg = g <= 'B' ? 'G' - 'B' + g - 'A' : g - 'C';
+ int deg = g <= 'B' ? 'G' - 'B' + g - 'A' : g - 'C';
return (U8)(deg / 7 * 12 + (I8[]){0, 2, 4, 5, 7, 9, 11}[deg % 7] + sharp);
}