Euterpea Change Log

Last modified: Oct 10, 2022 @ 11:43 am

This page highlights changes between Euterpea versions. Not all changes are included, as many have simply been compatibility updates for new versions of Haskell Platform.

Euterpea 2.0.8

  • Bug fix for payback MIDI event ordering.

Euterpea 2.0.6

  • Bug fix for infinite playback on Mac where more than one MIDI input/output device is present.

Euterpea 2.0.5

  • ToMusic1 instance for (AbsPitch, Volume).
    • Note: there is currently no equivalent for addVolume for this instance. To go from Music AbsPitch to Music (AbsPitch,Volume), you can do this for v in 0-127:
      absVolMusic = mMap (\a -> (a,v)) absMusic
  • New optional import: Euterpea.IO.MIDI.ToMidi2 – allows writing MIDI files with writeMidi2 where multiple separate tracks have the same instrument assigned. View the source for instructions on usage.
  • Bumped PortMidi version. May break old code if it requires PortMidi’s earlier method of encoding/decoding messages.
  • Bug fix: Ctrl+C now correctly turns off all notes when terminating the play function on infinitely long Music values.

From Euterpea 2.0.0 to 2.0.4:

  • ToMusic1 instance for AbsPitch. This allows creating Music values with pitch numbers directly instead of requiring use of the Pitch datatype.
  • Optional import: Euterpea.IO.MIDI.FromMidi2 – the function fromMidi2 in this module allows reading in MIDI files with more intelligent usage of the (:+:) and (:=:) to identify chords, melodies, etc.

From Euterpea 1.x to Euterpea 2.0.0

Euterpea 2 underwent massive restructuring, so many modules have been merged, split differently, etc. Code that relies on Euterpea 1.x will likely break using Euterpea 2.x. Also note that some portions of Euterpea 1.x that were specific to the Haskell School of Music textbook were removed and placed into a separate library called HSoM (such cases are specifically noted in the list below).

New functions and data types:

  • playS
  • playDev
  • playDevS
  • shiftPitches
  • scaleDurations
  • changeInstrument
  • removeInstruments
  • ToMusic1 (type class)
  • musicToMEvents
  • perform (significantly altered from previous definition)
  • writeWav and writeWavNorm

Data type changes/extensions:

  • More constructors for Mode, including a custom option. (Added in version 2.0.4)

Renamed functions and datatypes:

  • timesM → times
  • repeatM → forever
  • takeM → cut
  • delayM → offset
  • revM → retro
  • Event → MEvent

Removed functions:

  • test
  • (=:=)
  • graceNote, trill, prefixes, etc. from Interlude chapter in HSoM

Removed modules, the definitions of which have not been merged or otherwise preserved:

  • Experimental
  • All modules in Examples folder (moved to HSoM library)
  • Performance (moved to HSoM library)

Other removed files/folder:

  • HSoM folder
  • Tests folder

Significant behavior changes:

  • Rendering an audio stream with values that exceed +/-1.0 will now result in clipping rather than overflowing. In Euterpea 1.x, overflowing manifested as either a flat line at -1.0, zig-zags from -1.0 to +1.0, and other wrap-around-like behaviors. In these older versions, the exact problem observed depended on the particular case, GHC version, and operating system. The new clipping behavior caps signals at +/-1.0, which basically shaves off peaks outside the acceptable range. Clipping is a more standard behavior than overflowing or wrap-around in the audio domain and will also ensure more uniform generation across different systems.

Dependency changes:

  • Versions for all major dependencies are now strictly bounded, either being limited to a specific version or with specific upper/lower bounds. Upper bounds are set at the highest known versions that were working at the time of the particular release (whether Hackage or GitHub). These restrictions were put in place to avoid the need for urgent updates to Euterpea whenever a newer version of a dependency changes its API.