How to convert notes into chords?

My level: beginner.

I am learning with the easiest version of song, which consists only of single notes. I thought I convert LH notes into chords, treating the given notes as root notes of the chords for given scale. I tried it and it sounds good.

But, when I checked through entire sheet in bass clef (LH) there are problems -- I see the 7th note of the scale, and there is also a note out of the scale. The first case means (?) the chord is diminished one, and it does not sound pleasantly, with the second I have no idea what to do.

Question: so what is general algorithm for converting notes into chords?

With this piece, there are no accidentals next to clefs, so I assume it is C scale (or Am right? but it would not change the the available notes), and the problematic notes are "b" (thus it would render Bdim chord) and "g#" note, and this is obviously not within C scale.

• That G&sharp; is the clue. It's not necessarily in key c, but could be in key A minor. That G&sharp; does exist in A minor - it's part of the V chord, and quite often has the G&sharp; as the 'proper' leading note back to i (Am).
– Tim
Commented May 25 at 14:12
• There isn’t really an “algorithm” but there are guidelines and the actual process is very complicated. Commented May 25 at 14:12
• It will be very helpful to include several illustrations of the "before" (the original score) and the "after" (the score after you converted the LH notes into chords). Because by your narrative alone, it's hard to discern possible mistakes you made, which then limit our ability to suggest possible ways to improve your approach, as the first steps to generalize it into the "algorithm" you are seeking. Seeing how you are interested in data mining & machine learning, maybe this "algorithm" can be in the form training a machine learning model ! Commented May 25 at 14:24
• Humanly speaking, you cannot avoid studying a theory of harmony, which in essence IS a list of rules. But so we can help you I have a hard time visualizing the LH notes you are referring to. Most examples pieces in the OP (in addition to the one you mentions in the comment) would be helpful for a potential answerers to look at so we can see the original LH notations. But I don't think Fair use prohibit posting 2-3 measure snapshots (not the whole piece). Some online store websites even posts whole page previews of the score they sell. Commented May 25 at 14:36
• There’s one important part that I think is missing. When you see a left-hand note you can’t know for sure what the cord is. Or, rather, there is often more than one valid choice. Left-hand note is not always the “root“ of the cord ( the note the cord is named for). It doesn’t even always have to be a note that belongs to the chord! Choosing chords to go with left-hand notes is a common exercise and art, called “harmonization.“ Commented May 25 at 20:43

(For this answer to make more sense, let's assume that I don't know the tune in the question.)

My algorithm for harmonizing notes is based on my chord vocabulary I have gathered by playing lots of songs in practice. From my chord vocabulary, I retrieve known patterns that could fit over the given notes. The algorithm goes like this:

``````WHILE NOT HAPPY WITH ARRANGEMENT:
FOR EACH BAR:
RETRIEVE CANDIDATE CHORD PATTERNS FROM VOCABULARY
USE ONE OF THE CANDIDATES IN THE BAR
RE-EVALUATE HAPPINESS
``````

I am aware of a thing called chromatic alteration which is notated with accidentals. If I didn't know about chromatic alterations and if I assumed that music has to be "in a scale", it would make a lot of music seem like a violation of laws of nature and thus incomprehensible.

The question's notation example doesn't have a key signature - or has a key signature of zero sharps or flats, which I know from my experience to be often used in songs where the tonal center is C major or A minor. That narrows my guessing down a lot.

Then there is a G# note, which happens to be one of the first things about notation I have ever been taught. The accidental means, "now G is sharp". Accidentals change notes. Notes can be made sharp or flat or natural.

From my chord vocabulary, I know that G# is needed for an E major chord, which is often found in chord movements like E - Am. This automatically makes me narrow the search space for chords. As one candidate pattern, I would try an E major chord over the last two bars.

The first bar has F and C notes, so an F major is an easy default guess.

The second bar keeps the low F note, but the upper stave - which I assume to be melodically more important - makes a D-G jump. Where have I seen this, especially if it comes after an F major chord? In a chord pair F - G/F, which is an idiom I use in my own playing a lot, probably too much.

The third bar moves the low note to G and keeps melody at D - looks like a G major chord. Let's try G.

But the fourth bar does the same thing. I don't want to keep the same chords two bars in a row, I want a chord rhythm of one chord change per bar, because that's what I already established. I'll make the chord Fm6/G. This actually fits the next bar nicely because the Fm's Ab note can be enharmonically re-interpreted as G# so it's kind of a voice-leading nicety too.

The fifth bar could be something like E/G#, that was already pretty much decided when spotting the G# note. But am I happy with that? In the fourth bar I used the thick Fm6/G chord, so now I would lose the spicy F there. Do I want that? I could keep it by making the chord like an E7(b9)/G# where the flat 9 would be F.

The sixth bar could let the F move back down to E, so plain E7/G#.

But am I happy now? Maybe if the fifth bar left out the E note so it would come about as an F resolving down to E. What would that even called, considering that there's going to be someone complaining about enharmonic spellings and theory hygiene. "E7(b9)(omit 1)/G#"? "Fm maj7 -5 / Ab"??? Then the G# would have to be enharmonically re-spelled, and someone could say that it isn't a "correct" answer to the exercise. Let's just not care about omitting the E.

In other words, I say it's based on subjective experience and taste. You are free to feel that the Fm6/G is cheesy.

• Hats off, your answer is pure awesomeness :-). This is super helpful. And depressing at the same time, music is vast space apparently :-). Commented May 25 at 19:15
• @greenoldman Learning the vocabulary may seem like a huge and daunting task, but I don't see it that way, because I've learned simply through playing songs by ear i.e. by having fun with music. I'd recommend the same for others as well. Playing from written notation can be done, but I don't think it's as efficient for learning vocabulary as playing by ear. Playing chords by ear means having to find the chords, to make discoveries, which is fun, to me at least. I also recommend playing songs in different keys, to better learn the relative patterns. Commented May 25 at 19:36
• Thank you again, I watched some YT videos about it and I already am 200% convinced playing by ear is super needed, however I would like to write program for it (to check me; I am self-taught so it would act as kind of teacher). It would complete all sides of playing. "playing songs in different keys," Do you mean taking given song/piece and transposing it, or selecting different songs which are written in various keys? Commented May 25 at 20:20
• @greenoldman By playing in different keys I meant playing the same song in different keys. If you already learned to play it by ear, play it by ear in another key. Doing this makes you learn the keys and their "piano geometry" better i.e. how the pattern of white and black keys is in each key, and you learn the chord patterns better as well, because you have to translate everything to relative roles and cannot rely on absolute locations on the keyboard. You don't necessarily need to do all keys, and some keys can be more difficult at first, but try to do at least a couple of keys. Commented May 25 at 20:29
• Yes, I noticed this as well. Unfortunately it is somewhat common behavior, I already learned (mainly on StackOverflow) not to pay attention to this, there will be always someone frustrated for this or other reason. I count your answer very highly not only in musical sense, but as encouragement. Commented May 25 at 20:46