Euterpea is a cross-platform, domain-specific language for computer music applications embedded in the Haskell programming language. Euterpea is a wide-spectrum language, suitable for high-level music representation, algorithmic composition, music analysis, working with MIDI, low-level audio processing, sound synthesis, and virtual instrument design.

Getting Started with Euterpea

Here’s what you need to do to install Euterpea for the first time and play your first note (there is also a video tutorial):

  1. Install Haskell Platform for your operating system (recommended: 8.6.x). You can use either the Full or Core version.
    • Windows users: Haskell Platform 8.6.5 is best.
    • Mac users: Haskell Platform 8.6.3 provides the simplest setup.
      Warning to BigSur users (18-Mar-2021): there may be some unresolved compatibility issues with Euterpea’s real-time MIDI support and this version of Mac OS. 
    • Linux users: you must install ALSA (ex: sudo apt-get install libasound2-dev)
  2. Install Euterpea. Open a command prompt (Windows) or terminal (Mac/Linux) and run:
    cabal v1-update
    cabal v1-install Euterpea

    • If using a version of GHC newer than 8.6.x, you can try using the –allow-newer flag as follows, although success is not guaranteed.
      cabal v1-install --allow-newer Euterpea
  3. Install a synthesizer (Mac/Linux only): install a MIDI software synthesizer, such as SimpleSynth or Fluidsynth. Make sure it’s running before you start Euterpea in GHCi.
  4. Test Euterpea. Now, open a command prompt or terminal and run the following:
    import Euterpea
    play $ c 4 qn
  5. Get HSoM (Optional). If you also want HSoM, which is the companion library for the Haskell School of Music textbook, you can install it with cabal install HSoM and import the library in GHCi with import HSoM.
    • Mac users: to use HSoM’s musical user interfaces (MUIs), you must compile to executable rather than using the interpreter. Go to the download and installation page‘s section on “Testing HSoM’s MUIs” for information on how to do this.

Now you’re ready to head to theTutorials and Examples pages to learn about how to use Euterpea and try out some existing code. Once you’re ready to start building your own programs with Euterpea, head to the API Documentation for more information on Euterpea’s features.

Having installation trouble or don’t hear any sound? The Download and Installation page has more detailed installation walkthroughs and announcements about recent issues, and the Troubleshooting page has a list of solutions for common problems organized by category. For sound problems, you can also check out the Setting up MIDI page.

Looking for a text editor to use with Haskell & Euterpea? Here are some suggestions:

Questions & Contact Info
If you are having trouble with either Euterpea or HSoM, first check that you are using a supported GHC/cabal version and then check the Troubleshooting page. Use the Euterpea GitHub issues page (or the one for HSoM if appropriate) to report any new problems. Please send all other questions and comments to Donya Quick.

Recent News

  • (16-June-2019) Euterpea 2.0.8 on GitHub (development version) features a bug fix for some playback situations that result in dropped notes due to MIDI message ordering issues. If you are experiencing dropped notes with play or playDev, try installing 2.0.8 from GitHub.
  • (13-June-2019) Euterpea 2.0.7 is on Hackage. It bumps the version of PortMidi and features some bug fixes for the cut/remove functions.
  • (03-Nov-2018) Two new PDF slideshow-style tutorials are available on the Tutorials page.
  • (05-Oct-2018) The Haskell School of Music textbook is now shipping on Amazon and Cambridge.
  • (26-Sept-2018) Euterpea 2.0.6 is on Hackage. The only change in this version over 2.0.5 is a bug fix for infinite playback on Mac systems with multiple MIDI input/output devices.
  • (03-July-2018) Euterpea 2.0.5 is on Hackage. Notable changes include dependency version bumps and a new module, Euterpea.IO.MIDI.ToMidi2, that provides a means to export more than one MIDI track with the same instrument assignment.
  • (27-May-2018) Euterpea 2.0.4 is on Hackage is now compatible with Haskell Platform 8.4.2. If you had a failed installation with that version of the platform, please do a “cabal update” before trying the installation again.
  • (17-Sept-2017) VividEuterpea lets you play Euterpea Music values with real-time audio processing using the Vivid library. It’s a one-file utility set that you can drop into your project folder. Vivid must be installed (easy to do with “cabal install vivid”) and SuperCollider must also be installed. SuperCollider must be running and have its server booted up before you try to play music with VividEuterpea.