![]() Var result // expected result = 'Asus7/E' Var transpose = 3 // remember this value also may be negative, like "-4" So basically, imagine you have a javascript variable called chord and the transpose value transpose. I think this should be all, unless I forgot something. Examples:Īs with examples 1 and 2, everything is the same, but the part after the slash needs transpose too, therefore: This is marked by a slash after the chord and also needs to be transposed. So again, as with the simple chords, if we transpose Dsus7 + 3 = Fsus7Ī problem arises when the bass plays a different tone than the chord root tone. They work almost like the simple chords, but contain a few more characters, which can safely be ignored when transposing. If we transpose +4, the resulting chord is G#. Therefore, If the original chord is E and we want to transpose +1, the resulting chord is F. The simple chords are almost as simple as an alphabet and it goes like this:įrom B it loops all over again to C. Since I don't expect everyone to be a musician here, I'll try to explain how it works in music theory. Your mission is to create a function for transposing music chords.Ĭopied from SO with permission of the original asker, I just really wanted to see what you guys could do with this one:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |