csound-expression-4.6.1: library to make electronic music

Safe HaskellNone
LanguageHaskell98

Csound.Air.Envelope

Contents

Description

Envelopes

Synopsis

Documentation

leg :: D -> D -> D -> D -> Sig Source

Linear adsr envelope generator with release

leg attack decay sustain release

xeg :: D -> D -> D -> D -> Sig Source

Exponential adsr envelope generator with release

xeg attack decay sustain release

Relative duration

onIdur :: [D] -> [D] Source

Makes time intervals relative to the note's duration. So that:

onIdur [a, t1, b, t2, c]

becomes:

[a, t1 * idur, b, t2 * idur, c]

lindur :: [D] -> Sig Source

The opcode linseg with time intervals relative to the total duration of the note.

expdur :: [D] -> Sig Source

The opcode expseg with time intervals relative to the total duration of the note.

linendur :: Sig -> D -> D -> Sig Source

The opcode linen with time intervals relative to the total duration of the note. Total time is set to the value of idur.

linendur asig rise decay

onDur :: D -> [D] -> [D] Source

Makes time intervals relative to the note's duration. So that:

onDur dt [a, t1, b, t2, c]

becomes:

[a, t1 * dt, b, t2 * dt, c]

lindurBy :: D -> [D] -> Sig Source

The opcode linseg with time intervals relative to the total duration of the note given by the user.

expdurBy :: D -> [D] -> Sig Source

The opcode expseg with time intervals relative to the total duration of the note given by the user.

linendurBy :: D -> Sig -> D -> D -> Sig Source

The opcode linen with time intervals relative to the total duration of the note. Total time is set to the value of the first argument.

linendurBy dt asig rise decay

Looping envelopes

lpshold :: [Sig] -> Sig -> Sig Source

Looping sample and hold envelope. The first argument is the list of pairs:

[a, durA, b, durB, c, durc, ...]

It's a list of values and durations. The durations are relative to the period of repetition. The period is specified with the second argument. The second argument is the frequency of repetition measured in Hz.

lpshold valDurs frequency

loopseg :: [Sig] -> Sig -> Sig Source

Looping linear segments envelope. The first argument is the list of pairs:

[a, durA, b, durB, c, durc, ...]

It's a list of values and durations. The durations are relative to the period of repetition. The period is specified with the second argument. The second argument is the frequency of repetition measured in Hz.

loopseg valDurs frequency

loopxseg :: [Sig] -> Sig -> Sig Source

Looping exponential segments envelope. The first argument is the list of pairs:

[a, durA, b, durB, c, durc, ...]

It's a list of values and durations. The durations are relative to the period of repetition. The period is specified with the second argument. The second argument is the frequency of repetition measured in Hz.

loopxseg valDurs frequency

lpsholdBy :: D -> [Sig] -> Sig -> Sig Source

It's like lpshold but we can specify the phase of repetition (phase belongs to [0, 1]).

loopsegBy :: D -> [Sig] -> Sig -> Sig Source

It's like loopseg but we can specify the phase of repetition (phase belongs to [0, 1]).

loopxsegBy :: D -> [Sig] -> Sig -> Sig Source

It's like loopxseg but we can specify the phase of repetition (phase belongs to [0, 1]).

holdSeq :: [Sig] -> [Sig] -> Sig -> Sig Source

The looping sequence of constant segments.

linSeg [a, durA, b, durB, c, durC, ...] [scale1, scale2, scale3] cps

The first argument is the list that specifies the shape of the looping wave. It's the alternating values and durations of transition from one value to another. The durations are relative to the period. So that lists

[0, 0.5, 1, 0.5, 0]  and [0, 50, 1, 50, 0]

produce the same results. The second list is the list of scales for subsequent periods. Every value in the period is scaled with values from the second list. The last argument is the rate of repetition (Hz).

linSeq :: [Sig] -> [Sig] -> Sig -> Sig Source

The looping sequence of linear segments.

linSeg [a, durA, b, durB, c, durC, ...] [scale1, scale2, scale3] cps

The first argument is the list that specifies the shape of the looping wave. It's the alternating values and durations of transition from one value to another. The durations are relative to the period. So that lists

[0, 0.5, 1, 0.5, 0]  and [0, 50, 1, 50, 0]

produce the same results. The second list is the list of scales for subsequent periods. Every value in the period is scaled with values from the second list. The last argument is the rate of repetition (Hz).

expSeq :: [Sig] -> [Sig] -> Sig -> Sig Source

The looping sequence of exponential segments.

expSeg [a, durA, b, durB, c, durC, ...] [scale1, scale2, scale3] cps

The first argument is the list that specifies the shape of the looping wave. It's the alternating values and durations of transition from one value to another. The durations are relative to the period. So that lists

[0, 0.5, 1, 0.5, 0]  and [0, 50, 1, 50, 0]

produce the same results. The second list is the list of scales for subsequent periods. Every value in the period is scaled with values from the second list. The last argument is the rate of repetition (Hz).

linloop :: [Sig] -> Sig Source

It's just like linseg but it loops over the envelope.

exploop :: [Sig] -> Sig Source

It's just like expseg but it loops over the envelope.

sah :: [Sig] -> Sig Source

Sample and hold cyclic signal. It takes the list of

[a, dta, b, dtb, c, dtc, ...]

the a, b, c, ... are values of the constant segments

the dta, dtb, dtc, are durations in seconds of constant segments.

The period of the repetition equals to the sum of all durations.

stepSeq :: [Sig] -> Sig -> Sig Source

constSeq :: [Sig] -> Sig -> Sig Source

Sample and hold sequence. It outputs the looping sequence of constan elements.

triSeq :: [Sig] -> Sig -> Sig Source

Step sequencer with unipolar triangle.

sqrSeq :: [Sig] -> Sig -> Sig Source

Step sequencer with unipolar square.

sawSeq :: [Sig] -> Sig -> Sig Source

Step sequencer with unipolar sawtooth.

isawSeq :: [Sig] -> Sig -> Sig Source

Step sequencer with unipolar inveted sawtooth.

xsawSeq :: [Sig] -> Sig -> Sig Source

Step sequencer with unipolar exponential sawtooth.

ixsawSeq :: [Sig] -> Sig -> Sig Source

Step sequencer with unipolar inverted exponential sawtooth.

isqrSeq :: [Sig] -> Sig -> Sig Source

Step sequencer with unipolar inveted square.

xtriSeq :: [Sig] -> Sig -> Sig Source

Step sequencer with unipolar exponential triangle.

pwSeq :: Sig -> [Sig] -> Sig -> Sig Source

A sequence of unipolar waves with pulse width moulation (see upw). The first argument is a duty cycle in range 0 to 1.

ipwSeq :: Sig -> [Sig] -> Sig -> Sig Source

A sequence of unipolar inverted waves with pulse width moulation (see upw). The first argument is a duty cycle in range 0 to 1.

rampSeq :: Sig -> [Sig] -> Sig -> Sig Source

A sequence of unipolar triangle waves with ramp factor (see uramp). The first argument is a ramp factor cycle in range 0 to 1.

irampSeq :: Sig -> [Sig] -> Sig -> Sig Source

A sequence of unipolar inverted triangle waves with ramp factor (see uramp). The first argument is a ramp factor cycle in range 0 to 1.

xrampSeq :: Sig -> [Sig] -> Sig -> Sig Source

A sequence of unipolar exponential triangle waves with ramp factor (see uramp). The first argument is a ramp factor cycle in range 0 to 1.

ixrampSeq :: Sig -> [Sig] -> Sig -> Sig Source

A sequence of unipolar inverted exponential triangle waves with ramp factor (see uramp). The first argument is a ramp factor cycle in range 0 to 1.

adsrSeq :: Sig -> Sig -> Sig -> Sig -> [Sig] -> Sig -> Sig Source

The looping ADSR envelope.

xadsrSeq attack decay sustain release weights frequency

The sum of attack, decay, sustain and release time durations should be equal to one.

xadsrSeq :: Sig -> Sig -> Sig -> Sig -> [Sig] -> Sig -> Sig Source

The looping exponential ADSR envelope. there is a fifth segment at the end of the envelope during which the envelope equals to zero.

xadsrSeq attack decay sustain release weights frequency

The sum of attack, decay, sustain and release time durations should be equal to one.

adsrSeq_ :: Sig -> Sig -> Sig -> Sig -> Sig -> [Sig] -> Sig -> Sig Source

The looping ADSR envelope with the rest at the end.

adsrSeq attack decay sustain release rest weights frequency

The sum of attack, decay, sustain, release and rest time durations should be equal to one.

xadsrSeq_ :: Sig -> Sig -> Sig -> Sig -> Sig -> [Sig] -> Sig -> Sig Source

The looping exponential ADSR envelope. there is a fifth segment at the end of the envelope during which the envelope equals to zero.

xadsrSeq_ attack decay sustain release rest weights frequency

The sum of attack, decay, sustain, release and rest time durations should be equal to one.

Faders

fadeIn :: D -> Sig Source

Fades in with the given attack time.

fadeOut :: D -> Sig Source

Fades out with the given attack time.

fades :: D -> D -> Sig Source

A combination of fade in and fade out.

fades attackDuration decayDuration

expFadeIn :: D -> Sig Source

Fades in by exponent with the given attack time.

expFadeOut :: D -> Sig Source

Fades out by exponent with the given attack time.

expFades :: D -> D -> Sig Source

A combination of exponential fade in and fade out.

expFades attackDuration decayDuration