The Enharmonic Twin: C Sharp and D Flat Are Different Strings, the Same Key, and a Merge Waiting to Happen
"C#" and "Db" share nothing as text: different letter, different sign, different sort order. On the instrument they are one key, one pitch class, one...
"C#" and "Db" share nothing as text: different letter, different sign, different sort order. On the instrument they are one key, one pitch class, one row in any honest register. A cleaning run built for this piece took the twelve pitch classes through five written forms, ten times each, 600 rows in all, and the two spellings filed exactly every time they were written in full, while their shared letter, stripped of its sign, merged them with their neighbours. This piece is a step-by-step guide: it inventories the register, walks the cleaning steps in order, and shows at which step the accidental, the smallest character in the data, decides whether a row survives.
What The Enharmonic Twin means
The Enharmonic Twin is a pair of spellings for one pitch class that are fully derivable from each other by letter-and-accidental arithmetic, yet collapse into different wrong rows the moment either is reduced to its letter alone. The nearest prior concept in this series is The Parallel Names, "two complete registries for the same objects whose entries correspond one-to-one but share no derivable structure" (batch 42 of this series). That is the opposite situation. Parallel names can only be joined by a lookup table, because nothing about one name predicts the other. Enharmonic spellings predict each other completely: raise the flat name's letter by its accidental, or lower the sharp name's, and the twin is determined. The register's failure is therefore not ignorance. It is loss: the information that distinguishes the twins was present in the source, was derivable at every step, and was thrown away by a field that kept the letter and dropped the sign.
The register under cleaning
The register holds the twelve pitch classes, numbered 0 to 11. Five classes carry two different names, one in the sharp system and one in the flat system: class 1 is C# and Db, class 3 is D# and Eb, class 6 is F# and Gb, class 8 is G# and Ab, class 10 is A# and Bb. The other seven classes carry the same name in both systems. Each class was written in five forms: its sharp name, its flat name, its sharp name's letter alone, its flat name's letter alone, and its class number. The reader rules were fixed before the run: a full name is read by an accidental-aware name reader; a letter alone is read against every class whose name in that system begins with the letter; a class number is read as itself.
Step one: read the full names, and lose nothing
Both name forms filed 120 of 120 rows exactly. This is the control result, and it matters because it clears the names themselves: neither spelling system is ambiguous, incomplete or inconsistent. Any cleaning process that receives full names and produces merges has introduced the damage itself, downstream of intake.
Step two: drop the accidental in the sharp system
The sharp letter alone filed 20 rows exactly and merged 100. The two survivors are the letters that begin exactly one sharp name: E, which begins only class 4, and B, which begins only class 11. Every other letter begins two names, a natural and its sharp, and the reader cannot choose. Class 1 written as "C" merged into the pair [0, 1]: the row for C sharp became indistinguishable from the row for C natural. Class 10 written as "A" merged into [9, 10] the same way.
Step three: drop the accidental in the flat system
The flat letter alone also filed 20 exactly and merged 100, but the survivors are different classes, and the difference is the step most migrations miss. In the flat system the safe letters are C, beginning only class 0, and F, beginning only class 5. Class 6 written as "G" merged into [6, 7], because Gb and G share the letter. A migration that tests its letter-only fallback on one spelling system and finds classes 4 and 11 safe will silently misjudge the other system, where the safe classes are 0 and 5: the two systems distribute the same twelve classes across the same seven letters in different places, so a letter's safety is a property of the system, not of the letter.
Step four: read the class numbers, and lose the spelling
The class number filed 120 of 120 exactly, the register's second perfect form. Its loss is of a different kind: a number identifies the class completely and records nothing about how the class was spelled, so a catalogue converted to numbers can never be converted back into the spelling its source used. For a register whose consumers display names, the number form is a one-way door, exact in the run and destructive in the archive.
Worked example: three rows through the whole pipeline
Class 1 enters as "Db" in the flat name form and files exactly as class 1. The same class enters as "C" in the sharp letter form and merges with class 0, the register's C natural row. Class 6 enters as "G" in the flat letter form and merges with class 7. Class 5 enters as "F" in the flat letter form and files exactly, because no other flat name begins with F. Across the full run the totals were 400 exact and 200 merged out of 600 rows, with no refusals: the letter forms account for all 200 merges, split evenly between the two spelling systems, and the register's damage report is exactly a map of where the accidentals were dropped.
What the proportions mean at catalogue scale
The run's 600 rows are a model, but the proportions are the finding. One third of all rows merged, and every merge came from the two letter forms, which between them filed only 40 of their 240 rows exactly. A real catalogue carrying letter-only fields at the same rate would not lose a third of its rows uniformly; it would lose them in clusters, around the five doubled classes, so entire pitch classes would arrive pre-merged while the natural classes looked clean. That clustering is why the damage escapes sampling: an auditor who spot-checks rows at random meets the clean natural classes first and signs off on a register whose sharp and flat classes have already collapsed into each other.
Frequently asked questions
How many pitch classes have two different names in this register?
Five: classes 1, 3, 6, 8 and 10 each carry a sharp name and a different flat name. The other seven classes are spelled identically in both systems.
Which letters are safe to store alone?
In the sharp system, E and B each begin exactly one name, and their rows filed exactly. In the flat system, C and F are the safe letters. Every other letter begins two names and merged its rows.
Does the class-number form lose anything in the run?
Nothing: it filed 120 of 120 exactly. What it loses is the spelling itself, which no later step can recover from the number.
Why do the two letter forms fail on different classes?
Because the systems assign different letters to the same class: class 1 is a C in the sharp system and a D in the flat system, so the letter that endangers it differs by system.
The next action
Audit any music catalogue for letter-only fields before migrating it, and convert those fields to full names or class numbers at intake, choosing numbers only where the original spelling is preserved somewhere else. The accidental is one character; the merge it prevents is the difference between 400 clean rows and 600.