Module

WAGS.Graph.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.

#GetSetAP Source

type GetSetAP = Tuple AudioParameter (AudioParameter -> AudioParameter)

Instances

#defaultGetSetAP Source

#AllpassOptional Source

#AllpassAll Source

#AllpassCtor Source

class AllpassCtor i allpass | i -> allpass where

Members

  • allpass :: i -> allpass

    Make an allpass filter

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

Instances

#BandpassOptional Source

#BandpassAll Source

#BandpassCtor Source

class BandpassCtor i bandpass | i -> bandpass where

Members

  • bandpass :: i -> bandpass

    Make a bandpass filter

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

Instances

#ConstantCtor Source

class ConstantCtor i o | i -> o where

Members

  • constant :: i -> o

    Make a constant value

    constant 0.5
    constant On 0.5
    

Instances

#convolver Source

convolver :: forall s c. IsSymbol s => IsAudioOrF c => Proxy s -> c -> Convolver s c

Make a convolver, aka reverb.

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

#delay Source

delay :: forall a c. InitialVal a => SetterVal a => IsAudioOrF c => a -> c -> Delay GetSetAP c

Make a delay unit.

delay 0.5 (playBuf (Proxy :: _ "track"))

#DynamicsCompressorOptional Source

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

#DynamicsCompressorCtor Source

class DynamicsCompressorCtor i compressor | i -> compressor where

Members

  • compressor :: i -> compressor

    Make a compressor.

    compressor (playBuf (Proxy :: _ "track"))
    compressor { threshold: -10.0 } (playBuf (Proxy :: _ "track"))
    compressor { knee: 20.0, ratio: 10.0 } (playBuf (Proxy :: _ "track"))
    compressor { attack: 0.01, release: 0.3 } (playBuf (Proxy :: _ "track"))
    

Instances

#GainCtor Source

class GainCtor i gain | i -> gain where

Members

  • gain :: i -> gain

    Make a gain unit

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

Instances

#mix Source

mix :: forall a. IsMultiAudioOrF a => a -> Gain GetSetAP a

Mix together several audio units

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

#Mix Source

type Mix a = Gain GetSetAP a

#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 } sinOsc 440.0
    highpass { freq: 440.0, q: 1.0 } sinOsc 440.0
    highpass 440.0 sinOsc 440.0
    

Instances

#HighshelfOptional Source

type HighshelfOptional = (gain :: GetSetAP)

#HighshelfAll Source

#HighshelfCtor Source

class HighshelfCtor i highshelf | i -> highshelf where

Members

  • highshelf :: i -> highshelf

    Make a highshelf filter

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

Instances

#LoopBufOptional Source

type LoopBufOptional = (end :: Number, onOff :: OnOff, playbackRate :: GetSetAP, start :: Number)

#LoopBufCtor Source

class LoopBufCtor i loopBuf | i -> loopBuf where

Members

  • loopBuf :: i -> loopBuf

    Make a looping buffer.

    loopBuf { playbackRate: 1.0 } (Proxy :: _ "track")
    loopBuf { playbackRate: 1.0, start: 0.5 } (Proxy :: _ "track")
    loopBuf (Proxy :: _ "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 } sinOsc 440.0
    lowpass { freq: 440.0, q: 1.0 } sinOsc 440.0
    lowpass 440.0 sinOsc 440.0
    

Instances

#Lowshelf' Source

#LowshelfOptional Source

type LowshelfOptional = (gain :: GetSetAP)

#LowshelfAll Source

#LowshelfCtor Source

class LowshelfCtor i lowshelf | i -> lowshelf where

Members

  • lowshelf :: i -> lowshelf

    Make a lowshelf filter

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

Instances

#Notch' Source

#NotchOptional Source

type NotchOptional = (q :: GetSetAP)

#NotchAll Source

type NotchAll = (freq :: GetSetAP | NotchOptional)

#NotchCtor Source

class NotchCtor i notch | i -> notch where

Members

Instances

#PeakingOptional Source

type PeakingOptional = (gain :: GetSetAP, q :: GetSetAP)

#PeakingAll Source

#PeakingCtor Source

class PeakingCtor i peaking | i -> peaking where

Members

Instances

#PeriodicOscCtor Source

class PeriodicOscCtor i o | i -> o where

Members

  • periodicOsc :: i -> o

    Make a periodic oscillator

    periodicOsc (Proxy :: _ "my-wavetable") 440.0
    periodicOsc On (Proxy :: _ "my-wavetable") 440.0
    

Instances

#PlayBuf' Source

data PlayBuf'

Constructors

Instances

#PlayBufOptional Source

type PlayBufOptional = (onOff :: OnOff, playbackRate :: GetSetAP, start :: Number)

#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 } (Proxy :: _ "track")
    playBuf { playbackRate: 1.0, start: 0.5 } (Proxy :: _ "track")
    playBuf (Proxy :: _ "track")
    

Instances

#recorder Source

recorder :: forall a c. IsSymbol a => IsAudio c => Proxy a -> c -> Recorder a c

Make a recorder.

recorder (Proxy :: _ "track") music

#SawtoothOscCtor Source

class SawtoothOscCtor i o | i -> o where

Members

  • sawtoothOsc :: i -> o

    Make a sawtooth oscillator

    sawtoothOsc 440.0
    sawtoothOsc On 440.0
    

Instances

#SinOscCtor Source

class SinOscCtor i o | i -> o where

Members

  • sinOsc :: i -> o

    Make a sine-wave oscillator

    sinOsc 440.0
    sinOsc On 440.0
    

Instances

#speaker Source

speaker :: forall c. IsMultiAudio c => c -> Speaker c

Send sound to the loudspeaker.

speaker music

#SquareOscCtor Source

class SquareOscCtor i o | i -> o where

Members

  • squareOsc :: i -> o

    Make a square-wave oscillator

    squareOsc 440.0
    squareOsc On 440.0
    

Instances

#pan Source

pan :: forall a c. InitialVal a => SetterVal a => IsAudioOrF c => a -> c -> StereoPanner GetSetAP c

Pan audio.

pan 0.5 music

#TriangleOscCtor Source

class TriangleOscCtor i o | i -> o where

Members

  • triangleOsc :: i -> o

    Make a triangle-wave oscillator

    triangleOsc 440.0
    triangleOsc On 440.0
    

Instances

#waveShaper Source

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

Apply distorion to audio

waveShaper (Proxy :: _ "my-wave") OversampleNone sound

#dup Source

dup :: forall toDup continuation. toDup -> continuation -> Dup toDup continuation