Music composition in Elm

Hi,

I’ve been interested in Euterpea for quite a while.

I recently ported a lot from it to Elm and stayed as close to the source as possible. I think it can be made more Elm idiomatic but the lib is so well designed that I didn’t want to mess around with it.

So the sequencing is solved already in the Haskell code. There is a function line that does the trick, Here is the Elm version:

line : List (Music a) -> Music a
line =
    List.foldr Seq empty

Here is the repository of the Elm version: https://github.com/battermann/Mousikea

I just recently started this so this is still much WIP and I don’t know yet where this should go. But maybe it would be nice to create a library out of this at some point and maybe an accompanying npm package?

My first attempt was to do playback with webaudiofonts, you can see a live demo here: https://elm-euterpea.surge.sh/

I’d love to collaborate on this if someone is interested?

Thanks!
Leif

2 Likes