Just started to learn Haskell and Euterpea these days. Spent an afternoon and finally be able to play midi sound from haskell program. If I encounter any new problems in the future, I’ll update in this post.
The basic steps are the same as in the official guide:
- Install Haskell platform (64bit) for Mac OSX.
- Then use cabal update and cabal install Euterpea to get the library installed (In my region the connection is slow and takes quite a long time)
- Turn on the IAC Driver support in Audio MIDI Setup, Steps here: https://support.apple.com/kb/PH5172?locale=en_US
- Install a virutal midi synthesizer to generate sound. I use the virtual midi keyboard as recommended on yale’s website.
The step 3 and 4 are important. Before I turn on the IAC driver (which was gray in Audio Midi Step), I keep getting the error message: *** Exception: PortMidi: toEnum out of bound. At this point if we run devs <- getAllDevices, we would get an empty list.
Some other posts say it’s 64bit issue. But I finally figured out that this is because the IAC port is not successfully established. You can go to vmpk’s MIDI setup window, and check whether the input MIDI connection is IAC Bus 1. If the drop-down list is blank, then try to open IAC driver’s properties window and remove and add again the port (there might be some latency too). If the IAC Bus 1 shows up in the MIDI Setup, then the Euterpea should be able to generate midi sound now.