@tgc: thanks, will check it out
<font face="Arial, Verdana" style="line-height: 20.4px;"><div><font face="Arial, Verdana" style="line-height: 20.4px;"><br></font></div>I promise this will be my last contribution here, will catch up with the official contribution channels :D</font>
<br>
So, in one of my earlier posts I stated, that chord preference cannot be determined by algorithm, and songs have to have a chord property... I might have to contradict myself, as I did manage to work out a pretty close code for it in chords.js:
<br>
var lastChord;<br>
var lastChordPreference;<br>
<br>
var chordSplit = chord.replace('♭', 'b').split('/'), transposedChord = '', note, notenumber, rest, currentChord, lastBass,<br>
var chordSplit = chord.replace('♭', 'b').split('/'), transposedChord = '', note, notenumber, rest, currentChord, lastChord, lastBass,<br>
<br>
notesPreferred = ['b', '#', '#', 'b', '#', 'b', '#', '#', 'b', '#', 'b', '#'];<br>
notesPreferred = ['-', '#', '#', 'b', '#', 'b', '#', '#', 'b', '#', 'b', '#'];<br>
<br>
lastChord = notesPreferred[notenumber] === '#' ? notesSharp[notenumber] : notesFlat[notenumber];<br>
lastChordPreference = notesPreferred[notenumber];
if (notesPreferred[notenumber] === '#') {
lastChord = notesSharp[notenumber];
} else if (notesPreferred[notenumber] === 'b') {
lastChord = notesFlat[notenumber];
} else {
lastChord = notesSharp[notenumber];
}
<br>
lastBass = notesSharp.indexOf(lastChord) === -1 ? notesFlat[notenumber] : notesSharp[notenumber];<br>
if (lastChordPreference === "#") {
lastBass = notesSharp[notenumber];
} else if (lastChordPreference === "b") {
lastBass = notesFlat[notenumber];
} else {
if (notesPreferred[notenumber] === '#') {
lastBass = notesSharp[notenumber];
} else if (notesPreferred[notenumber] === 'b') {
lastBass = notesFlat[notenumber];
} else {
lastBass = notesSharp[notenumber];
}
}
<br>
Now transposing is reflecting my personal taste (hopefully correct one) of sharp/flat representation of chords.