Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scales/modes? #50

Open
jwaldmann opened this issue Dec 9, 2021 · 3 comments
Open

scales/modes? #50

jwaldmann opened this issue Dec 9, 2021 · 3 comments

Comments

@jwaldmann
Copy link

I wanted to use the diatonic scale, and transpose inside the scale. E.g.,
transpose 1 c should give d (whole note up), but transpose 1 e should give f (semi note up),
and a chord is [x, x+2, x+4], giving major, minor, or dim, depending on x.
Electribe2 does have such a chord mode.

Euterpea has chromatic scale everywhere, because MIDI does.

Still the source code (and API docs) mention Mode. But it's never used?

rg Major Euterpea2/
Euterpea2/Euterpea/Music.lhs
38:> data Mode = Major | Minor |

Euterpea's class ToMusic is already designed (I guess) to handle this:

One can make a newtype

data Diatonic = Diatonic Int

and define conversion to chromatic (via some table lookup)

instance ToMusic1 Diatonic where 
  toMusic1 = mMap ( \ (Diatonic i) -> (pitch _,  _) ) 

Then, transposition in the scale works

tr_dia d = mMap (\ (Diatonic i) -> Diatonic (i+d))

play $ tr_dia 2 $ note 1 $ Diatonic 0

The nice thing is that the type system will prohibit a confusion of scales (using a diatonic number as it were chromatic).

@jimstutt
Copy link

jimstutt commented Dec 11, 2021 via email

@jwaldmann
Copy link
Author

Yes, it'd be limited to notes in the scale. For diatonic, you'd get the things you can play "on the white keys", etc. I was thinking mainly for teaching. For making actual music, it's quite a restriction. But that's not necessarily bad? - Related:

@jimstutt
Copy link

jimstutt commented Dec 13, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants