alda-lang / alda-core

The core machinery of Alda
80 stars 26 forks source link

Add more modes. Resolves #36 #51

Closed iggar closed 7 years ago

iggar commented 7 years ago

Add more modes: ionian, aeolian, lydian, mixolydian, dorian, phrygian, locrian. Resolves #36

iggar commented 7 years ago

I've added some more tests but because of my poor music theory knowledge I'm still not 100% sure if this solves the issue. @daveyarwood please feel free to comment / edit before merging it. I can come back to this if more work is needed.

iggar commented 7 years ago

@daveyarwood in that case it works as a list for the case function, not as a function. See:

user=> (defn mycase [x] 
  #_=>   (case x
  #_=>   (:major :ionian) "hey!"
  #_=>   (:minor :aeolian) "ho!"
  #_=>    "let's go!"))
#'user/mycase
user=> (mycase :major)
"hey!"
user=> (mycase :minor)
"ho!"
user=> (mycase :ionian)
"hey!"
user=> (mycase :aeolian)
"ho!"
user=> (mycase :dorian)
"let's go!"
daveyarwood commented 7 years ago

My mistake -- you're totally right. I didn't know that about case!

On Sep 29, 2017 9:43 AM, "Igor Garcia" notifications@github.com wrote:

@daveyarwood https://github.com/daveyarwood in that case it works as a list for the case function, not as a function. See:

user=> (defn mycase [x]

_=> (case x

_=> (:major :ionian) "hey!"

_=> (:minor :aeolian) "ho!"

_=> "let's go!"))

'user/mycase

user=> (mycase :major) "hey!" user=> (mycase :minor) "ho!" user=> (mycase :ionian) "hey!" user=> (mycase :aeolian) "ho!" user=> (mycase :dorian) "let's go!"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alda-lang/alda-core/pull/51#issuecomment-333145785, or mute the thread https://github.com/notifications/unsubscribe-auth/AEroFxBizGh6sZVd4r08hiPwafVZ9Vd9ks5snQH3gaJpZM4Pog_0 .

iggar commented 7 years ago

What we could do is build core off this branch and test playing a tune using one of the new modes.

daveyarwood commented 7 years ago

I have a couple things in mind for example scores I can add to the repo -- I can take care of that part, and will test the scores before I merge this PR.

daveyarwood commented 7 years ago

I built a version of the alda executable that includes this change and it works great!

I wrote a couple of simple example scores here: https://github.com/alda-lang/alda-core/pull/53/commits/a5ca0f6d2127687e4a37c0c61572b0ff85426b1b

With this change, the modes all sound correct to my classically-trained ears.

Thanks again for the PR! I've incorporated it into #53, which I will merge shortly.