csound-expression-5.4.3.1: library to make electronic music
Safe HaskellSafe-Inferred
LanguageHaskell2010

Csound.Air.Wave

Description

Basic waveforms that are used most often. A waveform function takes in a time varied frequency (in Hz).

Synopsis

Documentation

type Wave = Sig -> SE Sig Source #

Bipolar

osc :: Sig -> Sig Source #

A pure tone (sine wave).

oscBy :: Tab -> Sig -> Sig Source #

An oscillator with user provided waveform.

saw :: Sig -> Sig #

A sawtooth.

isaw :: Sig -> Sig #

Integrated sawtooth: 4 * x * (1 - x).

pulse :: Sig -> Sig #

Pulse (not normalized).

sqr :: Sig -> Sig #

A square wave.

pw :: Sig -> Sig -> Sig Source #

Pulse width modulation (width range is 0 to 1)

pw dutyCycle cps

tri :: Sig -> Sig #

A triangle wave.

ramp :: Sig -> Sig -> Sig Source #

Triangle wave with ramp factor (factor's range is 0 to 1)

ramp factor cps

blosc :: Tab -> Sig -> Sig #

A band-limited oscillator with user defined waveform (it's stored in the table).

With phase control

osc' :: D -> Sig -> Sig Source #

A pure tone (sine wave) with initial phase (the first argiment).

oscBy' :: Tab -> D -> Sig -> Sig Source #

An oscillator with user provided waveform with initial phase (the second argiment).

saw' :: D -> Sig -> Sig #

A sawtooth.

isaw' :: D -> Sig -> Sig #

Integrated sawtooth: 4 * x * (1 - x).

pulse' :: D -> Sig -> Sig #

Pulse (not normalized).

sqr' :: D -> Sig -> Sig #

A square wave.

pw' :: Sig -> D -> Sig -> Sig Source #

Pulse width modulation (width range is 0 to 1)

pw' dutyCycle phase cps

tri' :: D -> Sig -> Sig #

A triangle wave.

ramp' :: Sig -> D -> Sig -> Sig Source #

Triangle wave with ramp factor (factor's range is 0 to 1)

ramp' factor phase cps

blosc' :: Tab -> D -> Sig -> Sig #

A band-limited oscillator with user defined waveform (it's stored in the table).

With random phase

rndPhs :: (D -> Sig -> Sig) -> Sig -> SE Sig Source #

Generic random smoothTypephase oscil

Raw analog waves (no band limiting)

Analogue-like waves with no band-limiting. Can be useful for LFOs.

rawTri' :: D -> Sig -> Sig Source #

rawSaw' :: D -> Sig -> Sig Source #

rawSqr' :: D -> Sig -> Sig Source #

rawPw' :: Double -> D -> Sig -> Sig Source #

Unipolar

unipolar :: Sig -> Sig Source #

Turns a bipolar sound (ranges from -1 to 1) to unipolar (ranges from 0 to 1)

bipolar :: Sig -> Sig Source #

Turns an unipolar sound (ranges from 0 to 1) to bipolar (ranges from -1 to 1)

uosc :: Sig -> Sig Source #

Unipolar pure tone.

uoscBy :: Tab -> Sig -> Sig Source #

Unipolar oscBy.

usaw :: Sig -> Sig Source #

Unipolar sawtooth.

uisaw :: Sig -> Sig Source #

Unipolar integrated sawtooth.

upulse :: Sig -> Sig Source #

Unipolar pulse.

usqr :: Sig -> Sig Source #

Unipolar square wave.

upw :: Sig -> Sig -> Sig Source #

Unipolar pulse width modulation wave.

utri :: Sig -> Sig Source #

Unipolar triangle wave.

uramp :: Sig -> Sig -> Sig Source #

Unipolar triangle wave with ram factor.

ublosc :: Tab -> Sig -> Sig Source #

Unipolar band-limited oscillator.

With phase control

uosc' :: D -> Sig -> Sig Source #

uoscBy' :: Tab -> D -> Sig -> Sig Source #

usaw' :: D -> Sig -> Sig Source #

uisaw' :: D -> Sig -> Sig Source #

upulse' :: D -> Sig -> Sig Source #

usqr' :: D -> Sig -> Sig Source #

upw' :: Sig -> D -> Sig -> Sig Source #

utri' :: D -> Sig -> Sig Source #

uramp' :: Sig -> D -> Sig -> Sig Source #

ublosc' :: Tab -> D -> Sig -> Sig Source #

With random phase

Raw analog waves (no band limiting)

Analogue-like waves with no band-limiting. Can be useful for LFOs.

urawPw' :: Double -> D -> Sig -> Sig Source #

Noise

rndh :: Sig -> SE Sig Source #

Constant random signal. It updates random numbers with given frequency.

constRnd freq

urndh :: Sig -> SE Sig Source #

Unipolar rndh

rndi :: Sig -> SE Sig Source #

Linear random signal. It updates random numbers with given frequency.

rndi freq

urndi :: Sig -> SE Sig Source #

Unipolar rndi

white :: SE Sig Source #

White noise.

pink :: SE Sig Source #

Pink noise.

brown :: SE Sig Source #

Brownian noise

Frequency modulation

fosc :: Sig -> Sig -> Sig -> Sig -> Sig Source #

Frequency modulation

fosc carrierFreq modulatorFreq modIndex cps

Low frequency oscillators

type Lfo = Sig Source #

Low frequency oscillator

lfo :: (Sig -> Sig) -> Sig -> Sig -> Sig Source #

Low frequency oscillator

lfo shape depth rate

Detune

detune :: Sig -> (Sig -> a) -> Sig -> a Source #

Scales the oscillator by frequency. That's how we can rise the pitch by 2 semitones and 15 cents:

detune (semitone 2 * cent 15) osc

Unision

multiHz :: Fractional a => Int -> Sig -> (Sig -> a) -> Sig -> a Source #

Unision by Hertz. It creates n oscillators that are playing the same pitch slightly detuned. The oscillatos's pitch is evenly distributed in Hz.

multiHz numberOfUnits amountHz wave

multiCent :: Fractional a => Int -> Sig -> (Sig -> a) -> Sig -> a Source #

Unision by Cents. It creates n oscillators that are playing the same pitch slightly detuned. The oscillatos's pitch is evenly distributed in cents.

multiCent numberOfUnits amountCent wave

multiRnd :: Fractional a => Int -> Sig -> (Sig -> a) -> Sig -> SE a Source #

Oscillators are detuned randomly in the given interval.

multiRnd numberOfUnits amountCent wave

multiGauss :: Fractional a => Int -> Sig -> (Sig -> a) -> Sig -> SE a Source #

Oscillators are detuned randomly with Gauss distribution in the given interval.

multiGauss numberOfUnits amountCent wave

multiRndSE :: Fractional a => Int -> Sig -> (Sig -> SE a) -> Sig -> SE a Source #

Oscillators are detuned randomly in the given interval. Useful for waves that return a signals with Side Effects.

multiRnd numberOfUnits amountCent wave

multiGaussSE :: Fractional a => Int -> Sig -> (Sig -> SE a) -> Sig -> SE a Source #

Oscillators are detuned randomly with Gauss distribution in the given interval. Useful for waves that return a signals with Side Effects.

multiGauss numberOfUnits amountCent wave

Random splines

urspline :: Sig -> Sig -> SE Sig Source #

Unipolar random splines. It generates the splines with unipolar output (ranges from 0 to 1). Arguments affect the frequency for generation of new values.

urspline cpsMin cpsMax

birspline :: Sig -> Sig -> SE Sig Source #

Bipolar random splines. It generates the splines with bipolar output (ranges from -1 to 1). Arguments affect the frequency for generation of new values.

birspline cpsMin cpsMax

Buzzes

buz :: Sig -> Sig -> Sig Source #

Output is a set of harmonically related sine partials.

buz numOfHarmonics frequency

gbuz :: (Sig, Sig) -> Sig -> Sig -> Sig Source #

Output is a set of harmonically related cosine partials.

gbuz (minHarm, maxHarm) ratio frequency

buz' :: D -> Sig -> Sig -> Sig Source #

Buz with phase

gbuz' :: D -> (Sig, Sig) -> Sig -> Sig -> Sig Source #

Gbuz with phase

Loop over files in ram

losc :: Tab -> Sig2 Source #

Loop over table stereo files. Uses loscil3 under the hood. Watch out for sample rates! If file sample rate is different from global project sample rate then playback will be distorted.

losc3 :: Tab -> Sig2 Source #

Loop over table stereo files with cubic interpolation. Uses loscil3 under the hood. Watch out for sample rates! If file sample rate is different from global project sample rate then playback will be distorted.

rosc :: Tab -> Sig2 Source #

Reversed loop over table stereo files. Uses flooper under the hood.

monoLosc :: Tab -> Sig Source #

Loop over table mono files. Uses loscil3 under the hood. Watch out for sample rates! If file sample rate is different from global project sample rate then playback will be distorted.

loscCfd :: D -> Tab -> Sig2 Source #

Loops with cross-fades at the ends. Uses entire file length

loscCfd' :: (D, D) -> D -> Tab -> Sig2 Source #

Loops with cross-fades at the ends. We can specify loop segment (in seconds).

Loop over files from disk

ldisk :: Str -> Sig2 Source #

Loop from disk (stereo files)

rdisk :: Str -> Sig2 Source #

Reversed loop from disk (stereo files)

ldisk1 :: Str -> Sig Source #

Loop from disk (mono files)

rdisk1 :: Str -> Sig Source #

Reversed loop from disk (mono files)