What would be the most appropriate (naturally appropriate) way to represent different sequences of chord (musical) rules in the data structure so that each chord has a weighted set of options that it could advance to?
This data structure will be implemented in the procedural program for generating music in such a way that you could encode: (language-agnostic pseudocode)
Chord[7] songArray; Chord first = new Chord(I);
Note. In classical type music, each chord in a given key can naturally move to another chord, following these rules:
---------------------- | Chord | Leads to | |======================= | I | any | | ii | V, vii | | iii | IV, vi | | IV | ii, V, vii | | V | vi | | vi | ii, ii, IV, V| | vii | I | ----------------------
The data structure will store various progressions as weighted parameters. As an example, consider the IV chord in any key way: IV can naturally go to ii, V or vii, but it can also violate the rules that apply to any other chord. Violation of the rules will occur infrequently.

I looked at some structure of linked lists / tree data, but it is unlikely to be like any type of tree or list I have ever used - in addition, I cannot figure out how to implement weighting:

Another thought was to use JSON or something similar, but it seems to reboot too quickly:
{ "I":{ "100%":{ "I", "ii", "iii", "IV", "V", "vi", "vii" } }, "ii":{ "80%":{ "V", "vii" }, "20%":{ "i", "ii", "iii", "IV", "vi" } },
Note. I am sure that this is implemented in several languages, and at the moment I am not interested in a specific language implementation, but in the language-agnostic architecture of the data structure.