Refactor MusicalScale

Adds more flexibility (more scales could be added) and fixes a bug with
invalid frequency handling. Moves all octave and other calculations to
one place for cleaner code elsewhere. Avoids copypasta in MusicalScale
itself.