Closed dpsanders closed 5 months ago
(Arguably it should take any integer, positive or negative, i.e. it should act like a doubly infinite array.)
Changed to be 1-based in latest main
.
scale[2]
gives the 2nd scale tone, i.e. moves up by a 2nd from the tonic.
scale[-2]
moves down a second from the tonic.
Does that seem reasonable to you @stevengj ?
I'm confused, what are scale[0]
and scale[-1]
?
You surely want to preserve the property that scale[i - n]
is n
tones below i
.
scale[-1]
is the same as scale[1]
since it's "go down by a unison".
scale[0]
is an error.
You surely want to preserve the property that scale[i - n] is n tones below i.
Right, that's why I previously was using scale[0]
to be the tonic instead of scale[1]
.
I don't think having scale[0]
to be "the note before the tonic" makes much sense.
OK I think you're right, that would be better even if it doesn't preserve the symmetry.
Scales should support
getindex
in addition to iteration.Proposed in https://github.com/dpsanders/MusicTheory.jl/issues/17