Module

WAGS.Create.Optionals

Package
purescript-wags
Repository
mikesol/purescript-wags

This module provides functions for the construction of audio units that more closely resemble the overloaded constructors of the Web Audio API.

#AllpassOptional Source

#AllpassAll Source

#AllpassCtor Source

class AllpassCtor i allpass | i -> allpass where

Members

  • allpass :: i -> allpass

    Create an allpass filter, connecting it to another unit

    allpass { freq: 440.0 } { sinOsc: unit }
    allpass { freq: 440.0, q: 1.0 } { sinOsc: unit }
    allpass 440.0 { sinOsc: unit }
    

Instances

#BandpassOptional Source

#BandpassAll Source

#BandpassCtor Source

class BandpassCtor i bandpass | i -> bandpass where

Members

  • bandpass :: i -> bandpass

    Create a bandpass filter, connecting it to another unit

    bandpass { freq: 440.0 } { sinOsc: unit }
    bandpass { freq: 440.0, q: 1.0 } { sinOsc: unit }
    bandpass 440.0 { sinOsc: unit }
    

Instances

#ConstantOptional Source

type ConstantOptional = (onOff :: APOnOff)

#ConstantAll Source

#ConstantCtor Source

class ConstantCtor i o | i -> o where

Members

  • constant :: i -> o

    Make a constant value

    constant 0.5
    

Instances

#convolver Source

convolver :: forall s b. IsSymbol s => Proxy s -> b -> (Convolver s) /\ b

Make a convolver, aka reverb.

convolver (Proxy :: _ "room") (playBuf "track")

#CConvolver Source

type CConvolver a b = (Convolver a) /\ b

#delay Source

delay :: forall a b. Paramable a => a -> b -> (Delay AudioParameter) /\ b

Make a delay unit.

delay 0.5 (playBuf "track")

#CDelay Source

#DynamicsCompressorOptional Source

type DynamicsCompressorOptional = (attack :: AudioParameter, knee :: AudioParameter, ratio :: AudioParameter, release :: AudioParameter, threshold :: AudioParameter)

#DynamicsCompressorCtor Source

class DynamicsCompressorCtor i compressor | i -> compressor where

Members

  • compressor :: i -> compressor

    Make a compressor.

    compressor { threshold: -10.0 } { buf: playBuf "track" }
    compressor { knee: 20.0, ratio: 10.0 } { buf: playBuf "track" }
    compressor { attack: 0.01, release: 0.3 } { buf: playBuf "track" }
    

Instances

#gain Source

gain :: forall a b. Paramable a => a -> b -> (Gain AudioParameter) /\ b

#mix Source

mix :: forall a. a -> (Gain AudioParameter) /\ a

Mix together several audio units

mix (playBuf (Proxy :: _ "hello") /\ playBuf (Proxy :: _ "world") /\ unit)

#CGain Source

#HighpassOptional Source

#HighpassAll Source

#HighpassCtor Source

class HighpassCtor i highpass | i -> highpass where

Members

  • highpass :: i -> highpass

    Make a highpass filter

    highpass { freq: 440.0 } { osc: sinOsc 440.0 }
    highpass { freq: 440.0, q: 1.0 } { osc: sinOsc 440.0 }
    highpass 440.0 { osc: sinOsc 440.0 }
    

Instances

#HighshelfOptional Source

#HighshelfAll Source

#HighshelfCtor Source

class HighshelfCtor i highshelf | i -> highshelf where

Members

  • highshelf :: i -> highshelf

    Make a highshelf filter

    highshelf { freq: 440.0 } { osc: sinOsc 440.0 }
    highshelf { freq: 440.0, gain: 1.0 } { osc: sinOsc 440.0 }
    highshelf 440.0 { osc: sinOsc 440.0 }
    

Instances

#LoopBufOptional Source

type LoopBufOptional = (loopEnd :: Number, loopStart :: Number, onOff :: APOnOff, playbackRate :: AudioParameter)

#LoopBufCtor Source

class LoopBufCtor i loopBuf | i -> loopBuf where

Members

  • loopBuf :: i -> loopBuf

    Make a looping buffer.

    loopBuf { playbackRate: 1.0 } "track"
    loopBuf { playbackRate: 1.0, loopStart: 0.5 } "track"
    loopBuf "track"
    

Instances

#LowpassOptional Source

#LowpassAll Source

#LowpassCtor Source

class LowpassCtor i lowpass | i -> lowpass where

Members

  • lowpass :: i -> lowpass

    Make a lowpass filter

    lowpass { freq: 440.0 } { osc: sinOsc 440.0 }
    lowpass { freq: 440.0, q: 1.0 } { osc: sinOsc 440.0 }
    lowpass 440.0 { osc: sinOsc 440.0 }
    

Instances

#LowshelfOptional Source

#LowshelfAll Source

#LowshelfCtor Source

class LowshelfCtor i lowshelf | i -> lowshelf where

Members

  • lowshelf :: i -> lowshelf

    Make a lowshelf filter

    lowshelf { freq: 440.0 } { osc: sinOsc 440.0 }
    lowshelf { freq: 440.0, gain: 1.0 } { osc: sinOsc 440.0 }
    lowshelf 440.0 { osc: sinOsc 440.0 }
    

Instances

#CMicrophone Source

#NotchOptional Source

#NotchAll Source

#NotchCtor Source

class NotchCtor i notch | i -> notch where

Members

  • notch :: i -> notch

    Make a notch (band-reject) filter

    notch { freq: 440.0 } { osc: sinOsc 440.0 }
    notch { freq: 440.0, gain: 1.0 } { osc: sinOsc 440.0 }
    notch 440.0 { osc: sinOsc 440.0 }
    

Instances

#PeakingOptional Source

#PeakingAll Source

#PeakingCtor Source

class PeakingCtor i peaking | i -> peaking where

Members

  • peaking :: i -> peaking

    Make a peaking filter

    peaking { freq: 440.0 } { osc: sinOsc 440.0 }
    peaking { freq: 440.0, gain: 1.0 } { osc: sinOsc 440.0 }
    peaking 440.0 { osc: sinOsc 440.0 }
    

Instances

#CanBeCoercedToPeriodicOsc Source

#PeriodicOscOptional Source

type PeriodicOscOptional = (onOff :: APOnOff)

#PeriodicOscAll Source

type PeriodicOscAll wave = (freq :: AudioParameter, wave :: wave | PeriodicOscOptional)

#PeriodicOscCtor Source

class PeriodicOscCtor i o | i -> o where

Members

  • periodicOsc :: i -> o

    Make a periodicOsc value

    periodicOsc "my-osc" 0.5
    

Instances

#CPeriodicOsc Source

type CPeriodicOsc periodicOsc = (PeriodicOsc periodicOsc APOnOff AudioParameter) /\ (Record ())

#PlayBufOptional Source

type PlayBufOptional = (bufferOffset :: Number, onOff :: APOnOff, playbackRate :: AudioParameter)

#PlayBufCtor Source

class PlayBufCtor i playBuf | i -> playBuf where

Members

  • playBuf :: i -> playBuf

    Make a unit that plays from a buffer.

    playBuf { playbackRate: 1.0 } "track"
    playBuf { playbackRate: 1.0, bufferOffset: 0.5 } "track"
    playBuf "track"
    

Instances

#recorder Source

recorder :: forall a b. IsSymbol a => Proxy a -> b -> (Recorder a) /\ b

Make a recorder.

recorder "track"

#CRecorder Source

type CRecorder a b = (Recorder a) /\ b

#SawtoothOscOptional Source

type SawtoothOscOptional = (onOff :: APOnOff)

#SawtoothOscAll Source

#SawtoothOscCtor Source

class SawtoothOscCtor i o | i -> o where

Members

  • sawtoothOsc :: i -> o

    Make a sawtoothOsc value

    sawtoothOsc 0.5
    

Instances

#SinOscOptional Source

type SinOscOptional = (onOff :: APOnOff)

#SinOscAll Source

#SinOscCtor Source

class SinOscCtor i o | i -> o where

Members

  • sinOsc :: i -> o

    Make a sinOsc value

    sinOsc 0.5
    

Instances

#speaker Source

speaker :: forall b. b -> { speaker :: Speaker /\ b }

Send sound to the loudspeaker.

speaker

#speaker' Source

speaker' :: forall b. b -> Speaker /\ b

The raw constructor for speaker. Probably not useful...

#CSpeaker Source

type CSpeaker a = { speaker :: Speaker /\ a }

#SquareOscOptional Source

type SquareOscOptional = (onOff :: APOnOff)

#SquareOscAll Source

#SquareOscCtor Source

class SquareOscCtor i o | i -> o where

Members

  • squareOsc :: i -> o

    Make a squareOsc value

    squareOsc 0.5
    

Instances

#pan Source

pan :: forall a b. Paramable a => a -> b -> (StereoPanner AudioParameter) /\ b

Pan audio.

pan 0.5 { buf: playBuf "my-track" }

#TriangleOscOptional Source

type TriangleOscOptional = (onOff :: APOnOff)

#TriangleOscAll Source

#TriangleOscCtor Source

class TriangleOscCtor i o | i -> o where

Members

  • triangleOsc :: i -> o

    Make a triangleOsc value

    triangleOsc 0.5
    

Instances

#waveShaper Source

waveShaper :: forall a b c. IsSymbol a => IsOversample b => Proxy a -> b -> c -> (WaveShaper a b) /\ c

Apply distorion to audio

waveShaper (Proxy :: _ "my-wave") OversampleNone { buf: playBuf "my-track" }

#CWaveShaper Source

type CWaveShaper a b c = (WaveShaper a b) /\ c

#Ref Source

type Ref = Unit /\ (Record ())

A reference to a node in a graph.

#ref Source

ref :: Ref

A reference to a node in a graph.