Set up Euterpea on OS X Mavericks (64bit)

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:

  1. Install Haskell platform (64bit) for Mac OSX.
  2. 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)
  3. Turn on the IAC Driver support in Audio MIDI Setup, Steps here: https://support.apple.com/kb/PH5172?locale=en_US
  4. 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.

Screen Shot 2015-05-16 at 6.59.45 pm Screen Shot 2015-05-16 at 7.22.49 pm