Nerdy stuff: why are (playable) chords the way they are?

That is effectively what I was describing. Each string is an offset from the other, but the B/G is the odd one, so nothing linear to work an algorithm from. The mapping to the fretboard still needs to be mapped somehow.

Then we have TTSTTTS for offsetting the major scale, nothing linear there either. This is when I gave in to use the offset lookup tables.

Need modes? just rotate the offsets of the major scale by one letter. (i.e. Dorian=TSTTTST)
Need a different scale? just create a new offset sequence (3TT3T = minor pentatonic where ‘3’ is 3 semitones).

So that works out for a neat tool but doesn’t get the OP where he is trying to go. All I can do for him is throw my work and thoughts out and hope he comes up with something cool.

I will get into that later, but from what I understand that means using the variable minorScale instead of majorScale, like below (the numbers are distances from root):

//var minorScaleInterval = [2,1,2,2,1,2,2];
// var minorScale = [0, 2, 3, 5, 7, 8, 10];
//var majorScaleInterval = [2,2,1,2,2,2,1];
var majorScale = [0, 2, 4, 5, 7, 9, 11];

this look right.
want some more? :crazy_face:

Scale LUT
0 Major 1 1 0.5 1 1 1 0.5
1 Minor 1 0.5 1 1 0.5 1 1
2 Harmonic Minor 1 0.5 1 1 0.5 1.5 0.5
3 Ionian 1 1 0.5 1 1 1 0.5
4 Dorian 1 0.5 1 1 1 0.5 1
5 Phrygian 0.5 1 1 1 0.5 1 1
6 Lydian 1 1 1 0.5 1 1 0.5
7 Mixolydian 1 1 0.5 1 1 0.5 1
8 Aolian 1 0.5 1 1 0.5 1 1
9 Lochrian 0.5 1 1 0.5 1 1 1
10 Maj Pentatonic 1 1 1.5 1 1.5
11 Min Pentatonic 1.5 1 1 1.5 1
12 Maj Blues 1 0.5 0.5 1.5 1 1.5
13 Min Blues 1.5 1 0.5 0.5 1.5 1

I’ll leave you to work that one out.

For a number of reasons which, I doubt, you can codify as they tend to be case-by-case situations.

For instance:

  • You can play a full, traditional, open G chord fretting the second fret B, or you can not play that note and mute the string with the finger fretting the G on the 6th string. Both work, but some people prefer the version without the B because it sounds less “muddy”.

  • There’s the “big” barre version of F, and the “small” F. The small F is often used because it’s easier to play, but also sometimes people prefer the sound.

  • The open C chord is normally played without the 6th string, but some people fret the G on this string and play it.

That’s a few examples.

My thought on this is that developing code only takes you so far.

I think it drives you to learn some of the theory; you have to to understand the mechanisms you are trying to code, but most of this theory is readily available without having to develop algorithms. Many of the algorithms are already there (for instance, TTSTTTS).

Understanding the way chords are built is valuable. Again, the algorithms for this already exist.

I don’t think developing, for instance, an algorithm which finds notes on the fretboard really teaches you anything about music, whether that is in order to build chords or not. The notes in the chords are the notes in the chords and every possible combination that is usable (and some which are not) have already been found and documented. It’s a pattern finding problem, not really a music one.

In fact, it’s so much of a pattern based situation that these patterns have been encapsulated into the CAGED system. The CAGED systems tells you where you can build chords, arpeggios, and scales. But it tells you nothing about why you do any of these things.

How music maps onto the guitar, piano, violin, or any other instrument is a purely mechanical thing which has very little to do with how music works per se.

As I said, I think this stuff tells you the “what” but not the “why” that you seem to be seeking. For instance:

I don’t think any of what you are doing will answer that.

My thought was, if you want to explore the chord shapes and understand where the notes, scales, and intervals are, there’s already applications and tutorials that let you do that without having to invest time developing algorithms and code which tell you nothing about the nature of music.

And, in my experience, most of the material out there does go into the “why” eventually, although I get the feeling you are looking for some greater meaning or technical characteristic which may not exist.

If you are after in in depth explanation, you may enjoy the following book:

But that’s up to you.

Cheers,

Keith

1 Like

Hi Richard, in the diagrams I have seen showing string numbering, the thickest string is labelled as 6 and the thinnest as 1. Is that incorrect?

@DaveTC59 thanks for spotting my error, I was typing too fast! :slight_smile:

@Majik - well, even if the algorithm itself would not lead to insights (which I doubt), the discussion in this thread teaches me a lot! I already had many insights about many misconceptions I had…

I had some thoughts about improvement of the algorithm last night, started debugging this morning and am trying to put my ideas into code now: my goal now is simple shapes with an easy grip - and than compare that to “Justin’s Chords”.

{ “C”: “x32010”, “D”: “xx0232”, “E”: “022100”, “F”: “133211”, “G”: “320003”, “A”: “x02220”, “B”: “x24442” };

Let’s see where it leads me…

BTW I just ordered David Byrnes’ book - being a Talking Heads fan I totally missed this book. Thanks!!!

1 Like

You’ve got some errors there in your chord grips:

D: xx0232
E: 022100
F: 133211
B: x24442

@jjw: corrected - thank you!

So, below I have first results. The numbers in “fretStrings” refer to position in the triad array, 0 being the first (root).

If I have a look at the target chords and compare that to the potential positions in fretStrings I see two rules for creating shapes:

  • try to choose lower frets where possible
  • try to choose as many notes on one fret as possible (so they line up horizontally)

I will implement that and let’s see if this will result in the target Chords…

{
“results”: [
{
“rootNote”: “C”,
“scale”: [
“C”,
“D”,
“E”,
“F”,
“G”,
“A”,
“B”
],
“triad”: [
“C”,
“E”,
“G”
],
“targetChord”: “x32010”,
“fretStrings”: [
“1##2#1”,
“####0#”,
“##1###”,
“20###2”,
“######”,
“##201#”
]
},
{
“rootNote”: “D”,
“scale”: [
“D”,
“E”,
“F#”,
“G”,
“A”,
“B”,
“C#”
],
“triad”: [
“D”,
“F#”,
“A”
],
“targetChord”: “xx0232”,
“fretStrings”: [
#20###”,
“######”,
“1##2#1”,
“####0#”,
“##1###”,
“20###2
]
},
{
“rootNote”: “E”,
“scale”: [
“E”,
“F#”,
“G#”,
“A”,
“B”,
“C#”,
“D#”
],
“triad”: [
“E”,
“G#”,
“B”
],
“targetChord”: “022100”,
“fretStrings”: [
“0###20”,
“###1##”,
#20###”,
“######”,
“1##2#1”,
“####0#”
]
},
{
“rootNote”: “F”,
“scale”: [
“F”,
“G”,
“A”,
“A#”,
“C”,
“D”,
“E”
],
“triad”: [
“F”,
“A”,
“C”
],
“targetChord”: “133211”,
“fretStrings”: [
#1####”,
“0###20”,
“###1##”,
#20###”,
“######”,
“1##2#1”
]
},
{
“rootNote”: “G”,
“scale”: [
“G”,
“A”,
“B”,
“C”,
“D”,
“E”,
“F#”
],
“triad”: [
“G”,
“B”,
“D”
],
“targetChord”: “320003”,
“fretStrings”: [
“##201#”,
“######”,
#1####”,
“0###20”,
“###1##”,
#20###”
]
},
{
“rootNote”: “A”,
“scale”: [
“A”,
“B”,
“C#”,
“D”,
“E”,
“F#”,
“G#”
],
“triad”: [
“A”,
“C#”,
“E”
],
“targetChord”: “x02220”,
“fretStrings”: [
“20###2”,
“######”,
“##201#”,
“######”,
#1####”,
“0###20
]
},
{
“rootNote”: “B”,
“scale”: [
“B”,
“C#”,
“D#”,
“E”,
“F#”,
“G#”,
“A#”
],
“triad”: [
“B”,
“D#”,
“F#”
],
“targetChord”: “x24442”,
“fretStrings”: [
“####0#”,
“##1###”,
“20###2”,
“######”,
“##201#”,
“######”
]
}
]
}

Try this

1 Like

@stitch Thanks - but the goal of the whole exercise is to understand HOW the playable chords are constructed (and selected from all chord possibilities), not just having them shown!

I want to go the hard way, just to understand stuff better…

1 Like

Then do yourself a favor and sign up for Justin’s Practical Music Theory. The first two grades are free and cover Chord construction.

1 Like

I don’t think these rules are quite correct.

It appears you are looking at open chords. I guess that fits the “try to choose lower frets where possible” rule. But it’s not going to match other chords which come along later in the course.

But the “try to choose as many notes on one fret as possible” isn’t right at all.

Really, if you are going to do this and match the standard open chord shapes (that Justin and everyone else teaches) then you are going to need some far more advanced rules which take into account the shape of the hand and the fingering.

There are times when having notes on the same fret works well, and times when it makes it very difficult to fret the chords.

The answer to this has almost nothing to do with music and almost everything to do with the physical layout of the fretboard and the mechanics of the human hand.

The whole reason that the standard open chords are so standard is that they fit under the fingers easily. That’s it!

There’s umpteen combinations of the notes in a triad that you can discover on the guitar fretboard but most of them (including many of the ones you have discovered) will not be usable, even though they are all perfectly valid chords.

IMO, if you want to continue on this journey, you need to come up with a useful model of the human hand and it’s capabilities and limitations and then match that to the available notes on the fretboard.

As I said before, this may be an interesting exercise and you have certainly encountered some very basic music theory on the way (mostly by being informed by others, rather than by discovering it algorithmically) in the form of notes in keys and triad chord construction.

But your investigations into chord fingerings are not based on music theory, beyond the basics of chord construction required as a baseline data set to drive the selection of notes.

You seem to be trying to work out what algorithm drives the selection of common, standard chord shapes, but these were never derived algorithmically in the first place: they were derived by people putting their hands onto the fretboard and working out where their fingers could go.

I’m pretty sure that’s not reliably replicable with simple algorithms.

Could it be replicated? Of course (I believe almost anything in this physical world can be modelled with mathematics and computers) but I think it would need a far more advanced model/simulation than where you are now.

And, as I said, that modelling isn’t anything to do with music theory.

Cheers,

Keith

3 Likes

@Majik - 100% agreed!

Again, the discussion in this thread proves to be the most interesting aspect of my endeavour!

Yesterday I thought about this very aspect: " if you want to continue on this journey, you need to come up with a useful model of the human hand and it’s capabilities and limitations and then match that to the available notes on the fretboard."

But I decided not to get into the very complicated stuff, but try some basic “rules of thumb”, ie "shapes with finger positioins adjectent to each other are easier to play " (horizontals). Same seems to be true for adjectent diagonals.

Maybe in the end I’ll find out that “modelling isn’t anything to do with music theory” - but than I know for sure. And had a lot of interesting discussions on the way :slight_smile:

1 Like

OK, I reworked the algorithm. Interesting results. All chords - except B and F - are as expected.

The algorithmically generated B and F are also correct, but harder to play - this is in keeping with @Majik s remark about natural fingerpositions.

I will implement a change that finds horizontal consecutive fingerpositions and override the originally constructed chord. That should be it!?

{
“results”: [
{
“rootNote”: “C”,
“targetChord”: “x32010”,
“constructedChord”: “X32010”,
“fretStrings”: [
“1##2#1”,
“####0#”,
“##1###”,
“20###2”,
“######”
]
},
{
“rootNote”: “D”,
“targetChord”: “xx0232”,
“constructedChord”: “XX0232”,
“fretStrings”: [
#20###”,
“######”,
“1##2#1”,
“####0#”,
“##1###”
]
},
{
“rootNote”: “E”,
“targetChord”: “022100”,
“constructedChord”: “022100”,
“fretStrings”: [
“0###20”,
“###1##”,
#20###”,
“######”,
“1##2#1”
]
},
{
“rootNote”: “F”,
“targetChord”: “133211”,
“constructedChord”: “103211”,
“fretStrings”: [
#1####”,
“0###20”,
“###1##”,
#20###”,
“######”
]
},
{
“rootNote”: “G”,
“targetChord”: “320003”,
“constructedChord”: “320003”,
“fretStrings”: [
“##201#”,
“######”,
#1####”,
“0###20”,
“###1##”
]
},
{
“rootNote”: “A”,
“targetChord”: “x02220”,
“constructedChord”: “X02220”,
“fretStrings”: [
“20###2”,
“######”,
“##201#”,
“######”,
#1####”
]
},
{
“rootNote”: “B”,
“targetChord”: “x24442”,
“constructedChord”: “X21402”,
“fretStrings”: [
“####0#”,
“##1###”,
“20###2”,
“######”,
“##201#”
]
}
]
}

Interesting approach to the practicalities of guitar paying. I wonder what Django Reinhardt’s answer would be to OP’s question.

2 Likes

OK, solved it!

Funny enough, my algorithm does not agree with Justin’s G Chord (320003, as in https://www.justinguitar.com/chords/g).

It prefers 320033, which is incidentally also the way the G-Chord is defined in the “Guitarist’s Cookbook”.

I guess it’s a matter of taste. I can see that Justin’s G-Chord might be a little easier to play though, but not much.

So, I will focuss on playing again … maybe improve the algorithm in a next round for barre chords and other Scales.

Here’s the end result. Of course I’m always happy to continue discussions ^^

{
“results”: [
{
“rootNote”: “C”,
“targetChord”: “x32010”,
“constructedChordInitial”: “X32010”,
“constructedChordOptimized”: “X32010”,
“fretStrings”: [
“1##2#1”,
“####0#”,
“##1###”,
“20###2”,
“######”
]
},
{
“rootNote”: “D”,
“targetChord”: “xx0232”,
“constructedChordInitial”: “XX0232”,
“constructedChordOptimized”: “XX0232”,
“fretStrings”: [
#20###”,
“######”,
“1##2#1”,
“####0#”,
“##1###”
]
},
{
“rootNote”: “E”,
“targetChord”: “022100”,
“constructedChordInitial”: “022100”,
“constructedChordOptimized”: “022100”,
“fretStrings”: [
“0###20”,
“###1##”,
#20###”,
“######”,
“1##2#1”
]
},
{
“rootNote”: “F”,
“targetChord”: “133211”,
“constructedChordInitial”: “103211”,
“constructedChordOptimized”: “133211”,
“fretStrings”: [
#1####”,
“0###20”,
“###1##”,
#20###”,
“######”
]
},
{
“rootNote”: “G”,
“targetChord”: “320003”,
“constructedChordInitial”: “320003”,
“constructedChordOptimized”: “320033”,
“fretStrings”: [
“##201#”,
“######”,
#1####”,
“0###20”,
“###1##”
]
},
{
“rootNote”: “A”,
“targetChord”: “x02220”,
“constructedChordInitial”: “X02220”,
“constructedChordOptimized”: “X02220”,
“fretStrings”: [
“20###2”,
“######”,
“##201#”,
“######”,
#1####”
]
},
{
“rootNote”: “B”,
“targetChord”: “x24442”,
“constructedChordInitial”: “X21402”,
“constructedChordOptimized”: “X24442”,
“fretStrings”: [
“####0#”,
“##1###”,
“20###2”,
“######”,
“##201#”
]
}
]
}

This is an important thing to realize. It is timbre that sounds good for the application and a little of what the musician likes - for whatever reason (could be playability, could be familiarity…)

A good example might be A5. I can play it on strings 6 and 5 and have a different timbre than strings 5, 4. If I add the harmonic of the root, then it changes timbre again.

It sounds like you are trying to learn guitar by creating an algorithm. This is not a good idea. Creating an algorithm to list all the options sounds like a problem that doesn’t need to be solved once you understand where notes are on the fretboard and the rule set for creating a chord is memorized. If you didn’t follow what I wrote above, then this demonstrates my point a bit. :slight_smile:

Pick up that guitar and LISTEN to the notes. I had to come to terms with this and am happy I did so.

2 Likes

I’m waiting to see how this algorithm handles minor chords, 7 chords (Dominant and Major), 9 and add9, sus2 and sus4, augmented, diminished, all the extended chords and inversions. Could probably master the guitar faster than writing all that code.
Hope you don’t make any mistakes in your coding.

1 Like