You are here:

Musical Composition, Theory and Songwriting/Determining the # of sharps or flats in a song



How do I know how many sharps or flats are in a song Iím writing on the piano when I write it out by hand on sheet music? I'm getting confused because some notes I'm writing are accidentals. Meaning there a part of the song but are not mainly repeated sharp or flat notes like the others through out.


ANSWER: Hi Sterling,

Thanks very much for contacting me but I do apologise for the delay in getting back to you. I think the first thing you need to do is to determine the key of the song when you've sketched out the melody. There are several ways of working this out.  But if your melody for example always seems to need an F sharp instead of an F to make it sound right, then you can assume that the key signature will contain an F sharp and therefore the key will be G. There are many web pages that can tell you how many sharps or flats in a given key.

Another way to find the key of the piece is to look at the very last note of the song. The last note is usually (but not always) the tonic - or key note. If the last note in your song is D, for example, then the key is probably D. If the last note is C, then the key is probably C. The last chord will tell you something too, because the last chord in a song is nearly always the tonic-chord and the main chord of the key. If your last chord is F major, then the song is probably in F major too.

So sort out the key first and write the key signature at the start of each staff. You seem to know what accidentals are so perhaps I don't need to explain. Once you have established the key of the song you can just add the accidental sharps and flats as they occur. Don't try a short cut by adding them to the key signature because it will be confusing for anyone else.

I don't know whether this helpful or not but by all means get back to me if you think it would be productive.

Best wishes and I wish you well with your song-writing.


---------- FOLLOW-UP ----------

QUESTION: Thanks for replying back Dr Colin. It's ok, I understand how life can get busy. Do you know if a music composition software will tell an Pianist who many sharps or flats are in their song when they play it plugged into their labtop computer? If so what program do you recommend?


Hi Sterling,

Thanks for getting back to me. I am wondering whether you are making things too difficult. It might be that you are getting the horse and the cart in the wrong order! I spend quite a lot of time writing musical compositions and writing music arrangements. In every case, the first thing I always do is to decide which key I want to use. I suppose this is a bit like writing a story and deciding whether you want to use the past or the present tense. It is something you need to do at the start rather than at the end, when the story is finished.

But in music there are other issues. If you are writing a song for example, you need to be sure that the notes will stay within a particular voice range. If you're writing for an instrument, you need to be sure that the notes fit on to the instrument and that the key is suitable for the instrument. For example, keys like E major and B major are very difficult on the saxophone and keys like A flat or D flat are difficult on a stringed instrument and best avoided for most music.

Most music theory books contain a chart which indicates the key signatures for all keys. There are only twelve major keys possible, so it's not exactly a life-time's work! In practice, you'll probably never need to use complicated keys like C sharp, F sharp, D flat or G flat so that reduces the number even further. I think you'll save yourself a lot of time in future by taking the bull by the horns and simply learning what the key signatures are. It really isn't very difficult. If you have already composed something and you're trying to find the key it's in, then my previous response should help. But here's page with some written examples which you might find useful:

As to music software that can identify the key, I really don't know of anything specific that will do what you describe. This probably because most people decide the key before they start. I use Finale, and have done so for years. However, it is an expensive programme and takes a long time to learn. I wouldn't recommend it to anyone unless they have a thorough knowledge and full understanding of music theory. However, there are some free more basic music notation programs available which you might want to try, though whether they have a built-in key recognizer I don't know. You could try downloading Noteworthy, or Musescore, or Finale's Notepad which is also free. It is difficult for me to recommend any particular one because I don't know your exact level of musical knowledge. It will up to you to decide which best suits your needs.

I'd also suggest that it would be worth your time getting a broader understanding of music theory and I came across this e-book this morning. I have not seen it myself,so I cannot recommend it as such, but it looks as though you might find it useful:

Anyway, I hope this helps a bit. Feel free to get back to me if necessary.

Best wishes


Musical Composition, Theory and Songwriting

All Answers

Answers by Expert:

Ask Experts


Dr Colin


I can answer questions from students of "classical" composing, arranging, notation problems and music theory, writing for instruments and voice and writing music for education. I can answer questions about orchestration but I do not cover questions about pop or rock music, pop song writing or electronic music.

I taught for many years in UK up to "A" level theory and composition. I have spent many years in music education, initially (like everyone else) as a teacher. Then I moved on to advisory work (teaching teachers!) and also lectured, giving many workshops for teachers in developing music education skills and techniques. For a time I worked as a teacher-lecturer at London University's Institute of Education and eventually worked full-time as a Music Education Adviser to schools in part of London, offering advice on music education and curriculum development.


I started composing music at the age 14 (it was mostly rubbish, since you asked) and now have a large number of compositions to credit as well as many publications, especially for instrumental music and choral music. I have also written several acclaimed works for large orchestra and choir. My work has been published particularly in the UK (under different names)(notably by Boosey & Hawkes, Novello, and Schott) but also in the USA and the Netherlands.

My music for elementary players (several publications) has been performed and broadcast worldwide. I am now retired from my previous job as Music Education Adviser. These days I spend most of my time composing and arranging. I am currently working on instrumental arrangements of world national anthems for my National Anthems website and also completing a suite of very easy piano solos and duets for elementary players. For many years I have used the music program "Finale" for all my music writing activities.

International Society for Music Education; Fellow of the Royal Society of Arts.

"The Times" Educational Supplement; "Hi-Fi News and Record Review". For several years, I used to write for many of the state music education periodicals in the US and I also wrote several influential articles on instrumental music teaching for "Music Teacher" magazine in the UK. (UK).

PhD(Hons); MA(Hons); FLCM (compositon) ARCM, LMusTCL,(music diplomas)

©2016 All rights reserved.