Coding 2026-06-20
I've got some time before I "need" to get to bed, but I'm feeling pretty worn out. Here's the plan.
I want to put together a basis for scientific pitch notation. Here's what that's going to have:
- A closed set of pitch names, expressed as an enum.
- An attrs class that combines a pitch name, an octave number, and an optional accidental defaulting to zero. (Something has gone very wrong if that last one goes above, like, 2, in 12edo, but I feel like it should just always be the same as the gap between steps, so "sharp" means a different number depending on the scale.)
- Then I need to be able to go from an instance of that class to a frequency, and I want the "decision" there to be based on the scale.
Now, because the calculation happens outside the attrs class, (because, say, 12edo and quarter-comma meantone would produce different frequencies for most pitches), that means there's a bit more freedom for how the data gets stored in the class, potentially.
...
All right, I've sketched out a prototype. It's pretty janky, and it still needs the concept of different modes to really make sense.
I think one thing I need to do is work out how to embed the scale information into the pitch data. That will give it enough data to derive a frequency from a single object, and to apply intervals properly. And doing that might result in a few rounds of re-working.
For now, I'm going to wind down properly. Ish.
Good night.