Chords form the basis of harmony in music. The most basic chords are triads, or groups of three notes. They are specified by three parameters: (1) the root note, (2) quality, which indicates the relationship between the notes, and (3) position, which indicates the order of the notes.
This problem involves four qualities: major, minor, diminished, and augmented. Here are the ways to denote the quality and the spacings between notes in root position (i.e., with the root note on the bottom):
Triads can be in root position or first or second inversion. For example, a G major triad is ‘G B D’ in root position, ‘B D G’ in first inversion, and ‘D G B’ in second inversion.
Write a function to spell (or list the notes of) musical triads. If the position is specified as zero or omitted, then the root note is first.
Take care with enharmonic (or equivalent) notes and follow the conventions at the four links above. For example, Fmin could be spelled as ‘F Ab C’ or ‘F G# C’ because A flat and G sharp are equivalent, but the former is correct by convention. Please use the notes in parentheses in the Wikipedia pages. For example, spell Abdim as ‘Ab B D’ rather than ‘Ab Cb Ebb’ and C#aug as ‘C# F A’ rather than ‘C# E# Gx’ (where ‘bb’ and ‘x’ denote double flat and double sharp, respectively.)
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers2
Suggested Problems
-
2537 Solvers
-
Sum of diagonal of a square matrix
1631 Solvers
-
42 Solvers
-
689 Solvers
-
467 Solvers
More from this Author321
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Wow. I'm still confused about when to refer to Gb as F# !
I can empathize, and I won't claim to be qualified to explain. For major chords I think of "sharp keys" and "flat keys" as listed on this page:
https://musictheory.pugetsound.edu/mt21c/MajorKeySignatures.html
The circle of fifths shows the difference nicely. It also shows that the key of F# has six sharps and Gb has six flats. No wonder those are troublesome!
With such confusing notation, it's a wonder the music industry is as successful as it is.
I'm not an expert on popular music, but the current #1 song, As It Was by Harry Styles, has four chords: D Bm E A. See also David Bennett's video "26 Songs that Only Use Two Chords".
But the best is "How to Make an AC/DC Song in 30 Seconds": https://www.youtube.com/shorts/k3zCnTgdLG0
Gregg Moscovitch wrote, "When told that a critic had accused [AC/DC] of recording 10 albums that all sound the same, guitarist Angus Young quipped, 'He’s a liar. We’ve made *11* albums that all sound the same.'”