# Figuring out the key signature of a piece of music I wrote

I recently wrote string quartet with five movements and now have run into a rather large problem. Since I have never taken a music theory class or a composition class in my life, I didn't know how to write music tonally with a key signature. Because I never wrote the piece with a key signature I now have a 15 minute quartet with more accidentals than non-accidentals.

What is the best way (If even possible) to write in a key signature?

• Possible duplicate of What does it mean to write a song in a certain key?
– user39614
Commented May 10, 2018 at 4:49
• I have a rough understanding of what it means to write something in a key. I just want to know what the best way of figuring out the key of something that is already written. Commented May 10, 2018 at 4:54
• I just want to know how to get rid of all these accidentals. Commented May 10, 2018 at 4:54
• you could figure out what your final ending chord is (the stack of the four notes at the end of each movement), and use that to determine what the scale and tonic is (if you end on a D major chord, you are in D major) then look up what accidentals that key uses, put those in the key signature, and keep whatever accidentals are left over in the piece. Commented May 10, 2018 at 5:21

I gather you want a method to figure out the best fitting key.

Lets first note (no pun) that a key name is just the first note of the respective scale so the name of the key doesn't have to be sharp or flat to represent a collection of sharp or flats notes.

For example, key of G, representing a Gmajor scale (major is the default) contains one sharp, being F#.

The key names, and the accidentals they contain, follow the 5ths pattern of F,C,G,D,A,E,B.

C has 0 sharps/flats; G has one sharp (F#), and the next one up is D, which contains both the F# carried over from G as well as a C#.

As you can see the accidentals being added also follow the same FCG fifths pattern except they're sharped - F#,C#,G#,D#,A#,E#,B#,

This means that if you have F# notes in your piece then you're at least a key of G. If you have F# and C# notes then the key of D also works, better, as it covers an additional accidental.

Conversely if the sharps notes in your piece are not F#, not C#, etc. then it's perhaps not best represented by a sharp key.

If that's so then consider your sharp notes as flats, the enharmonic equivalents, such as G# which can also be A-flat, and repeat the exercise for the flat keys.

Flat keys follow a similar pattern as sharps but they're going right to left on the list of 5ths, being, for three octaves:

F(flat),C(flat),G(flat),D(flat),A(flat),E(flat),B(flat),F,C,G,D,A,E,B,F#,C#,G#,D#,A#,E#,B#.

That is, key of C has an F note (one to the left) and the key of F adds a B(flat).

The key of E(flat) adds an A(flat) - three flats total, A(flat),E(flat),B(flat).

So if you have B(flat) notes then you're good for the key of F. If you then also have E(flat) notes then you're good for the key of B(flat), and so forth.

But of course you can have notes that are not in a respective key ... they are "chromatic", not "diatonic", so they may have to remain as notated as flats or sharps notes in the piece.

You're looking for the best key, not the 'right' one.

There's hundreds of videos introducing key signatures. I looked at a half-dozen for this answer and these two are concise.