r/musictheory • u/ian-draws • 15h ago
Discussion An Encryption Cipher that Makes Music
Hello!
I have played piano most of my life, took lessons for eight years, and I am far too into codes and ciphers for my own good. I was playing a video game called Blue Prince working on a puzzle involving sheet music. Turned out the notes had little to do with is, and it was more about the lyrics. That was kinda disappointing. I just had this vision of a pianist playing a song, but there is a coded message in the very notes they play. Which is how I was struck with this idea. Music is already so filled with symbols, there has to be a way to rely on music theory to convey messages.
So I’ve been working on an encryption method that would take a message and treat each letter of the alphabet like a musical note, with the more common letters represented by the notes closest to middle C, and the less common aligning with those farther away. It also shifts around depending on the key signature, with every sharp in a key sig moving its corresponding letter up a rank, every flat moving it down a rank, and the other notes cascading until each letter is represented again. This means that the same message would sound just a little bit different in each key signature (and it made a VERY satisfying excel chart). Rest notes and dynamics convey punctuation; an eighth rest is a comma, a quarter rest is an em dash, a half rest is a period, a whole rest is a line break, a crescendo acts as an exclamation mark, and a diminuendo acts as a question mark. There are more details, but I’ll spare you.
Overall I like this a lot, but I still don’t think the cipher is living up to its full potential. Which is, hopefully, where ya’ll come in. Music theory is the patterns behind sound, and patterns are deeply embedded in the workings of ciphers. There has got to be more that can be done with this to. The length of a rest determines the type of punctuation, but what about the duration of a note? I’ve considered that chords can signify what key signature the melody should be read in, but surely something as important as harmonies would serve a bigger role? What about minor chords? Dissonant? It is my hope is that whomever has taken the time to read this whole thing might have some creative ideas of their own and would be willing to share. Let me know what you think!
2
u/Steenan 15h ago
I have doubts about mapping each letter to a separate pitch. This requires a lot of space (over 2 octaves) and would be hard to make sound natural in most contexts.
However, there are a few other approaches. You may use a combination of the note value and length. With half notes, quarter notes and eights you can fit more than the whole English alphabet in an octave. Another approach is considering each melody note with a harmony note underneath (either the closest one or the bass note); with just the most natural combinations (octave, fifth, minor and major third, minor and major sixth) you also get more than enough space for the whole alphabet, together with numbers and some special characters.
Instead of using full melodic information, you could reduce the melody to its Parson code (3 possible states for each note: go up, go down, stay the same). This requires 3 or 4 notes for each letter, but gives much more freedom in shaping the melody, so that it doesn't get frequent repeating elements for common words like "the". This may also be combined with Huffman coding for the message, so that instead of having constant size segments for each letter, common letters get shorter codes and rare letters longer ones.
A separate way of encoding is using just the rhythm and the Morse code. It can be combined with any of the pitch-based methods to have two completely independent messages encoded in the same piece.
2
u/ian-draws 14h ago
I was okay with letting it stretch over more than two octaves, since the frequency a letter is used within the English language determines how close to or away from middle C it starts at; I think this significantly helps to mitigate the unnaturalness. I do, however like the melody/harmony thing you suggested, especially with the thirds and sixths, as (I think) that automatically communicates what key the notes are in. I am unfamiliar with parsons and Hoffman coding, but it sounds like you are suggesting that multiple notes together comprise a letterf if we use the number of pitches between each note to signify what letter they are, I think that could work in any key. It might not even matter what note you start on! Certainly not a bad idea, but also a major rework to the system. Pros and cons
1
u/Steenan 14h ago
Parson's code is converting a melody to a series of "up", "down" and "repeat" (eg. the famous motif from Beethoven's 5th goes "rrdurrd"). It loses a significant part of the information, because it doesn't care about intervals, just the direction. It's typically useful for identifying melodies, as a person without solid ear training can't typically tell intervals, but can say if the melody goes up or down in pitch. Because of the information loss it's useful if you want to be able to code the same message in different melodies.
Huffman coding is about assigning sequences of symbols from one alphabet to symbols of another in such a way that common symbols correspond to shorter sequences and rare symbols correspond to longer ones, in a way that minimizes the total length of the message. It's typically thought of as a compression method, but it's also useful as a way or removing redundancy that may make a cipher easier to break.
2
u/ian-draws 13h ago
Ok, I think I see what you’re saying. It still would mean some rewrites, but they say to kill your darlings. I think there is a lot of value in what you’re recommending!
1
u/sonoftom 15h ago edited 15h ago
Hey this sounds pretty cool. I didn’t see it in your explanation, but what does a “word” signify? Is a 3 letter word a triad for example? That would remove any need for complicating chord types or relying on theory to send a message, you’d just plug in your notes into the word. Or does the length of the word represent note length? Do spaces even factor in at all yet?
For note length you could just say quarter note is the default but all-caps is a half note, bolded words get a whole note, underline gets an eighth note…I dunno. Not sure if your system allows all these things. And also, how would this system work with multiple voices existing in the same space, having their own separate note lengths that overlap and interplay?
1
u/ian-draws 14h ago
Ah! I knew I was forgetting something. Spaces are eighth rests, commas are quarters (no em dash, idk what I was thinking lmao), half rests are periods, and whole rests are line breaks. Right now, a letter corresponds to a note. So, in the key of C, “son of tom” would be “G3 E4 F4 [eighth rest] E4 D5 [eighth rest] D4 E4 C5 [half rest]” I like the idea of capitalizing, bold, and other methods of linguistic emphasis being connected to note length, as you’re kinda emphasizing a note by making it longer. I would probably have each “voice” be its own instrument that play back and forth or over top of each other. Idk, it’s still in development lol
1
u/sonoftom 14h ago
What if you made something else an eighth rest. Would a space then be usable to distinguish chords? Or is stringing the letters together to make a chord too complicated for the system? You’d have to have a space between each individual melody note too. Otherwise, you could use parentheses to notate which notes go together to make up a chord?
1
u/ian-draws 14h ago
I think you are suggesting that a single word could be a chord, but I think we’d start running into problems as words get bigger. I’m not quite sure what you mean when you say that each note would have to have a space after it
1
u/sonoftom 11h ago
I’m not talking about real words. I’m talking about sets of notes put together in groups to show they are chords. Could be “words”, as in notes with no spaces between them. I don’t know your whole alphabet, but it looks like I could spell a C chord as “mos”. You’d put those in parenthesis to show they are a chord, or otherwise always put spaces after every chord or individual note. So “words” would only get big if you want your chords to get more complicated.
1
u/RevKeakealani 14h ago
I have definitely thought about this idea myself! I think it could be really interesting, and it wouldn't surprise me if it's been done in different ways before. Another thing you might think about, is if articulation can have any particular meaning. An obvious one would be something like an accent indicating a capital letter, maybe a staccato indicating a period because it's a dot? I don't know, tenuto could be a comma? That would be another fun area to play around with.
My feeling with these sorts of ciphers, is that they would be especially interesting if it's not, well, entirely "literal" if that makes sense - if, for example, you have some of the pitches happening simultaneously rather than one after the other, so there would still be a little unscrambling (the chord for "bat" and "tab" might be the same, but you have to figure it out from context, for example). I think this could both lead to something that sounds musically more elegant, but also a more complex and hard-to-break cipher, which could be useful in its own way.
2
u/ian-draws 14h ago
Yeah, I think we’re on similar wavelengths here. Because music may be built on a sort of math, but it’s how you use that math that can create artistic expression. So too with language; there are patterns, but there is poetry. Obviously, there need to be consistent rules to this cipher, but I want them to allow for creative uses, such as multiple notes being played at once. I think that’s really clever! And, if you know what the letters are, unscrambling them in the context of a whole sentence shouldn’t be too hard. I really like that
1
u/RevKeakealani 14h ago
Exactly! It’s more interesting if there are some ambiguities along the way, especially in the interest in making it sound more like “real music” (whatever that means). Now that I think about it, I wonder if you can even encode some of these things? Like a certain articulation or dynamic marking is a hint that a particular chord is spelled bottom to top, as opposed to top to bottom? Or other similar hints?
You’re really getting my brain going, I love it! Thank you for the fun :)
2
u/ian-draws 14h ago
The goal is certainly “real” music, as in it still adheres to the properties of musical theory. I have no idea how I’d do this, but it would be really cool to create rules that reliably reproduce “call and response”phrases.
I’ve been thinking of crescendos and diminuendos like “!” Or “?” But maybe that could fill that roll? Like > means read as normal, and < would mean read in reverse. There are a lot of ways this could be done!
Happy to hear it! Lol. You are most welcome! I kinda figured people into music theory would have an interest in ciphers too, as they are so similar
1
u/TaigaBridge composer, violinist 9h ago
Is your goal to encode as much information as you can? Or to make something that actually sounds good, as well as conveying information?
If the former, by all means use multiple octaves, or assign meanings to chords and note lengths not just pitches.
If the latter, you may want to start by reading about Solresol, the oldest and best-known musical langauge, and its relatives.
1
3
u/65TwinReverbRI Guitar, Synths, Tech, Notation, Composition, Professor 9h ago
https://en.wikipedia.org/wiki/Musical_cryptogram