The well-tempered ergodox
This week, we're going to learn some guitar. Write a function that takes the string number and fret number and returns the note you get when plucking it. You can use the chart linked to at the bottom of this page as a guide.
;; third string, second fret
(note 3 2) => :A
;; first string, sixth fret
(note 1 6) => :A#
Open strings (no fret) are represented by 0
.
You can represent sharps with a #
and flats with a lowercase b
.
There are obviously different ways to represent it. Try to find one that captures the underlying model of frets and intervals.
Thanks to this site for the challenge idea where it is considered Very Hard level in JavaScript.