This page gives a list of important datatypes and functions in Euterpea for working with music at the “note level,” or roughly at the level of a paper score. For more information on the functions, types, and type classes listed here, please see the Haskell School of Music textbook or, from GHCi with Euterpea imported, type the following:
Music Types and Type Classes
|A Note or a Rest.
|Polymorphic structure for representing music.
|Type Synonym for (Pitch, [NoteAttribute]).
|Type synonym for Music1 or Music (Pitch, [NoteAttribute]).
|Type class with one function, toMusic1, for converting to Music1. Instances are included for Pitch, (Pitch, Volume), AbsPitch, (AbsPitch, Volume), and Note1. The ToMusic1 type class is required for the play function.
|Representation of pitch classes.
|Type synonym for Int.
|Type synonym for (PitchClass, Octave)
|Type synonym for Int.
|For use with Music's Modify constructor.
|Tonality. Currently only Major and Minor are supported.
|For GM instruments.
|For use with Control.
|For use with Music1.
|Event representation for notes. Used in conversion from Music to MIDI.
|Type synonym for [MEvent]
Playback Functions and Types
|Play a Music value to the default MIDI output device. Supports infinitely long Music values.
|Play a Music value to a custom MIDI output device. Supports infinitely long Music values.
|Play a finite Music value to the default MIDI output device with strict timing.
|Play a finite Music value to a custom MIDI output device with strict timing.
|Custom playback using the PlayParams data structure.
|Print a list of available MIDI devices and their corresponding device numbers.
|Record type to control playback behavior with playC.
Note: the play function is lazy and does not guarantee correct timing. For more information on the implementation of play and playS, please see this post on the subject.
|Creates a single Note.
|Creates a single Rest.
|Put a list of music values together sequentially.
|Like line but requires a non-empty list and does not add any zero-length rests.
|Put a list of music values together in parallel.
|Like chord but requires a non-empty list and does not add any zero-length rests.
|Opposite of line.
|Inverts (flips upside down) a Music Pitch value around its first pitch.
|Like invert but for Music (Pitch, a).
|Inverts a Music Pitch value around a specified Pitch.
|Like invertAt but for Music (Pitch, a).
|Reverses a Music value.
|Performs retrograde then inversion.
|Performs inversion then retrograde.
|Delay a the onset of a Music value.
|Repeat a Music value sequentially for a fixed number of times.
|Repeat a Music value infinitely.
|Take a finite portion of Music from the front of the value.
|Remove a finite portion from the front of a Music value.
|Strip zero-duration constructs from a Music value.
|Like map but over Music values. Operates over all "a" portions of a "Music a"
|Like fold but over Music values.
|Adds a Transpose modifier.
|Adds a Tempo modifier.
|Adds an Instrument modifier.
|Adds a Phrase modifier.
|Adds a KeySig modifier.
|Shifts all pitches in a Music Pitch value by the specified amount.
|Shifts all pitches in a Music(Pitch,x) value by the specified amount.
|Alters the durations of a Music value.
|Changes the instrument of a Music value and Removes any nested Instrument modifiers.
|Strips all Instrument modifiers from a Music value.
|Creates a note wrapped with the Percussion instrument.
MIDI Conversion Functions
|Converts a Music value to a Performance. Requires an instance of ToMusic1.
|Converts a Performance to a Midi value.
|Writes a Midi value to a file.
|Writes a Music value to a MIDI file. Requites a ToMusic1 instance.
|Reads a MIDI file to a Midi value.
|Converts a Midi value to a Music1 value.
Extra MIDI-Related Functions
|Attempts to group musical features by obvious chords, melodies, and so on. The restructure function can be used on Music values that have been read in from MIDI files (the default representation for which is all notes combined in parallel with rests).
|Allows exporting of MIDI files where more than one track can have the same instrument. To use this, all Instrument assignments must be done using CustomInstrument with a String of the format "GMName UniqueID" (for example: "Flute A")