Signal-Level API

Last modified: Aug 29, 2018 @ 10:02 am

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/TypeDescription
InstrumentNameType synonym for String
Instr aPolymorphic instrument definition.
InstrMap aTable to link an InstrumentName with an Instr
renderSFConvert a Music value using custom instruments to a signal function.
outFileWrite a finite amount of a signal function to a WAV file.
writeWavConvert a Music value using custom instruments to a WAV file (combines renderSF and outFile).

Signal Functions

TableFor representing a series of audio samples with/without normalization.
tableExponN / tableExponCreate a Table from coordinates using expontential interpolation with/without normalization.
tableLinearN / tableLinearCreate a Table from coordinates using linear interpolation with/without normalization.
tableBesselN / tableBesselGenerates the log of a modified Bessel function. For use with AM/FM modulation with/without normalization.
tableSinesN / tableSinesCreate a Table from sinewaves with the specified partial strengths with/without normalization.
tableSines3N / tableSines3Create a Table from sinewave partials given their partial number, strength, and phase offset with/without normalization.
filterLowPassLow-pass filter.
filterHighPassHigh-pass filter.
filterBandPassBand-pass filter.
filterBandStopBand-stop filter.
filterLowPassBWButterworth low-pass filter.
filterHighPassBWButterworth high-pass filter.
filterBandPassBWButterwoth band-pass filter.
filterBandStopBWButterworth band-stop filter.
filterCombComb filter.
oscOscillator for a Table
oscILike osc but uses linear interpolation.
oscFixedA simple, fast sine oscillator.
oscDurDelated oscillator that stays at the first sample for a set amount of time.
oscDurILike oscDur, but with linear interpolation
oscPartialsOscillator for harmonically-related sinewave partials.
pluckPluck filter for a Table of samples.
envLineLinear envelope
envExponExponential envelope
envLineSegEnvelope of linear segments.
envExponSegEnvelope of exponential segments.
envASRAttack-sustain-release envelope.
envCSEnvlpxSlightly different ASR envelope interface.
noiseWhiteWhite noise generator.
nosieBLIBand-limited noise generator with interpolation.
noiseBLHBand-limited noise generator without interpolation.
balanceAdjusts RMS amplitude to match a reference amplitude.
delayLineDelay a signal by a fixed amount of time.
delayLine1Delay line with 1 tap.
delayLineTDelay line for a Table.

Miscellaneous Functions

FunctionDescription
apToHzConvert an AbsPitch (or pitch number) to Hertz.
pchToHzConvert a Pitch value to Hertz.