go-music-theory / music-theory

Go models of Note, Scale, Chord and Key
https://gopkg.in/music-theory.v0
GNU General Public License v3.0
432 stars 44 forks source link

Note expression as sharp/flat is switched based on input #12

Closed raff closed 8 years ago

raff commented 8 years ago

The option to return flats is switched based on the input request. E.g. if the requested chord contains "flats" the output notes should all be expressed with flats.

For example:

$ go run music.go -c "CMb5b7"

returns:

root: C
tones:
1: C
3: E
 5: F#
 7: A#

should return:

root: C
tones:
1: C
3: E
 5: Gb
 7: Bb
charneykaye commented 8 years ago

Thanks @raff !

charneykaye commented 8 years ago

I've edited this issue to reflect that it has an underlying refactoring (which I like very much) wherein note expression is switched to be either "sharps" or "flats".

charneykaye commented 8 years ago

@raff here is my implementation of your request. Great idea! https://github.com/go-music-theory/music-theory/pull/15/files

charneykaye commented 8 years ago

Now included in master. The change will make it into release 0.0.3. Example:

$ music-theory chord Bb7
root: Bb
tones:
  1: Bb
  3: D
  5: F
  7: Ab

$ music-theory chord A#7
root: A#
tones:
  1: A#
  3: D
  5: F
  7: G#
raff commented 8 years ago

Great! Thanks!!!!