Last modified:
Please note: all of the functions described here are for offline sound synthesis only! If you want to define virtual instruments that interact with Euterpea in real time, take a look at VividEuterpea, which provides a bridge between Euterpea’s music structures and constructing instruments using the Vivid library for real time audio in Haskell.
This page gives a list of important datatypes and functions in Euterpea for working with music at the signal level. 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:
:i nameYouWantToKnowAbout
Instrument Creation and Usage
Function/Type | Description |
---|---|
InstrumentName | Type synonym for String |
Instr a | Polymorphic instrument definition. |
InstrMap a | Table to link an InstrumentName with an Instr |
renderSF | Convert a Music value using custom instruments to a signal function. |
outFile | Write a finite amount of a signal function to a WAV file. |
writeWav | Convert a Music value using custom instruments to a WAV file (combines renderSF and outFile). |
Signal Functions
Table | For representing a series of audio samples with/without normalization. |
---|---|
tableExponN / tableExpon | Create a Table from coordinates using expontential interpolation with/without normalization. |
tableLinearN / tableLinear | Create a Table from coordinates using linear interpolation with/without normalization. |
tableBesselN / tableBessel | Generates the log of a modified Bessel function. For use with AM/FM modulation with/without normalization. |
tableSinesN / tableSines | Create a Table from sinewaves with the specified partial strengths with/without normalization. |
tableSines3N / tableSines3 | Create a Table from sinewave partials given their partial number, strength, and phase offset with/without normalization. |
filterLowPass | Low-pass filter. |
filterHighPass | High-pass filter. |
filterBandPass | Band-pass filter. |
filterBandStop | Band-stop filter. |
filterLowPassBW | Butterworth low-pass filter. |
filterHighPassBW | Butterworth high-pass filter. |
filterBandPassBW | Butterwoth band-pass filter. |
filterBandStopBW | Butterworth band-stop filter. |
filterComb | Comb filter. |
osc | Oscillator for a Table |
oscI | Like osc but uses linear interpolation. |
oscFixed | A simple, fast sine oscillator. |
oscDur | Delated oscillator that stays at the first sample for a set amount of time. |
oscDurI | Like oscDur, but with linear interpolation |
oscPartials | Oscillator for harmonically-related sinewave partials. |
pluck | Pluck filter for a Table of samples. |
envLine | Linear envelope |
envExpon | Exponential envelope |
envLineSeg | Envelope of linear segments. |
envExponSeg | Envelope of exponential segments. |
envASR | Attack-sustain-release envelope. |
envCSEnvlpx | Slightly different ASR envelope interface. |
noiseWhite | White noise generator. |
nosieBLI | Band-limited noise generator with interpolation. |
noiseBLH | Band-limited noise generator without interpolation. |
balance | Adjusts RMS amplitude to match a reference amplitude. |
delayLine | Delay a signal by a fixed amount of time. |
delayLine1 | Delay line with 1 tap. |
delayLineT | Delay line for a Table. |
Miscellaneous Functions
Function | Description |
---|---|
apToHz | Convert an AbsPitch (or pitch number) to Hertz. |
pchToHz | Convert a Pitch value to Hertz. |