{-# Language FlexibleContexts, LambdaCase #-}

-- | A friendly family of effects. These functions are kindly provided by Iain McCurdy (designed in Csound).
module Csound.Air.Fx.FxBox(
    adele, pongy, tort, fowler, revsy, flan, phasy, crusher, chory, pany, oscPany, triPany, sqrPany, tremy, oscTremy, triTremy, sqrTremy, ringo, EnvelopeModSig,
    magnus,

    -- * Presets
    -- | For all presets we have 5 levels of strength. They are signified by numbers from 1 to 5. Also for some effects (delay and distortion)
    -- we have miscellaneous way to alter preset by suffix b (means bright) and m (means muffled). It alters the tone color of the effect.

    -- ** Analog Delay
    adele1, adele2, adele3, adele4, adele5,
    -- *** Bright
    adele1b, adele2b, adele3b, adele4b, adele5b,
    -- *** Muted
    adele1m, adele2m, adele3m, adele4m, adele5m,

    -- ** Ping Pong Delay
    pongy1, pongy2, pongy3, pongy4, pongy5,

    -- *** Bright
    pongy1b, pongy2b, pongy3b, pongy4b, pongy5b,

    -- *** Muted
    pongy1m, pongy2m, pongy3m, pongy4m, pongy5m,

    -- ** Distortion
    tort1, tort2, tort3, tort4, tort5,

    -- *** Bright
    tort1b, tort2b, tort3b, tort4b, tort5b,

    -- *** Muted
    tort1m, tort2m, tort3m, tort4m, tort5m,

    -- ** Envelope follower
    fowler',
    fowler1, fowler2, fowler3, fowler4, fowler5,

    -- ** Flanger
    flan',
    flan1, flan2, flan3, flan4, flan5,

    -- ** Phaser
    phasy',
    phasy1, phasy2, phasy3, phasy4, phasy5,

    -- ** Chorus
    chory',
    chory1, chory2, chory3, chory4, chory5,

    -- ** Auto Pan
    oscPany',
    oscPany1, oscPany2, oscPany3, oscPany4, oscPany5,

    triPany',
    triPany1, triPany2, triPany3, triPany4, triPany5,

    sqrPany',
    sqrPany1, sqrPany2, sqrPany3, sqrPany4, sqrPany5,

    -- ** Tremolo
    oscTremy',
    oscTremy1, oscTremy2, oscTremy3, oscTremy4, oscTremy5,

    triTremy',
    triTremy1, triTremy2, triTremy3, triTremy4, triTremy5,

    sqrTremy',
    sqrTremy1, sqrTremy2, sqrTremy3, sqrTremy4, sqrTremy5,

    -- ** Ring modulation
    ringo',
    ringo1, ringo2, ringo3, ringo4, ringo5,

    -- * Presets with UIs
    -- | If we use prefix @ui@ we can create an image of our effect that looks like guitar stompbox.
    --
    -- Let's take a distortion fr instance:
    --
    -- > type FxFun = Sig2 -> SE Sig2
    -- >
    -- > uiTort2 :: Source FxFun
    --
    -- We can combine the effects with functions:
    --
    -- > fxHor, fxVer :: [Source FxFun] -> Source FxFun
    -- >
    -- > fxMatrix :: Int -> [Source FxFun] -> Source FxFun
    -- > fxMatrix numberOfColumns fxs = ...
    --
    -- All these functions stack the effects in the list
    -- and align visuals. The visuals can be stacked horizontally, vertically
    -- or placed on a square grid.
    --
    -- Let's create a chain of effects and apply it to the input signal:
    --
    -- > > let pedals ain = lift1 (\f -> f ain) $ fxHor [uiFlan1, uiAdele2 0.25 0.5, uiHall 0.2, uiGain 0.4]
    -- >
    -- > > vdac $ pedals =<< (atMidi $ dryPatch vibraphone)
    --
    -- With @uiGain@ we can change the volume of the output.


    -- ** Reverb

    -- *** Rooms
    uiRoom, uiRoom1, uiRoom2, uiRoom3, uiRoom4, uiRoom5,

    -- ** Chambers
    uiChamber, uiChamber1, uiChamber2, uiChamber3, uiChamber4, uiChamber5,

    -- *** Halls
    uiHall, uiHall1, uiHall2, uiHall3, uiHall4, uiHall5,

    -- *** Caves
    uiCave, uiCave1, uiCave2, uiCave3, uiCave4, uiCave5,

    -- ** Mono Reverb

    -- *** Rooms
    uiMonoRoom, uiRoom1m, uiRoom2m, uiRoom3m, uiRoom4m, uiRoom5m,

    -- ** Chambers
    uiMonoChamber, uiChamber1m, uiChamber2m, uiChamber3m, uiChamber4m, uiChamber5m,

    -- *** Halls
    uiMonoHall, uiHall1m, uiHall2m, uiHall3m, uiHall4m, uiHall5m,

    -- *** Caves
    uiMonoCave, uiCave1m, uiCave2m, uiCave3m, uiCave4m, uiCave5m,

    -- ** Delay
    uiAdele1, uiAdele2, uiAdele3, uiAdele4, uiAdele5,
    uiAdele1b, uiAdele2b, uiAdele3b, uiAdele4b, uiAdele5b,
    uiAdele1m, uiAdele2m, uiAdele3m, uiAdele4m, uiAdele5m,

    -- ** Tape echo
    uiMagnus,

    -- ** Ping Pong Delay
    uiPongy1, uiPongy2, uiPongy3, uiPongy4, uiPongy5,
    uiPongy1b, uiPongy2b, uiPongy3b, uiPongy4b, uiPongy5b,
    uiPongy1m, uiPongy2m, uiPongy3m, uiPongy4m, uiPongy5m,

    -- ** Distortion
    uiTort1, uiTort2, uiTort3, uiTort4, uiTort5,
    uiTort1b, uiTort2b, uiTort3b, uiTort4b, uiTort5b,
    uiTort1m, uiTort2m, uiTort3m, uiTort4m, uiTort5m,

    -- ** Envelope follower
    uiFowler',
    uiFowler1, uiFowler2, uiFowler3, uiFowler4, uiFowler5,

    -- ** Flanger
    uiFlan', uiFlan1, uiFlan2, uiFlan3, uiFlan4, uiFlan5,

    -- ** Phaser
    uiPhasy', uiPhasy1, uiPhasy2, uiPhasy3, uiPhasy4, uiPhasy5,

    -- ** Chorus
    uiChory', uiChory1, uiChory2, uiChory3, uiChory4, uiChory5,

    -- ** Auto Pan
    uiOscPany', uiTriPany', uiSqrPany',
    uiOscPany1, uiOscPany2, uiOscPany3, uiOscPany4, uiOscPany5,
    uiTriPany1, uiTriPany2, uiTriPany3, uiTriPany4, uiTriPany5,
    uiSqrPany1, uiSqrPany2, uiSqrPany3, uiSqrPany4, uiSqrPany5,

    -- ** Tremolo
    uiOscTremy', uiTriTremy', uiSqrTremy',
    uiOscTremy1, uiOscTremy2, uiOscTremy3, uiOscTremy4, uiOscTremy5,
    uiTriTremy1, uiTriTremy2, uiTriTremy3, uiTriTremy4, uiTriTremy5,
    uiSqrTremy1, uiSqrTremy2, uiSqrTremy3, uiSqrTremy4, uiSqrTremy5,

    -- ** Reverse
    uiRevsy,

    -- ** LoFi
    uiCrusher,

    -- ** Ring modulation
    uiRingo', uiRingo1, uiRingo2, uiRingo3, uiRingo4, uiRingo5,

    -- ** Compressor
    -- | TODO


    -- * Misc

    -- ** Ambi guitar
    ambiGuitar
) where

import Data.Default

import Csound.Typed
import Csound.Typed.Opcode(scale, expcurve)
import Csound.Typed.Gui hiding (width)

import qualified Csound.Typed.Plugins as P(
    fxAnalogDelay, fxDistortion, fxEnvelopeFollower, fxFlanger, fxLoFi,
    fxPanTrem, fxMonoTrem, fxPhaser, fxReverse, fxRingModulator, fxChorus2)

import Csound.Air.Patch(Fx, Fx1, Fx2)
import Csound.Air.Fx(Balance, DelayTime, Feedback, ToneSig, SensitivitySig,
    BaseCps, Resonance, DepthSig, RateSig, TremWaveSig, FoldoverSig, BitsReductionSig,
    DriveSig, TimeSig, WidthSig,
    rever2, pingPong', PingPongSpec(..),
    EchoGain, RandomSpreadSig,
    tapeEcho)

import Csound.Air.Live(fxBox, fxColor)
import Csound.Air.Wav(toMono)
import Csound.Air.Misc(fromMono, ambiEnv, saturator)

import qualified Data.Colour.SRGB as C


-- | Analog Delay line with low-pass filter in the feedback chain.
-- The filter adds natural decay to the echoes.
--
-- > adele mixRatio delayTime feedback toneRatio ain
--
-- Note that the center frequency of the filter is measured in normalized units (form 0  to 1).
adele :: Sigs a => Balance -> DelayTime -> Feedback -> ToneSig -> a -> a
adele :: Balance -> Balance -> Balance -> Balance -> a -> a
adele Balance
kmix Balance
kdelay Balance
kfback Balance
ktone = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ Balance -> Balance -> Balance -> Balance -> Balance -> Balance
P.fxAnalogDelay Balance
kmix Balance
kdelay Balance
kfback Balance
ktone

size1, size2, size3, size4, size5 :: Fractional a => a

size1 :: a
size1 = a
0.1
size2 :: a
size2 = a
0.25
size3 :: a
size3 = a
0.5
size4 :: a
size4 = a
0.75
size5 :: a
size5 = a
0.95

-- | Distortion unit with low-pass filter.
--
-- > tort driveLevel toneRatio ain
--
-- Note that the center frequency of the filter is measured in normalized units (form 0  to 1).
tort :: Sigs a => DriveSig -> ToneSig -> a -> a
tort :: Balance -> Balance -> a -> a
tort Balance
kdrive Balance
ktone = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ Balance -> Balance -> Balance -> Balance -> Balance
P.fxDistortion Balance
1 Balance
kdrive Balance
ktone

-- | Envelope follower.
--
-- > fowler sensitivity baseFrequencyRatio resonance ain
--
-- Arguments:
--
-- * @sensitivity        @ --  sensitivity of the envelope follower (suggested range: 0 to 1)
--
-- * @baseFrequencyRatio @ --  base frequency of the filter before modulation by the input dynamics (range: 0 to 1)
--
-- * @resonance          @ --  resonance of the lowpass filter (suggested range: 0 to 1)
fowler :: Sigs a => SensitivitySig -> BaseCps -> Resonance -> a -> a
fowler :: Balance -> Balance -> Balance -> a -> a
fowler Balance
ksens Balance
kbaseFreq Balance
kreson = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ Balance -> Balance -> Balance -> Balance -> Balance
P.fxEnvelopeFollower Balance
ksens Balance
kbaseFreq (Balance
0.99 Balance -> Balance -> Balance
forall a. Num a => a -> a -> a
* Balance
kreson)

-- | An effect that reverses an audio stream in chunks
--
-- > revsy time
--
-- @time@ -- the size of the chunck in seconds.
revsy :: Sigs a => TimeSig -> a -> a
revsy :: Balance -> a -> a
revsy Balance
ktime = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ Balance -> Balance -> Balance
P.fxReverse Balance
ktime


-- | A flanger effect following the typical design of a so called 'stomp box'
--
-- >  flan rate depth delayTime feedback ain =
--
-- Arguments
--
-- * @rate      @ --  rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1)
--
-- * @depth     @ --  depth of the lfo of the effect (range 0 to 1)
--
-- * @delayTime @ --  static delay offset of the flanging effect (range 0 to 1)
--
-- * @feedback  @ --  feedback and therefore intensity of the effect (range 0 to 1)
--
-- * @ain       @ --  input audio to which the flanging effect will be applied
flan :: Sigs a => RateSig -> DepthSig -> DelayTime -> Feedback -> a -> a
flan :: Balance -> Balance -> Balance -> Balance -> a -> a
flan Balance
krate Balance
kdepth Balance
kdelay Balance
kfback = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ Balance -> Balance -> Balance -> Balance -> Balance -> Balance
P.fxFlanger Balance
krate Balance
kdepth Balance
kdelay Balance
kfback


-- | Phaser
--
-- An phase shifting effect that mimics the design of a so called 'stomp box'
--
-- > phasy rate depth freq fback ain
--
-- Arguments:
--
-- * @rate  @ --  rate of lfo of the effect (range 0 to 1)
--
-- * @depth @ --  depth of lfo of the effect (range 0 to 1)
--
-- * @freq  @ --  centre frequency of the phase shifting effect in octaves (suggested range 0 to 1)
--
-- * @fback @ --  feedback and therefore intensity of the effect (range 0 to 1)
--
-- * @ain   @ --  input audio to be pitch shifted
phasy :: Sigs a => RateSig -> DepthSig -> BaseCps -> Feedback -> a -> a
phasy :: Balance -> Balance -> Balance -> Balance -> a -> a
phasy Balance
krate Balance
kdepth Balance
cps Balance
kfback = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ Balance -> Balance -> Balance -> Balance -> Balance -> Balance
P.fxPhaser Balance
krate Balance
kdepth (Balance
6 Balance -> Balance -> Balance
forall a. Num a => a -> a -> a
+ Balance
5 Balance -> Balance -> Balance
forall a. Num a => a -> a -> a
* Balance
cps) Balance
kfback

-- | LoFi (Bit Crusher)
--
-- 'Low Fidelity' distorting effects of bit reduction and downsampling (foldover)
--
-- > crusher  bits fold ain = ...
--
-- Arguments
--
-- * @bits  @ --  bit depth reduction (range 0 to 1)
--
-- * @fold  @ --  amount of foldover (range 0 to 1)
--
-- * @ain   @ --  input audio to have low fidelity distortion effects applied
crusher :: Sigs a => BitsReductionSig -> FoldoverSig -> a -> a
crusher :: Balance -> Balance -> a -> a
crusher Balance
kbits Balance
kfold = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ Balance -> Balance -> Balance -> Balance
P.fxLoFi (Balance
0.6 Balance -> Balance -> Balance
forall a. Num a => a -> a -> a
* Balance
kbits) Balance
kfold

-- | Stereo Chorus
--
-- A stereo chorus effect
--
-- > chory rate depth width (ainLeft, ainRight)
--
-- Arguments
--
-- * @rate  @ --  rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1)
--
-- * @depth @ --  depth of the lfo of the effect (range 0 to 1)
--
-- * @width @ --  width of stereo widening (range 0 to 1)
--
-- * @ainX  @ --  input stereo signal
chory :: RateSig -> DepthSig -> WidthSig -> Sig2 -> Sig2
chory :: Balance -> Balance -> Balance -> Sig2 -> Sig2
chory Balance
krate Balance
kdepth Balance
kwidth Sig2
ain = Balance -> Balance -> Balance -> Sig2 -> Sig2
P.fxChorus2 Balance
krate Balance
kdepth Balance
kwidth Sig2
ain


-- | Auto pan
--
-- > pany wave rate depth ain
--
-- ; Arguments:
--
-- * @wave  @ --  waveform used by the lfo (0=sine 1=triangle 2=square)
--
-- * @rate  @ --  rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1)
--
-- * @depth @ --  depth of the lfo of the effect (range 0 to 1)
--
-- * @ain   @ --  input stereo audio
pany :: TremWaveSig -> DepthSig -> RateSig -> Sig2 -> Sig2
pany :: Balance -> Balance -> Balance -> Sig2 -> Sig2
pany Balance
tremWave Balance
kdepth Balance
krate = Balance -> Balance -> Balance -> Balance -> Sig2 -> Sig2
P.fxPanTrem Balance
kdepth Balance
krate Balance
0 Balance
tremWave

-- | Sine auto pan
--
-- > oscPany = pany 0
oscPany ::DepthSig -> RateSig -> Sig2 -> Sig2
oscPany :: Balance -> Balance -> Sig2 -> Sig2
oscPany = Balance -> Balance -> Balance -> Sig2 -> Sig2
pany Balance
0

-- | Triangle auto pan
--
-- > triPany = pany 1
triPany ::DepthSig -> RateSig -> Sig2 -> Sig2
triPany :: Balance -> Balance -> Sig2 -> Sig2
triPany = Balance -> Balance -> Balance -> Sig2 -> Sig2
pany Balance
1

-- | Square auto pan
--
-- > sqrPany = pany 2
sqrPany ::DepthSig -> RateSig -> Sig2 -> Sig2
sqrPany :: Balance -> Balance -> Sig2 -> Sig2
sqrPany = Balance -> Balance -> Balance -> Sig2 -> Sig2
pany Balance
2


-- | Tremolo
--
-- tremolo effect
--
-- > tremy wave rate depth ain
--
-- ; Arguments:
--
-- * @wave  @ --  waveform used by the lfo (0=sine 1=triangle 2=square)
--
-- * @rate  @ --  rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1)
--
-- * @depth @ --  depth of the lfo of the effect (range 0 to 1)
--
-- * @ain   @ --  input stereo audio
tremy :: Sigs a => TremWaveSig -> DepthSig -> RateSig -> a -> a
tremy :: Balance -> Balance -> Balance -> a -> a
tremy Balance
tremWave Balance
kdepth Balance
krate = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ Balance -> Balance -> Balance -> Balance -> Balance
P.fxMonoTrem Balance
kdepth Balance
krate Balance
tremWave

-- | Sine tremolo
--
-- > oscTremy = tremy 0
oscTremy :: Sigs a => DepthSig -> RateSig -> a -> a
oscTremy :: Balance -> Balance -> a -> a
oscTremy = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
tremy Balance
0

-- | Triangle tremolo
--
-- > triTremy = tremy 1
triTremy :: Sigs a => DepthSig -> RateSig -> a -> a
triTremy :: Balance -> Balance -> a -> a
triTremy = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
tremy Balance
1

-- | Square tremolo
--
-- > sqrTremy = tremy 2
sqrTremy :: Sigs a => DepthSig -> RateSig -> a -> a
sqrTremy :: Balance -> Balance -> a -> a
sqrTremy = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
tremy Balance
2

-- ringo

type EnvelopeModSig = Sig

-- | RingModulator
--
-- An ring modulating effect with an envelope follower
--
-- > ringo balance rate envelopeMod ain
--
-- * @balance     @  --  dry / wet mix of the output signal (range 0 to 1)
-- ; @rate        @  --  frequency of thew ring modulator *NOT IN HERTZ* (range 0 to 1)
-- ; @envelopeMod @  --  amount of dynamic envelope following modulation of frequency (range 0 to 1)
-- * @ain         @  --  input audio to be pitch shifted
ringo :: Sigs a => Balance -> RateSig -> EnvelopeModSig -> a -> a
ringo :: Balance -> Balance -> Balance -> a -> a
ringo Balance
balance Balance
rate Balance
envelopeMod = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig ((Balance -> Balance) -> a -> a) -> (Balance -> Balance) -> a -> a
forall a b. (a -> b) -> a -> b
$ \Balance
ain -> Balance -> Balance -> Balance -> Balance -> Balance
P.fxRingModulator Balance
ain Balance
balance Balance
rate Balance
envelopeMod

---------------------------------------------------------------------
-- Presets

-- Analog Delay

adeleBy :: Sigs a => ToneSig -> Feedback -> Balance -> DelayTime -> a -> a
adeleBy :: Balance -> Balance -> Balance -> Balance -> a -> a
adeleBy Balance
tone Balance
size Balance
balance Balance
delTime = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
adele Balance
balance Balance
delTime Balance
size Balance
tone

adeleBy_ :: Sigs a => Feedback -> Balance -> DelayTime -> a -> a
adeleBy_ :: Balance -> Balance -> Balance -> a -> a
adeleBy_ = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
adeleBy Balance
0.5

adele1, adele2, adele3, adele4, adele5 :: Sigs a => Balance -> DelayTime -> a -> a

adele1 :: Balance -> Balance -> a -> a
adele1 = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleBy_ Balance
forall a. Fractional a => a
size1
adele2 :: Balance -> Balance -> a -> a
adele2 = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleBy_ Balance
forall a. Fractional a => a
size2
adele3 :: Balance -> Balance -> a -> a
adele3 = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleBy_ Balance
forall a. Fractional a => a
size3
adele4 :: Balance -> Balance -> a -> a
adele4 = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleBy_ Balance
forall a. Fractional a => a
size4
adele5 :: Balance -> Balance -> a -> a
adele5 = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleBy_ Balance
forall a. Fractional a => a
size5

adeleByB :: Sigs a => Feedback -> Balance -> DelayTime -> a -> a
adeleByB :: Balance -> Balance -> Balance -> a -> a
adeleByB = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
adeleBy Balance
0.8

adele1b, adele2b, adele3b, adele4b, adele5b :: Sigs a => Balance -> DelayTime -> a -> a

adele1b :: Balance -> Balance -> a -> a
adele1b = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByB Balance
forall a. Fractional a => a
size1
adele2b :: Balance -> Balance -> a -> a
adele2b = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByB Balance
forall a. Fractional a => a
size2
adele3b :: Balance -> Balance -> a -> a
adele3b = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByB Balance
forall a. Fractional a => a
size3
adele4b :: Balance -> Balance -> a -> a
adele4b = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByB Balance
forall a. Fractional a => a
size4
adele5b :: Balance -> Balance -> a -> a
adele5b = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByB Balance
forall a. Fractional a => a
size5

adeleByM :: Sigs a => Feedback -> Balance -> DelayTime -> a -> a
adeleByM :: Balance -> Balance -> Balance -> a -> a
adeleByM = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
adeleBy Balance
0.2

adele1m, adele2m, adele3m, adele4m, adele5m :: Sigs a => Balance -> DelayTime -> a -> a

adele1m :: Balance -> Balance -> a -> a
adele1m = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByM Balance
forall a. Fractional a => a
size1
adele2m :: Balance -> Balance -> a -> a
adele2m = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByM Balance
forall a. Fractional a => a
size2
adele3m :: Balance -> Balance -> a -> a
adele3m = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByM Balance
forall a. Fractional a => a
size3
adele4m :: Balance -> Balance -> a -> a
adele4m = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByM Balance
forall a. Fractional a => a
size4
adele5m :: Balance -> Balance -> a -> a
adele5m = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
adeleByM Balance
forall a. Fractional a => a
size5

-- | magnus - simulates magnetic tape echo/delay
--
-- > magnus size feedback echoGain tone randomSpread ain
--
-- * size - how many heads in the tape
-- * feedback
-- * echo gain
-- * tone - normalized center frequency of the filter (0  to 1)
-- * randomSpread - quality of the tape (the higher - the worser)
magnus :: Sigs a => D -> DelayTime -> Feedback -> EchoGain -> ToneSig -> RandomSpreadSig -> a -> a
magnus :: D -> Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
magnus D
size Balance
delt Balance
fb Balance
echoGain Balance
ktone Balance
randomSpread = (Balance -> Balance) -> a -> a
forall a. SigSpace a => (Balance -> Balance) -> a -> a
mapSig (D
-> Balance
-> Balance
-> Balance
-> Balance
-> Balance
-> Balance
-> Balance
tapeEcho D
size Balance
delt Balance
fb Balance
echoGain Balance
ktone Balance
randomSpread)

-- Ping Pong delay

-- | Ping-pong delay
--
-- > pongy kmix delayTime feedback tone ain
pongy ::  Sig2s a => Balance -> DelayTime -> Feedback -> ToneSig -> WidthSig -> a -> a
pongy :: Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
pongy Balance
balance Balance
delTime Balance
fbk Balance
tone Balance
width = (Sig2 -> Sig2) -> a -> a
forall a. SigSpace2 a => (Sig2 -> Sig2) -> a -> a
mapSig2 (PingPongSpec -> Balance -> Balance -> Balance -> Sig2 -> Sig2
pingPong' (PingPongSpec
forall a. Default a => a
def { pingPongDamp :: Balance
pingPongDamp = Balance
absTone, pingPongWidth :: Balance
pingPongWidth = Balance
width }) Balance
delTime Balance
fbk Balance
balance)
    where absTone :: Balance
absTone = Balance -> Balance -> Balance -> Balance
scale (Balance -> Balance -> Balance
expcurve Balance
tone Balance
4) Balance
12000 Balance
100

pongyBy :: Sig2s a => ToneSig -> Feedback -> Balance -> DelayTime -> WidthSig -> a -> a
pongyBy :: Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy Balance
tone Balance
size Balance
balance Balance
delTime Balance
width = Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
pongy Balance
balance Balance
delTime Balance
size Balance
tone Balance
width

pongyBy_ :: Sig2s a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a
pongyBy_ :: Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy_ = Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy Balance
0.5

pongy1, pongy2, pongy3, pongy4, pongy5 :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a

pongy1 :: Balance -> Balance -> Balance -> a -> a
pongy1 = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy_ Balance
forall a. Fractional a => a
size1
pongy2 :: Balance -> Balance -> Balance -> a -> a
pongy2 = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy_ Balance
forall a. Fractional a => a
size2
pongy3 :: Balance -> Balance -> Balance -> a -> a
pongy3 = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy_ Balance
forall a. Fractional a => a
size3
pongy4 :: Balance -> Balance -> Balance -> a -> a
pongy4 = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy_ Balance
forall a. Fractional a => a
size4
pongy5 :: Balance -> Balance -> Balance -> a -> a
pongy5 = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy_ Balance
forall a. Fractional a => a
size5

pongyByB :: Sig2s a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a
pongyByB :: Balance -> Balance -> Balance -> Balance -> a -> a
pongyByB = Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy Balance
0.8

pongy1b, pongy2b, pongy3b, pongy4b, pongy5b :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a

pongy1b :: Balance -> Balance -> Balance -> a -> a
pongy1b = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByB Balance
forall a. Fractional a => a
size1
pongy2b :: Balance -> Balance -> Balance -> a -> a
pongy2b = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByB Balance
forall a. Fractional a => a
size2
pongy3b :: Balance -> Balance -> Balance -> a -> a
pongy3b = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByB Balance
forall a. Fractional a => a
size3
pongy4b :: Balance -> Balance -> Balance -> a -> a
pongy4b = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByB Balance
forall a. Fractional a => a
size4
pongy5b :: Balance -> Balance -> Balance -> a -> a
pongy5b = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByB Balance
forall a. Fractional a => a
size5

pongyByM :: Sig2s a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a
pongyByM :: Balance -> Balance -> Balance -> Balance -> a -> a
pongyByM = Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
pongyBy Balance
0.2

pongy1m, pongy2m, pongy3m, pongy4m, pongy5m :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a

pongy1m :: Balance -> Balance -> Balance -> a -> a
pongy1m = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByM Balance
forall a. Fractional a => a
size1
pongy2m :: Balance -> Balance -> Balance -> a -> a
pongy2m = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByM Balance
forall a. Fractional a => a
size2
pongy3m :: Balance -> Balance -> Balance -> a -> a
pongy3m = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByM Balance
forall a. Fractional a => a
size3
pongy4m :: Balance -> Balance -> Balance -> a -> a
pongy4m = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByM Balance
forall a. Fractional a => a
size4
pongy5m :: Balance -> Balance -> Balance -> a -> a
pongy5m = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> a -> a
pongyByM Balance
forall a. Fractional a => a
size5

-- Distortion

tortBy :: Sigs a => ToneSig -> DriveSig -> a -> a
tortBy :: Balance -> Balance -> a -> a
tortBy Balance
tone Balance
drive = Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
tort Balance
drive Balance
tone

tortBy_ :: Sigs a => DriveSig -> a -> a
tortBy_ :: Balance -> a -> a
tortBy_ = Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
tortBy Balance
0.5

tort1, tort2, tort3, tort4, tort5 :: Sigs a => a -> a

tort1 :: a -> a
tort1 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortBy_ Balance
forall a. Fractional a => a
size1
tort2 :: a -> a
tort2 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortBy_ Balance
forall a. Fractional a => a
size2
tort3 :: a -> a
tort3 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortBy_ Balance
forall a. Fractional a => a
size3
tort4 :: a -> a
tort4 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortBy_ Balance
forall a. Fractional a => a
size4
tort5 :: a -> a
tort5 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortBy_ Balance
forall a. Fractional a => a
size5

tortByB :: Sigs a => DriveSig -> a -> a
tortByB :: Balance -> a -> a
tortByB = Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
tortBy Balance
0.85

tort1b, tort2b, tort3b, tort4b, tort5b :: Sigs a => a -> a

tort1b :: a -> a
tort1b = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByB Balance
forall a. Fractional a => a
size1
tort2b :: a -> a
tort2b = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByB Balance
forall a. Fractional a => a
size2
tort3b :: a -> a
tort3b = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByB Balance
forall a. Fractional a => a
size3
tort4b :: a -> a
tort4b = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByB Balance
forall a. Fractional a => a
size4
tort5b :: a -> a
tort5b = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByB Balance
forall a. Fractional a => a
size5

tortByM :: Sigs a => DriveSig -> a -> a
tortByM :: Balance -> a -> a
tortByM = Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
tortBy Balance
0.2

tort1m, tort2m, tort3m, tort4m, tort5m :: Sigs a => a -> a

tort1m :: a -> a
tort1m = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByM Balance
forall a. Fractional a => a
size1
tort2m :: a -> a
tort2m = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByM Balance
forall a. Fractional a => a
size2
tort3m :: a -> a
tort3m = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByM Balance
forall a. Fractional a => a
size3
tort4m :: a -> a
tort4m = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByM Balance
forall a. Fractional a => a
size4
tort5m :: a -> a
tort5m = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
tortByM Balance
forall a. Fractional a => a
size5

-- Envelope follower

fowler' :: Sigs a => Sig -> a -> a
fowler' :: Balance -> a -> a
fowler' Balance
size = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
fowler Balance
size Balance
size Balance
size

fowler1, fowler2, fowler3, fowler4, fowler5 :: Sigs a => a -> a

fowler1 :: a -> a
fowler1 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
fowler' Balance
forall a. Fractional a => a
size1
fowler2 :: a -> a
fowler2 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
fowler' Balance
forall a. Fractional a => a
size2
fowler3 :: a -> a
fowler3 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
fowler' Balance
forall a. Fractional a => a
size3
fowler4 :: a -> a
fowler4 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
fowler' Balance
forall a. Fractional a => a
size4
fowler5 :: a -> a
fowler5 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
fowler' Balance
forall a. Fractional a => a
size5

-- Flanger

flan' :: Sigs a => Sig -> a -> a
flan' :: Balance -> a -> a
flan' Balance
size = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
flan Balance
size Balance
size Balance
size Balance
size

flan1, flan2, flan3, flan4, flan5 :: Sigs a => a -> a

flan1 :: a -> a
flan1 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
flan' Balance
forall a. Fractional a => a
size1
flan2 :: a -> a
flan2 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
flan' Balance
forall a. Fractional a => a
size2
flan3 :: a -> a
flan3 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
flan' Balance
forall a. Fractional a => a
size3
flan4 :: a -> a
flan4 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
flan' Balance
forall a. Fractional a => a
size4
flan5 :: a -> a
flan5 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
flan' Balance
forall a. Fractional a => a
size5

-- Phaser

-- phasy :: RateSig -> DepthSig -> BaseCps -> Feedback -> Sig -> Sig

phasy' :: Sigs a => Sig -> a -> a
phasy' :: Balance -> a -> a
phasy' Balance
size = Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
phasy Balance
size Balance
size Balance
size Balance
size

phasy1, phasy2, phasy3, phasy4, phasy5 :: Sigs a => a -> a

phasy1 :: a -> a
phasy1 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
phasy' Balance
forall a. Fractional a => a
size1
phasy2 :: a -> a
phasy2 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
phasy' Balance
forall a. Fractional a => a
size2
phasy3 :: a -> a
phasy3 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
phasy' Balance
forall a. Fractional a => a
size3
phasy4 :: a -> a
phasy4 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
phasy' Balance
forall a. Fractional a => a
size4
phasy5 :: a -> a
phasy5 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
phasy' Balance
forall a. Fractional a => a
size5

-- Chorus

chory' :: Sig2s a => Sig -> a -> a
chory' :: Balance -> a -> a
chory' Balance
size = (Sig2 -> Sig2) -> a -> a
forall a. SigSpace2 a => (Sig2 -> Sig2) -> a -> a
mapSig2 (Balance -> Balance -> Balance -> Sig2 -> Sig2
chory Balance
size Balance
size Balance
size)

chory1, chory2, chory3, chory4, chory5 :: Sig2s a => a -> a

chory1 :: a -> a
chory1 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
chory' Balance
forall a. Fractional a => a
size1
chory2 :: a -> a
chory2 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
chory' Balance
forall a. Fractional a => a
size2
chory3 :: a -> a
chory3 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
chory' Balance
forall a. Fractional a => a
size3
chory4 :: a -> a
chory4 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
chory' Balance
forall a. Fractional a => a
size4
chory5 :: a -> a
chory5 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
chory' Balance
forall a. Fractional a => a
size5

-- Auto Pan

-- pany :: TremWaveSig -> DepthSig -> RateSig -> Sig2 -> Sig2

oscPany' :: Sig2s a => Sig -> a -> a
oscPany' :: Balance -> a -> a
oscPany' Balance
size = (Sig2 -> Sig2) -> a -> a
forall a. SigSpace2 a => (Sig2 -> Sig2) -> a -> a
mapSig2 (Balance -> Balance -> Sig2 -> Sig2
oscPany Balance
size Balance
size)

oscPany1, oscPany2, oscPany3, oscPany4, oscPany5 :: Sig2s a => a -> a

oscPany1 :: a -> a
oscPany1 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
oscPany' Balance
forall a. Fractional a => a
size1
oscPany2 :: a -> a
oscPany2 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
oscPany' Balance
forall a. Fractional a => a
size2
oscPany3 :: a -> a
oscPany3 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
oscPany' Balance
forall a. Fractional a => a
size3
oscPany4 :: a -> a
oscPany4 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
oscPany' Balance
forall a. Fractional a => a
size4
oscPany5 :: a -> a
oscPany5 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
oscPany' Balance
forall a. Fractional a => a
size5

triPany' :: Sig2s a => Sig -> a -> a
triPany' :: Balance -> a -> a
triPany' Balance
size = (Sig2 -> Sig2) -> a -> a
forall a. SigSpace2 a => (Sig2 -> Sig2) -> a -> a
mapSig2 (Balance -> Balance -> Sig2 -> Sig2
triPany Balance
size Balance
size)

triPany1, triPany2, triPany3, triPany4, triPany5 :: Sig2s a => a -> a

triPany1 :: a -> a
triPany1 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
triPany' Balance
forall a. Fractional a => a
size1
triPany2 :: a -> a
triPany2 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
triPany' Balance
forall a. Fractional a => a
size2
triPany3 :: a -> a
triPany3 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
triPany' Balance
forall a. Fractional a => a
size3
triPany4 :: a -> a
triPany4 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
triPany' Balance
forall a. Fractional a => a
size4
triPany5 :: a -> a
triPany5 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
triPany' Balance
forall a. Fractional a => a
size5

sqrPany' :: Sig2s a => Sig -> a -> a
sqrPany' :: Balance -> a -> a
sqrPany' Balance
size = (Sig2 -> Sig2) -> a -> a
forall a. SigSpace2 a => (Sig2 -> Sig2) -> a -> a
mapSig2 (Balance -> Balance -> Sig2 -> Sig2
sqrPany Balance
size Balance
size)

sqrPany1, sqrPany2, sqrPany3, sqrPany4, sqrPany5 :: Sig2s a => a -> a

sqrPany1 :: a -> a
sqrPany1 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
sqrPany' Balance
forall a. Fractional a => a
size1
sqrPany2 :: a -> a
sqrPany2 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
sqrPany' Balance
forall a. Fractional a => a
size2
sqrPany3 :: a -> a
sqrPany3 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
sqrPany' Balance
forall a. Fractional a => a
size3
sqrPany4 :: a -> a
sqrPany4 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
sqrPany' Balance
forall a. Fractional a => a
size4
sqrPany5 :: a -> a
sqrPany5 = Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
sqrPany' Balance
forall a. Fractional a => a
size5

-- Tremolo

oscTremy' :: Sigs a => Sig -> a -> a
oscTremy' :: Balance -> a -> a
oscTremy' Balance
size = Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
oscTremy Balance
size Balance
size

oscTremy1, oscTremy2, oscTremy3, oscTremy4, oscTremy5 :: Sigs a => a -> a

oscTremy1 :: a -> a
oscTremy1 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
oscTremy' Balance
forall a. Fractional a => a
size1
oscTremy2 :: a -> a
oscTremy2 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
oscTremy' Balance
forall a. Fractional a => a
size2
oscTremy3 :: a -> a
oscTremy3 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
oscTremy' Balance
forall a. Fractional a => a
size3
oscTremy4 :: a -> a
oscTremy4 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
oscTremy' Balance
forall a. Fractional a => a
size4
oscTremy5 :: a -> a
oscTremy5 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
oscTremy' Balance
forall a. Fractional a => a
size5

triTremy' :: Sigs a => Sig -> a -> a
triTremy' :: Balance -> a -> a
triTremy' Balance
size = Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
triTremy Balance
size Balance
size

triTremy1, triTremy2, triTremy3, triTremy4, triTremy5 :: Sigs a => a -> a

triTremy1 :: a -> a
triTremy1 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
triTremy' Balance
forall a. Fractional a => a
size1
triTremy2 :: a -> a
triTremy2 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
triTremy' Balance
forall a. Fractional a => a
size2
triTremy3 :: a -> a
triTremy3 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
triTremy' Balance
forall a. Fractional a => a
size3
triTremy4 :: a -> a
triTremy4 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
triTremy' Balance
forall a. Fractional a => a
size4
triTremy5 :: a -> a
triTremy5 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
triTremy' Balance
forall a. Fractional a => a
size5


sqrTremy' :: Sigs a => Sig -> a -> a
sqrTremy' :: Balance -> a -> a
sqrTremy' Balance
size = Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
sqrTremy Balance
size Balance
size

sqrTremy1, sqrTremy2, sqrTremy3, sqrTremy4, sqrTremy5 :: Sigs a => a -> a

sqrTremy1 :: a -> a
sqrTremy1 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
sqrTremy' Balance
forall a. Fractional a => a
size1
sqrTremy2 :: a -> a
sqrTremy2 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
sqrTremy' Balance
forall a. Fractional a => a
size2
sqrTremy3 :: a -> a
sqrTremy3 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
sqrTremy' Balance
forall a. Fractional a => a
size3
sqrTremy4 :: a -> a
sqrTremy4 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
sqrTremy' Balance
forall a. Fractional a => a
size4
sqrTremy5 :: a -> a
sqrTremy5 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
sqrTremy' Balance
forall a. Fractional a => a
size5

-- Ring modulation

ringo' :: Sigs a => Sig -> a -> a
ringo' :: Balance -> a -> a
ringo' Balance
size = Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
ringo Balance
size Balance
size Balance
size

ringo1, ringo2, ringo3, ringo4, ringo5 :: Sigs a => a -> a

ringo1 :: a -> a
ringo1 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
ringo' Balance
forall a. Fractional a => a
size1
ringo2 :: a -> a
ringo2 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
ringo' Balance
forall a. Fractional a => a
size2
ringo3 :: a -> a
ringo3 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
ringo' Balance
forall a. Fractional a => a
size3
ringo4 :: a -> a
ringo4 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
ringo' Balance
forall a. Fractional a => a
size4
ringo5 :: a -> a
ringo5 = Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
ringo' Balance
forall a. Fractional a => a
size5

----------------------------------------------------------
-- UI

setAll :: Double -> [String] -> [(String, Double)]
setAll :: Double -> [String] -> [(String, Double)]
setAll Double
size [String]
names = (String -> (String, Double)) -> [String] -> [(String, Double)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\String
s -> (String
s, Double
size)) [String]
names


-- colors
tortColor, fowlerColor, adeleColor, pongColor, flanColor, revsyColor, phasyColor,
  crusherColor, choryColor, panyColor, tremyColor, ringoColor, reverbColor :: String

tortColor :: String
tortColor = String
red
fowlerColor :: String
fowlerColor = String
maroon
adeleColor :: String
adeleColor = String
blue
pongColor :: String
pongColor = String
orange
flanColor :: String
flanColor = String
purple
revsyColor :: String
revsyColor = String
lime
phasyColor :: String
phasyColor = String
yellow
crusherColor :: String
crusherColor = String
fuchsia
choryColor :: String
choryColor = String
navy
panyColor :: String
panyColor = String
aqua
tremyColor :: String
tremyColor = String
green
ringoColor :: String
ringoColor = String
maroon
reverbColor :: String
reverbColor = String
olive

paintTo :: String -> Source a -> Source a
paintTo :: String -> Source a -> Source a
paintTo = Color -> Source a -> Source a
forall a. Color -> Source a -> Source a
fxColor (Color -> Source a -> Source a)
-> (String -> Color) -> String -> Source a -> Source a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Color
forall b. (Ord b, Floating b) => String -> Colour b
C.sRGB24read

red, maroon, blue, aqua, navy, lime,  green, yellow, purple, olive, orange, fuchsia :: String

red :: String
red = String
"#FF4136"
maroon :: String
maroon = String
"#85144b"
blue :: String
blue = String
"#0074D9"
aqua :: String
aqua = String
"#7FDBFF"
navy :: String
navy = String
"#001f3f"
lime :: String
lime = String
"#01FF70"
green :: String
green = String
"#2ECC40"
yellow :: String
yellow = String
"#FFDC00"
purple :: String
purple = String
"#B10DC9"
olive :: String
olive = String
"#3D9970"
-- teal = "#39CCCC"
orange :: String
orange = String
"#FF851B"
fuchsia :: String
fuchsia = String
"#F012BE"

-- Analog Delay

uiAdeleBy :: Sigs a => Double -> Double -> Double -> Double -> Source (Fx a)
uiAdeleBy :: Double -> Double -> Double -> Double -> Source (Fx a)
uiAdeleBy Double
initTone Double
initFeedback Double
initBalance Double
initDelayTime = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
adeleColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Delay" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True  [(String
"balance", Double
initBalance), (String
"del time", Double
initDelayTime), (String
"fbk", Double
initFeedback), (String
"tone", Double
initTone)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
balance, Balance
delayTime, Balance
feedback, Balance
tone] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
adele Balance
balance Balance
delayTime Balance
feedback Balance
tone
        fx [Balance]
_                                    = a -> m a
forall a. HasCallStack => a
undefined

uiAdeleBy_ :: Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleBy_ :: Double -> Double -> Double -> Source (Fx a)
uiAdeleBy_ = Double -> Double -> Double -> Double -> Source (Fx a)
forall a.
Sigs a =>
Double -> Double -> Double -> Double -> Source (Fx a)
uiAdeleBy Double
0.5

uiAdele1, uiAdele2, uiAdele3, uiAdele4, uiAdele5 :: Sigs a => Double -> Double -> Source (Fx a)

uiAdele1 :: Double -> Double -> Source (Fx a)
uiAdele1 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleBy_ Double
forall a. Fractional a => a
size1
uiAdele2 :: Double -> Double -> Source (Fx a)
uiAdele2 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleBy_ Double
forall a. Fractional a => a
size2
uiAdele3 :: Double -> Double -> Source (Fx a)
uiAdele3 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleBy_ Double
forall a. Fractional a => a
size3
uiAdele4 :: Double -> Double -> Source (Fx a)
uiAdele4 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleBy_ Double
forall a. Fractional a => a
size4
uiAdele5 :: Double -> Double -> Source (Fx a)
uiAdele5 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleBy_ Double
forall a. Fractional a => a
size5

uiAdeleByB :: Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByB :: Double -> Double -> Double -> Source (Fx a)
uiAdeleByB = Double -> Double -> Double -> Double -> Source (Fx a)
forall a.
Sigs a =>
Double -> Double -> Double -> Double -> Source (Fx a)
uiAdeleBy Double
0.8

uiAdele1b, uiAdele2b, uiAdele3b, uiAdele4b, uiAdele5b :: Sigs a => Double -> Double -> Source (Fx a)

uiAdele1b :: Double -> Double -> Source (Fx a)
uiAdele1b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByB Double
forall a. Fractional a => a
size1
uiAdele2b :: Double -> Double -> Source (Fx a)
uiAdele2b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByB Double
forall a. Fractional a => a
size2
uiAdele3b :: Double -> Double -> Source (Fx a)
uiAdele3b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByB Double
forall a. Fractional a => a
size3
uiAdele4b :: Double -> Double -> Source (Fx a)
uiAdele4b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByB Double
forall a. Fractional a => a
size4
uiAdele5b :: Double -> Double -> Source (Fx a)
uiAdele5b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByB Double
forall a. Fractional a => a
size5

uiAdeleByM :: Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByM :: Double -> Double -> Double -> Source (Fx a)
uiAdeleByM = Double -> Double -> Double -> Double -> Source (Fx a)
forall a.
Sigs a =>
Double -> Double -> Double -> Double -> Source (Fx a)
uiAdeleBy Double
0.2

uiAdele1m, uiAdele2m, uiAdele3m, uiAdele4m, uiAdele5m :: Sigs a => Double -> Double -> Source (Fx a)

uiAdele1m :: Double -> Double -> Source (Fx a)
uiAdele1m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByM Double
forall a. Fractional a => a
size1
uiAdele2m :: Double -> Double -> Source (Fx a)
uiAdele2m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByM Double
forall a. Fractional a => a
size2
uiAdele3m :: Double -> Double -> Source (Fx a)
uiAdele3m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByM Double
forall a. Fractional a => a
size3
uiAdele4m :: Double -> Double -> Source (Fx a)
uiAdele4m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByM Double
forall a. Fractional a => a
size4
uiAdele5m :: Double -> Double -> Source (Fx a)
uiAdele5m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiAdeleByM Double
forall a. Fractional a => a
size5

-- Tape echo

uiMagnus :: Sigs a => Int -> Double -> Double -> Double -> Double -> Double -> Source (Fx a)
uiMagnus :: Int
-> Double -> Double -> Double -> Double -> Double -> Source (Fx a)
uiMagnus Int
size Double
initDelayTime Double
initFeedback Double
initEchoGain Double
initTone Double
initSpread  = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
adeleColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Tape echo" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True [(String
"del time", Double
initDelayTime), (String
"fbk", Double
initFeedback), (String
"echo gain", Double
initEchoGain), (String
"tone", Double
initTone), (String
"tape qty", Double
initSpread)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
delayTime, Balance
feedback, Balance
echoGain, Balance
tone, Balance
spread] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. D -> Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
D -> Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
magnus (Int -> D
int Int
size) Balance
delayTime Balance
feedback Balance
echoGain Balance
tone Balance
spread
        fx [Balance]
_                                             = a -> m a
forall a. HasCallStack => a
undefined

-- Ping-pong delay

uiPongyBy :: Sigs a => Double -> Double -> Double -> Double -> Double -> Source (Fx a)
uiPongyBy :: Double -> Double -> Double -> Double -> Double -> Source (Fx a)
uiPongyBy Double
initTone Double
initWidth Double
initFeedback Double
initBalance Double
initDelayTime = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
pongColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Ping-pong" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sig2s a) => [Balance] -> a -> m a
fx Bool
True  [(String
"balance", Double
initBalance), (String
"del time", Double
initDelayTime), (String
"fbk", Double
initFeedback), (String
"tone", Double
initTone), (String
"width", Double
initWidth)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
balance, Balance
delayTime, Balance
feedback, Balance
tone, Balance
width] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sig2s a =>
Balance -> Balance -> Balance -> Balance -> Balance -> a -> a
pongy Balance
balance Balance
delayTime Balance
feedback Balance
tone Balance
width
        fx [Balance]
_                                           = a -> m a
forall a. HasCallStack => a
undefined

defWidth :: Double
defWidth :: Double
defWidth = Double
0.7

uiPongyBy_ :: Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyBy_ :: Double -> Double -> Double -> Source (Fx a)
uiPongyBy_ = Double -> Double -> Double -> Double -> Double -> Source (Fx a)
forall a.
Sigs a =>
Double -> Double -> Double -> Double -> Double -> Source (Fx a)
uiPongyBy Double
0.5 Double
defWidth

uiPongy1, uiPongy2, uiPongy3, uiPongy4, uiPongy5 :: Sigs a => Double -> Double -> Source (Fx a)

uiPongy1 :: Double -> Double -> Source (Fx a)
uiPongy1 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyBy_ Double
forall a. Fractional a => a
size1
uiPongy2 :: Double -> Double -> Source (Fx a)
uiPongy2 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyBy_ Double
forall a. Fractional a => a
size2
uiPongy3 :: Double -> Double -> Source (Fx a)
uiPongy3 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyBy_ Double
forall a. Fractional a => a
size3
uiPongy4 :: Double -> Double -> Source (Fx a)
uiPongy4 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyBy_ Double
forall a. Fractional a => a
size4
uiPongy5 :: Double -> Double -> Source (Fx a)
uiPongy5 = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyBy_ Double
forall a. Fractional a => a
size5

uiPongyByB :: Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByB :: Double -> Double -> Double -> Source (Fx a)
uiPongyByB = Double -> Double -> Double -> Double -> Double -> Source (Fx a)
forall a.
Sigs a =>
Double -> Double -> Double -> Double -> Double -> Source (Fx a)
uiPongyBy Double
0.8 Double
defWidth

uiPongy1b, uiPongy2b, uiPongy3b, uiPongy4b, uiPongy5b :: Sigs a => Double -> Double -> Source (Fx a)

uiPongy1b :: Double -> Double -> Source (Fx a)
uiPongy1b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByB Double
forall a. Fractional a => a
size1
uiPongy2b :: Double -> Double -> Source (Fx a)
uiPongy2b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByB Double
forall a. Fractional a => a
size2
uiPongy3b :: Double -> Double -> Source (Fx a)
uiPongy3b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByB Double
forall a. Fractional a => a
size3
uiPongy4b :: Double -> Double -> Source (Fx a)
uiPongy4b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByB Double
forall a. Fractional a => a
size4
uiPongy5b :: Double -> Double -> Source (Fx a)
uiPongy5b = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByB Double
forall a. Fractional a => a
size5

uiPongyByM :: Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByM :: Double -> Double -> Double -> Source (Fx a)
uiPongyByM = Double -> Double -> Double -> Double -> Double -> Source (Fx a)
forall a.
Sigs a =>
Double -> Double -> Double -> Double -> Double -> Source (Fx a)
uiPongyBy Double
0.2 Double
defWidth

uiPongy1m, uiPongy2m, uiPongy3m, uiPongy4m, uiPongy5m :: Sigs a => Double -> Double -> Source (Fx a)

uiPongy1m :: Double -> Double -> Source (Fx a)
uiPongy1m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByM Double
forall a. Fractional a => a
size1
uiPongy2m :: Double -> Double -> Source (Fx a)
uiPongy2m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByM Double
forall a. Fractional a => a
size2
uiPongy3m :: Double -> Double -> Source (Fx a)
uiPongy3m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByM Double
forall a. Fractional a => a
size3
uiPongy4m :: Double -> Double -> Source (Fx a)
uiPongy4m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByM Double
forall a. Fractional a => a
size4
uiPongy5m :: Double -> Double -> Source (Fx a)
uiPongy5m = Double -> Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Double -> Source (Fx a)
uiPongyByM Double
forall a. Fractional a => a
size5

-- Distortion

uiTortBy :: Sigs a => Double -> Double -> Source (Fx a)
uiTortBy :: Double -> Double -> Source (Fx a)
uiTortBy Double
initTone Double
initDrive = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
tortColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Distort" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True [(String
"drive", Double
initDrive), (String
"tone", Double
initTone)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
drive, Balance
tone] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
tort Balance
drive Balance
tone
        fx [Balance]
_             = a -> m a
forall a. HasCallStack => a
undefined

uiTortBy_ :: Sigs a => Double -> Source (Fx a)
uiTortBy_ :: Double -> Source (Fx a)
uiTortBy_ = Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Source (Fx a)
uiTortBy Double
0.5

uiTort1, uiTort2, uiTort3, uiTort4, uiTort5 :: Sigs a => Source (Fx a)

uiTort1 :: Source (Fx a)
uiTort1 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortBy_ Double
forall a. Fractional a => a
size1
uiTort2 :: Source (Fx a)
uiTort2 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortBy_ Double
forall a. Fractional a => a
size2
uiTort3 :: Source (Fx a)
uiTort3 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortBy_ Double
forall a. Fractional a => a
size3
uiTort4 :: Source (Fx a)
uiTort4 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortBy_ Double
forall a. Fractional a => a
size4
uiTort5 :: Source (Fx a)
uiTort5 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortBy_ Double
forall a. Fractional a => a
size5

uiTortByB :: Sigs a => Double -> Source (Fx a)
uiTortByB :: Double -> Source (Fx a)
uiTortByB = Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Source (Fx a)
uiTortBy Double
0.85

uiTort1b, uiTort2b, uiTort3b, uiTort4b, uiTort5b :: Sigs a => Source (Fx a)

uiTort1b :: Source (Fx a)
uiTort1b = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByB Double
forall a. Fractional a => a
size1
uiTort2b :: Source (Fx a)
uiTort2b = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByB Double
forall a. Fractional a => a
size2
uiTort3b :: Source (Fx a)
uiTort3b = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByB Double
forall a. Fractional a => a
size3
uiTort4b :: Source (Fx a)
uiTort4b = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByB Double
forall a. Fractional a => a
size4
uiTort5b :: Source (Fx a)
uiTort5b = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByB Double
forall a. Fractional a => a
size5

uiTortByM :: Sigs a => Double -> Source (Fx a)
uiTortByM :: Double -> Source (Fx a)
uiTortByM = Double -> Double -> Source (Fx a)
forall a. Sigs a => Double -> Double -> Source (Fx a)
uiTortBy Double
0.2

uiTort1m, uiTort2m, uiTort3m, uiTort4m, uiTort5m :: Sigs a => Source (Fx a)

uiTort1m :: Source (Fx a)
uiTort1m = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByM Double
forall a. Fractional a => a
size1
uiTort2m :: Source (Fx a)
uiTort2m = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByM Double
forall a. Fractional a => a
size2
uiTort3m :: Source (Fx a)
uiTort3m = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByM Double
forall a. Fractional a => a
size3
uiTort4m :: Source (Fx a)
uiTort4m = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByM Double
forall a. Fractional a => a
size4
uiTort5m :: Source (Fx a)
uiTort5m = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTortByM Double
forall a. Fractional a => a
size5

-- Envelope follower

uiFowler' :: Sigs a => Source (Fx a)
uiFowler' :: Source (Fx a)
uiFowler' = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
fowlerColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Follower" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True [(String
"size", Double
forall a. Fractional a => a
size1)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
size] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
fowler' Balance
size
        fx [Balance]
_      = a -> m a
forall a. HasCallStack => a
undefined

uiFowlerBy :: Sigs a => Double -> Source (Fx a)
uiFowlerBy :: Double -> Source (Fx a)
uiFowlerBy Double
size = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
fowlerColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Follower" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True [(String
"sense", Double
size), (String
"freq", Double
size), (String
"reson", Double
size)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
sense, Balance
freq, Balance
resonance] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
fowler Balance
sense Balance
freq Balance
resonance
        fx [Balance]
_                        = a -> m a
forall a. HasCallStack => a
undefined

uiFowler1, uiFowler2, uiFowler3, uiFowler4, uiFowler5 :: Sigs a => Source (Fx a)

uiFowler1 :: Source (Fx a)
uiFowler1 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFowlerBy Double
forall a. Fractional a => a
size1
uiFowler2 :: Source (Fx a)
uiFowler2 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFowlerBy Double
forall a. Fractional a => a
size2
uiFowler3 :: Source (Fx a)
uiFowler3 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFowlerBy Double
forall a. Fractional a => a
size3
uiFowler4 :: Source (Fx a)
uiFowler4 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFowlerBy Double
forall a. Fractional a => a
size4
uiFowler5 :: Source (Fx a)
uiFowler5 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFowlerBy Double
forall a. Fractional a => a
size5

-- Flanger

uiFlan' :: Sigs a => Source (Fx a)
uiFlan' :: Source (Fx a)
uiFlan' = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
flanColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Flanger" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True [(String
"size", Double
forall a. Fractional a => a
size1)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
size] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
flan' Balance
size
        fx [Balance]
_      = a -> m a
forall a. HasCallStack => a
undefined

uiFlanBy :: Sigs a => Double -> Source (Fx a)
uiFlanBy :: Double -> Source (Fx a)
uiFlanBy Double
size = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
flanColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Flanger" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True ([(String, Double)] -> Source (Balance -> SE Balance))
-> [(String, Double)] -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ Double -> [String] -> [(String, Double)]
setAll Double
size [String
"rate", String
"depth", String
"del time", String
"fbk"]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
rate, Balance
depth, Balance
delayTime, Balance
fbk] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
flan Balance
rate Balance
depth Balance
delayTime Balance
fbk
        fx [Balance]
_                             = a -> m a
forall a. HasCallStack => a
undefined

uiFlan1, uiFlan2, uiFlan3, uiFlan4, uiFlan5 :: Sigs a => Source (Fx a)

uiFlan1 :: Source (Fx a)
uiFlan1 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFlanBy Double
forall a. Fractional a => a
size1
uiFlan2 :: Source (Fx a)
uiFlan2 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFlanBy Double
forall a. Fractional a => a
size2
uiFlan3 :: Source (Fx a)
uiFlan3 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFlanBy Double
forall a. Fractional a => a
size3
uiFlan4 :: Source (Fx a)
uiFlan4 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFlanBy Double
forall a. Fractional a => a
size4
uiFlan5 :: Source (Fx a)
uiFlan5 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiFlanBy Double
forall a. Fractional a => a
size5

-- Phaser

-- phasy :: RateSig -> DepthSig -> BaseCps -> Feedback -> Sig -> Sig

uiPhasy' :: Sigs a => Source (Fx a)
uiPhasy' :: Source (Fx a)
uiPhasy' = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
phasyColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Phaser" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx  Bool
True ([(String, Double)] -> Source (Balance -> SE Balance))
-> [(String, Double)] -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ [(String
"size", Double
forall a. Fractional a => a
size1)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
x] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
phasy' Balance
x
        fx [Balance]
_   = a -> m a
forall a. HasCallStack => a
undefined

uiPhasyBy :: Sigs a => Double -> Source (Fx a)
uiPhasyBy :: Double -> Source (Fx a)
uiPhasyBy Double
size = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
phasyColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Phaser" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True ([(String, Double)] -> Source (Balance -> SE Balance))
-> [(String, Double)] -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ Double -> [String] -> [(String, Double)]
setAll Double
size [String
"rate", String
"depth", String
"cps", String
"fbk"]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
rate, Balance
depth, Balance
cps, Balance
fbk] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> Balance -> a -> a
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
phasy Balance
rate Balance
depth Balance
cps Balance
fbk
        fx [Balance]
_                       = a -> m a
forall a. HasCallStack => a
undefined

uiPhasy1, uiPhasy2, uiPhasy3, uiPhasy4, uiPhasy5 :: Sigs a => Source (Fx a)

uiPhasy1 :: Source (Fx a)
uiPhasy1 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiPhasyBy Double
forall a. Fractional a => a
size1
uiPhasy2 :: Source (Fx a)
uiPhasy2 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiPhasyBy Double
forall a. Fractional a => a
size2
uiPhasy3 :: Source (Fx a)
uiPhasy3 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiPhasyBy Double
forall a. Fractional a => a
size3
uiPhasy4 :: Source (Fx a)
uiPhasy4 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiPhasyBy Double
forall a. Fractional a => a
size4
uiPhasy5 :: Source (Fx a)
uiPhasy5 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiPhasyBy Double
forall a. Fractional a => a
size5

-- Chorus

uiChory' :: Sig2s a => Source (Fx a)
uiChory' :: Source (Fx a)
uiChory' = String -> Source (Fx a) -> Source (Fx a)
forall a. String -> Source a -> Source a
paintTo String
choryColor (Source (Fx a) -> Source (Fx a)) -> Source (Fx a) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Chorus" [Balance] -> Fx a
forall (m :: * -> *) a. (Monad m, Sig2s a) => [Balance] -> a -> m a
fx Bool
True [(String
"size", Double
forall a. Fractional a => a
size1)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
size] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> a -> a
forall a. Sig2s a => Balance -> a -> a
chory' Balance
size
        fx [Balance]
_      = a -> m a
forall a. HasCallStack => a
undefined

uiChoryBy :: Sig2s a => Double -> Source (Fx a)
uiChoryBy :: Double -> Source (Fx a)
uiChoryBy Double
size = String -> Source (Fx a) -> Source (Fx a)
forall a. String -> Source a -> Source a
paintTo String
choryColor (Source (Fx a) -> Source (Fx a)) -> Source (Fx a) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Chorus" [Balance] -> Fx a
forall (m :: * -> *) a.
(Monad m, SigSpace2 a) =>
[Balance] -> a -> m a
fx Bool
True ([(String, Double)] -> Source (Fx a))
-> [(String, Double)] -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ Double -> [String] -> [(String, Double)]
setAll Double
size [String
"rate", String
"depth", String
"width"]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
rate, Balance
depth, Balance
width] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Sig2 -> Sig2) -> a -> a
forall a. SigSpace2 a => (Sig2 -> Sig2) -> a -> a
mapSig2 (Balance -> Balance -> Balance -> Sig2 -> Sig2
chory Balance
rate Balance
depth Balance
width)
        fx [Balance]
_                    = a -> m a
forall a. HasCallStack => a
undefined

uiChory1, uiChory2, uiChory3, uiChory4, uiChory5 :: Sig2s a => Source (Fx a)

uiChory1 :: Source (Fx a)
uiChory1 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChoryBy Double
forall a. Fractional a => a
size1
uiChory2 :: Source (Fx a)
uiChory2 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChoryBy Double
forall a. Fractional a => a
size2
uiChory3 :: Source (Fx a)
uiChory3 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChoryBy Double
forall a. Fractional a => a
size3
uiChory4 :: Source (Fx a)
uiChory4 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChoryBy Double
forall a. Fractional a => a
size4
uiChory5 :: Source (Fx a)
uiChory5 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChoryBy Double
forall a. Fractional a => a
size5

-- Auto Pan

-- pany :: TremWaveSig -> DepthSig -> RateSig -> Sig2 -> Sig2

genUiPany' :: (Sig -> Sig2 -> Sig2) -> Source Fx2
genUiPany' :: (Balance -> Sig2 -> Sig2) -> Source Fx2
genUiPany' Balance -> Sig2 -> Sig2
mkPany = String -> Source Fx2 -> Source Fx2
forall a. String -> Source a -> Source a
paintTo String
panyColor (Source Fx2 -> Source Fx2) -> Source Fx2 -> Source Fx2
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Fx2) -> Bool -> [(String, Double)] -> Source Fx2
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Pan" [Balance] -> Fx2
forall (m :: * -> *). Monad m => [Balance] -> Sig2 -> m Sig2
fx Bool
True [(String
"size", Double
forall a. Fractional a => a
size1)]
    where
        fx :: [Balance] -> Sig2 -> m Sig2
fx [Balance
size] = Sig2 -> m Sig2
forall (m :: * -> *) a. Monad m => a -> m a
return (Sig2 -> m Sig2) -> (Sig2 -> Sig2) -> Sig2 -> m Sig2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Sig2 -> Sig2
mkPany Balance
size
        fx [Balance]
_      = Sig2 -> m Sig2
forall a. HasCallStack => a
undefined

uiOscPany', uiTriPany', uiSqrPany' :: Source Fx2

uiOscPany' :: Source Fx2
uiOscPany' = (Balance -> Sig2 -> Sig2) -> Source Fx2
genUiPany' Balance -> Sig2 -> Sig2
forall a. Sig2s a => Balance -> a -> a
oscPany'
uiTriPany' :: Source Fx2
uiTriPany' = (Balance -> Sig2 -> Sig2) -> Source Fx2
genUiPany' Balance -> Sig2 -> Sig2
forall a. Sig2s a => Balance -> a -> a
triPany'
uiSqrPany' :: Source Fx2
uiSqrPany' = (Balance -> Sig2 -> Sig2) -> Source Fx2
genUiPany' Balance -> Sig2 -> Sig2
forall a. Sig2s a => Balance -> a -> a
sqrPany'

genUiPanyBy :: Sig -> Double -> Source Fx2
genUiPanyBy :: Balance -> Double -> Source Fx2
genUiPanyBy Balance
wave Double
size = String -> Source Fx2 -> Source Fx2
forall a. String -> Source a -> Source a
paintTo String
panyColor (Source Fx2 -> Source Fx2) -> Source Fx2 -> Source Fx2
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Fx2) -> Bool -> [(String, Double)] -> Source Fx2
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Pan" [Balance] -> Fx2
forall (m :: * -> *). Monad m => [Balance] -> Sig2 -> m Sig2
fx Bool
True ([(String, Double)] -> Source Fx2)
-> [(String, Double)] -> Source Fx2
forall a b. (a -> b) -> a -> b
$ Double -> [String] -> [(String, Double)]
setAll Double
size [String
"depth", String
"rate"]
    where
        fx :: [Balance] -> Sig2 -> m Sig2
fx [Balance
depth, Balance
rate] = Sig2 -> m Sig2
forall (m :: * -> *) a. Monad m => a -> m a
return (Sig2 -> m Sig2) -> (Sig2 -> Sig2) -> Sig2 -> m Sig2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> Sig2 -> Sig2
pany Balance
wave Balance
depth Balance
rate
        fx [Balance]
_             = Sig2 -> m Sig2
forall a. HasCallStack => a
undefined

uiOscPanyBy, uiTriPanyBy, uiSqrPanyBy :: Double -> Source Fx2

uiOscPanyBy :: Double -> Source Fx2
uiOscPanyBy = Balance -> Double -> Source Fx2
genUiPanyBy Balance
0
uiTriPanyBy :: Double -> Source Fx2
uiTriPanyBy = Balance -> Double -> Source Fx2
genUiPanyBy Balance
1
uiSqrPanyBy :: Double -> Source Fx2
uiSqrPanyBy = Balance -> Double -> Source Fx2
genUiPanyBy Balance
2

uiOscPany1, uiOscPany2, uiOscPany3, uiOscPany4, uiOscPany5,
    uiTriPany1, uiTriPany2, uiTriPany3, uiTriPany4, uiTriPany5,
    uiSqrPany1, uiSqrPany2, uiSqrPany3, uiSqrPany4, uiSqrPany5 :: Source Fx2

uiOscPany1 :: Source Fx2
uiOscPany1 = Double -> Source Fx2
uiOscPanyBy Double
forall a. Fractional a => a
size1
uiOscPany2 :: Source Fx2
uiOscPany2 = Double -> Source Fx2
uiOscPanyBy Double
forall a. Fractional a => a
size2
uiOscPany3 :: Source Fx2
uiOscPany3 = Double -> Source Fx2
uiOscPanyBy Double
forall a. Fractional a => a
size3
uiOscPany4 :: Source Fx2
uiOscPany4 = Double -> Source Fx2
uiOscPanyBy Double
forall a. Fractional a => a
size4
uiOscPany5 :: Source Fx2
uiOscPany5 = Double -> Source Fx2
uiOscPanyBy Double
forall a. Fractional a => a
size5

uiTriPany1 :: Source Fx2
uiTriPany1 = Double -> Source Fx2
uiTriPanyBy Double
forall a. Fractional a => a
size1
uiTriPany2 :: Source Fx2
uiTriPany2 = Double -> Source Fx2
uiTriPanyBy Double
forall a. Fractional a => a
size2
uiTriPany3 :: Source Fx2
uiTriPany3 = Double -> Source Fx2
uiTriPanyBy Double
forall a. Fractional a => a
size3
uiTriPany4 :: Source Fx2
uiTriPany4 = Double -> Source Fx2
uiTriPanyBy Double
forall a. Fractional a => a
size4
uiTriPany5 :: Source Fx2
uiTriPany5 = Double -> Source Fx2
uiTriPanyBy Double
forall a. Fractional a => a
size5

uiSqrPany1 :: Source Fx2
uiSqrPany1 = Double -> Source Fx2
uiSqrPanyBy Double
forall a. Fractional a => a
size1
uiSqrPany2 :: Source Fx2
uiSqrPany2 = Double -> Source Fx2
uiSqrPanyBy Double
forall a. Fractional a => a
size2
uiSqrPany3 :: Source Fx2
uiSqrPany3 = Double -> Source Fx2
uiSqrPanyBy Double
forall a. Fractional a => a
size3
uiSqrPany4 :: Source Fx2
uiSqrPany4 = Double -> Source Fx2
uiSqrPanyBy Double
forall a. Fractional a => a
size4
uiSqrPany5 :: Source Fx2
uiSqrPany5 = Double -> Source Fx2
uiSqrPanyBy Double
forall a. Fractional a => a
size5

-- Tremolo

genUiTremy' :: Sigs a => (Sig -> Sig -> Sig) -> Source (Fx a)
genUiTremy' :: (Balance -> Balance -> Balance) -> Source (Fx a)
genUiTremy' Balance -> Balance -> Balance
mkTremy = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
tremyColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Tremolo" [Balance] -> Balance -> SE Balance
forall (m :: * -> *). Monad m => [Balance] -> Balance -> m Balance
fx Bool
True [(String
"size", Double
forall a. Fractional a => a
size1)]
    where
        fx :: [Balance] -> Balance -> m Balance
fx [Balance
size] = Balance -> m Balance
forall (m :: * -> *) a. Monad m => a -> m a
return (Balance -> m Balance)
-> (Balance -> Balance) -> Balance -> m Balance
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance
mkTremy Balance
size
        fx [Balance]
_      = Balance -> m Balance
forall a. HasCallStack => a
undefined

uiOscTremy', uiTriTremy', uiSqrTremy' :: Sigs a => Source (Fx a)

uiOscTremy' :: Source (Fx a)
uiOscTremy' = (Balance -> Balance -> Balance) -> Source (Fx a)
forall a.
Sigs a =>
(Balance -> Balance -> Balance) -> Source (Fx a)
genUiTremy' Balance -> Balance -> Balance
forall a. Sigs a => Balance -> a -> a
oscTremy'
uiTriTremy' :: Source (Fx a)
uiTriTremy' = (Balance -> Balance -> Balance) -> Source (Fx a)
forall a.
Sigs a =>
(Balance -> Balance -> Balance) -> Source (Fx a)
genUiTremy' Balance -> Balance -> Balance
forall a. Sigs a => Balance -> a -> a
triTremy'
uiSqrTremy' :: Source (Fx a)
uiSqrTremy' = (Balance -> Balance -> Balance) -> Source (Fx a)
forall a.
Sigs a =>
(Balance -> Balance -> Balance) -> Source (Fx a)
genUiTremy' Balance -> Balance -> Balance
forall a. Sigs a => Balance -> a -> a
sqrTremy'

genUiTremyBy :: Sigs a => Sig -> Double -> Source (Fx a)
genUiTremyBy :: Balance -> Double -> Source (Fx a)
genUiTremyBy Balance
wave Double
size = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
tremyColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Tremolo" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True ([(String, Double)] -> Source (Balance -> SE Balance))
-> [(String, Double)] -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ Double -> [String] -> [(String, Double)]
setAll Double
size [String
"depth", String
"rate"]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
depth, Balance
rate] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
tremy Balance
wave Balance
depth Balance
rate
        fx [Balance]
_             = a -> m a
forall a. HasCallStack => a
undefined

uiOscTremyBy, uiTriTremyBy, uiSqrTremyBy :: Sigs a => Double -> Source (Fx a)

uiOscTremyBy :: Double -> Source (Fx a)
uiOscTremyBy = Balance -> Double -> Source (Fx a)
forall a. Sigs a => Balance -> Double -> Source (Fx a)
genUiTremyBy Balance
0
uiTriTremyBy :: Double -> Source (Fx a)
uiTriTremyBy = Balance -> Double -> Source (Fx a)
forall a. Sigs a => Balance -> Double -> Source (Fx a)
genUiTremyBy Balance
1
uiSqrTremyBy :: Double -> Source (Fx a)
uiSqrTremyBy = Balance -> Double -> Source (Fx a)
forall a. Sigs a => Balance -> Double -> Source (Fx a)
genUiTremyBy Balance
2

uiOscTremy1, uiOscTremy2, uiOscTremy3, uiOscTremy4, uiOscTremy5,
    uiTriTremy1, uiTriTremy2, uiTriTremy3, uiTriTremy4, uiTriTremy5,
    uiSqrTremy1, uiSqrTremy2, uiSqrTremy3, uiSqrTremy4, uiSqrTremy5 :: Sigs a => Source (Fx a)

uiOscTremy1 :: Source (Fx a)
uiOscTremy1 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiOscTremyBy Double
forall a. Fractional a => a
size1
uiOscTremy2 :: Source (Fx a)
uiOscTremy2 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiOscTremyBy Double
forall a. Fractional a => a
size2
uiOscTremy3 :: Source (Fx a)
uiOscTremy3 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiOscTremyBy Double
forall a. Fractional a => a
size3
uiOscTremy4 :: Source (Fx a)
uiOscTremy4 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiOscTremyBy Double
forall a. Fractional a => a
size4
uiOscTremy5 :: Source (Fx a)
uiOscTremy5 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiOscTremyBy Double
forall a. Fractional a => a
size5

uiTriTremy1 :: Source (Fx a)
uiTriTremy1 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTriTremyBy Double
forall a. Fractional a => a
size1
uiTriTremy2 :: Source (Fx a)
uiTriTremy2 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTriTremyBy Double
forall a. Fractional a => a
size2
uiTriTremy3 :: Source (Fx a)
uiTriTremy3 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTriTremyBy Double
forall a. Fractional a => a
size3
uiTriTremy4 :: Source (Fx a)
uiTriTremy4 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTriTremyBy Double
forall a. Fractional a => a
size4
uiTriTremy5 :: Source (Fx a)
uiTriTremy5 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiTriTremyBy Double
forall a. Fractional a => a
size5

uiSqrTremy1 :: Source (Fx a)
uiSqrTremy1 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiSqrTremyBy Double
forall a. Fractional a => a
size1
uiSqrTremy2 :: Source (Fx a)
uiSqrTremy2 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiSqrTremyBy Double
forall a. Fractional a => a
size2
uiSqrTremy3 :: Source (Fx a)
uiSqrTremy3 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiSqrTremyBy Double
forall a. Fractional a => a
size3
uiSqrTremy4 :: Source (Fx a)
uiSqrTremy4 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiSqrTremyBy Double
forall a. Fractional a => a
size4
uiSqrTremy5 :: Source (Fx a)
uiSqrTremy5 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiSqrTremyBy Double
forall a. Fractional a => a
size5

-- Ring modulation

uiRingo' :: Sigs a => Source (Fx a)
uiRingo' :: Source (Fx a)
uiRingo' = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
ringoColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Ringo" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True [(String
"size", Double
forall a. Fractional a => a
size1)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
size] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
ringo' Balance
size
        fx [Balance]
_      = a -> m a
forall a. HasCallStack => a
undefined

uiRingoBy :: Sigs a => Double -> Source (Fx a)
uiRingoBy :: Double -> Source (Fx a)
uiRingoBy Double
size = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
ringoColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Ring Mod" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True ([(String, Double)] -> Source (Balance -> SE Balance))
-> [(String, Double)] -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ Double -> [String] -> [(String, Double)]
setAll Double
size [String
"mix", String
"rate", String
"env mod"]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
balance, Balance
rate, Balance
envMod] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> Balance -> a -> a
ringo Balance
balance Balance
rate Balance
envMod
        fx [Balance]
_                       = a -> m a
forall a. HasCallStack => a
undefined

uiRingo1, uiRingo2, uiRingo3, uiRingo4, uiRingo5 :: Sigs a => Source (Fx a)

uiRingo1 :: Source (Fx a)
uiRingo1 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiRingoBy Double
forall a. Fractional a => a
size1
uiRingo2 :: Source (Fx a)
uiRingo2 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiRingoBy Double
forall a. Fractional a => a
size2
uiRingo3 :: Source (Fx a)
uiRingo3 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiRingoBy Double
forall a. Fractional a => a
size3
uiRingo4 :: Source (Fx a)
uiRingo4 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiRingoBy Double
forall a. Fractional a => a
size4
uiRingo5 :: Source (Fx a)
uiRingo5 = Double -> Source (Fx a)
forall a. Sigs a => Double -> Source (Fx a)
uiRingoBy Double
forall a. Fractional a => a
size5

-- Crusher

uiCrusher :: Sigs a => Double -> Double -> Source (Fx a)
uiCrusher :: Double -> Double -> Source (Fx a)
uiCrusher Double
initReduction Double
initFoldover = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
crusherColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"LoFi" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True [(String
"redux", Double
initReduction), (String
"foldover", Double
initFoldover)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
redux, Balance
foldover] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> a -> a
forall a. Sigs a => Balance -> Balance -> a -> a
crusher Balance
redux Balance
foldover
        fx [Balance]
_                 = a -> m a
forall a. HasCallStack => a
undefined

-- Reverse

uiRevsy :: Sigs a => Double -> Source (Fx a)
uiRevsy :: Double -> Source (Fx a)
uiRevsy Double
initTime = ((Balance -> SE Balance) -> Fx a)
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> Source a -> Source b
mapSource (Balance -> SE Balance) -> Fx a
forall a. BindSig a => (Balance -> SE Balance) -> a -> SE a
bindSig (Source (Balance -> SE Balance) -> Source (Fx a))
-> Source (Balance -> SE Balance) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
revsyColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Reverse" [Balance] -> Balance -> SE Balance
forall (m :: * -> *) a. (Monad m, Sigs a) => [Balance] -> a -> m a
fx Bool
True [(String
"time", Double
initTime)]
    where
        fx :: [Balance] -> a -> m a
fx [Balance
time] = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> m a) -> (a -> a) -> a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> a -> a
forall a. Sigs a => Balance -> a -> a
revsy Balance
time
        fx [Balance]
_      = a -> m a
forall a. HasCallStack => a
undefined

------------------------------------------------------------
-- Reverbs

uiRevBy :: Sig2s a => Double -> Double -> Source (Fx a)
uiRevBy :: Double -> Double -> Source (Fx a)
uiRevBy Double
initFeedback Double
initMix = String -> Source (Fx a) -> Source (Fx a)
forall a. String -> Source a -> Source a
paintTo String
reverbColor (Source (Fx a) -> Source (Fx a)) -> Source (Fx a) -> Source (Fx a)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Reverb" [Balance] -> Fx a
fx Bool
True [(String
"mix", Double
initMix), (String
"fbk", Double
initFeedback)]
    where
        fx :: [Balance] -> Fx a
fx = \case
          [Balance
balance, Balance
feedback] -> \a
asig -> Fx a
forall (m :: * -> *) a. Monad m => a -> m a
return Fx a -> Fx a
forall a b. (a -> b) -> a -> b
$ (Sig2 -> Sig2) -> a -> a
forall a. SigSpace2 a => (Sig2 -> Sig2) -> a -> a
mapSig2 (\Sig2
x -> Balance -> Sig2 -> Sig2
forall a. SigSpace a => Balance -> a -> a
mul (Balance
1 Balance -> Balance -> Balance
forall a. Num a => a -> a -> a
- Balance
balance) Sig2
x Sig2 -> Sig2 -> Sig2
forall a. Num a => a -> a -> a
+ Balance -> Sig2 -> Sig2
forall a. SigSpace a => Balance -> a -> a
mul Balance
balance (Balance -> Sig2 -> Sig2
rever2 Balance
feedback Sig2
x)) a
asig
          [Balance]
_                   -> Fx a
forall a. HasCallStack => a
undefined

uiRoom :: Sig2s a => Double -> Source (Fx a)
uiRoom :: Double -> Source (Fx a)
uiRoom = Double -> Double -> Source (Fx a)
forall a. Sig2s a => Double -> Double -> Source (Fx a)
uiRevBy Double
0.6

uiRoom1, uiRoom2, uiRoom3, uiRoom4, uiRoom5 :: Sig2s a => Source (Fx a)

uiRoom1 :: Source (Fx a)
uiRoom1 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiRoom Double
forall a. Fractional a => a
size1
uiRoom2 :: Source (Fx a)
uiRoom2 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiRoom Double
forall a. Fractional a => a
size2
uiRoom3 :: Source (Fx a)
uiRoom3 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiRoom Double
forall a. Fractional a => a
size3
uiRoom4 :: Source (Fx a)
uiRoom4 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiRoom Double
forall a. Fractional a => a
size4
uiRoom5 :: Source (Fx a)
uiRoom5 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiRoom Double
forall a. Fractional a => a
size5

uiChamber :: Sig2s a => Double -> Source (Fx a)
uiChamber :: Double -> Source (Fx a)
uiChamber = Double -> Double -> Source (Fx a)
forall a. Sig2s a => Double -> Double -> Source (Fx a)
uiRevBy Double
0.8

uiChamber1, uiChamber2, uiChamber3, uiChamber4, uiChamber5 :: Sig2s a => Source (Fx a)

uiChamber1 :: Source (Fx a)
uiChamber1 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChamber Double
forall a. Fractional a => a
size1
uiChamber2 :: Source (Fx a)
uiChamber2 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChamber Double
forall a. Fractional a => a
size2
uiChamber3 :: Source (Fx a)
uiChamber3 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChamber Double
forall a. Fractional a => a
size3
uiChamber4 :: Source (Fx a)
uiChamber4 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChamber Double
forall a. Fractional a => a
size4
uiChamber5 :: Source (Fx a)
uiChamber5 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiChamber Double
forall a. Fractional a => a
size5

uiHall :: Sig2s a => Double -> Source (Fx a)
uiHall :: Double -> Source (Fx a)
uiHall = Double -> Double -> Source (Fx a)
forall a. Sig2s a => Double -> Double -> Source (Fx a)
uiRevBy Double
0.9

uiHall1, uiHall2, uiHall3, uiHall4, uiHall5 :: Sig2s a => Source (Fx a)

uiHall1 :: Source (Fx a)
uiHall1 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiHall Double
forall a. Fractional a => a
size1
uiHall2 :: Source (Fx a)
uiHall2 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiHall Double
forall a. Fractional a => a
size2
uiHall3 :: Source (Fx a)
uiHall3 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiHall Double
forall a. Fractional a => a
size3
uiHall4 :: Source (Fx a)
uiHall4 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiHall Double
forall a. Fractional a => a
size4
uiHall5 :: Source (Fx a)
uiHall5 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiHall Double
forall a. Fractional a => a
size5

uiCave :: Sig2s a => Double -> Source (Fx a)
uiCave :: Double -> Source (Fx a)
uiCave = Double -> Double -> Source (Fx a)
forall a. Sig2s a => Double -> Double -> Source (Fx a)
uiRevBy Double
0.99

uiCave1, uiCave2, uiCave3, uiCave4, uiCave5 :: Sig2s a => Source (Fx a)

uiCave1 :: Source (Fx a)
uiCave1 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiCave Double
forall a. Fractional a => a
size1
uiCave2 :: Source (Fx a)
uiCave2 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiCave Double
forall a. Fractional a => a
size2
uiCave3 :: Source (Fx a)
uiCave3 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiCave Double
forall a. Fractional a => a
size3
uiCave4 :: Source (Fx a)
uiCave4 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiCave Double
forall a. Fractional a => a
size4
uiCave5 :: Source (Fx a)
uiCave5 = Double -> Source (Fx a)
forall a. Sig2s a => Double -> Source (Fx a)
uiCave Double
forall a. Fractional a => a
size5

------------------------------------------------------------
-- Mono Reverbs

rever1 :: Sig -> Sig -> Sig
rever1 :: Balance -> Balance -> Balance
rever1 Balance
fbk = Sig2 -> Balance
toMono (Sig2 -> Balance) -> (Balance -> Sig2) -> Balance -> Balance
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Sig2 -> Sig2
rever2 Balance
fbk (Sig2 -> Sig2) -> (Balance -> Sig2) -> Balance -> Sig2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Sig2
fromMono

uiMonoRevBy :: Double -> Double -> Source Fx1
uiMonoRevBy :: Double -> Double -> Source (Balance -> SE Balance)
uiMonoRevBy Double
initFeedback Double
initMix = String
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a. String -> Source a -> Source a
paintTo String
reverbColor (Source (Balance -> SE Balance) -> Source (Balance -> SE Balance))
-> Source (Balance -> SE Balance) -> Source (Balance -> SE Balance)
forall a b. (a -> b) -> a -> b
$ String
-> ([Balance] -> Balance -> SE Balance)
-> Bool
-> [(String, Double)]
-> Source (Balance -> SE Balance)
forall a.
Sigs a =>
String
-> ([Balance] -> Fx a)
-> Bool
-> [(String, Double)]
-> Source (Fx a)
fxBox String
"Reverb" [Balance] -> Balance -> SE Balance
fx Bool
True [(String
"mix", Double
initMix), (String
"fbk", Double
initFeedback)]
    where
        fx :: [Balance] -> Balance -> SE Balance
fx = \case
          [Balance
balance, Balance
feedback] -> \Balance
asig -> Balance -> SE Balance
forall (m :: * -> *) a. Monad m => a -> m a
return (Balance -> SE Balance) -> Balance -> SE Balance
forall a b. (a -> b) -> a -> b
$ Balance
-> (Balance -> Balance) -> Balance -> AtOut Balance Balance Balance
forall a b c.
MixAt a b c =>
Balance -> (a -> b) -> c -> AtOut a b c
mixAt Balance
balance (Balance -> Balance -> Balance
rever1 Balance
feedback) Balance
asig
          [Balance]
_                   -> Balance -> SE Balance
forall a. HasCallStack => a
undefined

uiMonoRoom :: Double -> Source Fx1
uiMonoRoom :: Double -> Source (Balance -> SE Balance)
uiMonoRoom = Double -> Double -> Source (Balance -> SE Balance)
uiMonoRevBy Double
0.6

uiRoom1m, uiRoom2m, uiRoom3m, uiRoom4m, uiRoom5m :: Source Fx1

uiRoom1m :: Source (Balance -> SE Balance)
uiRoom1m = Double -> Source (Balance -> SE Balance)
uiMonoRoom Double
forall a. Fractional a => a
size1
uiRoom2m :: Source (Balance -> SE Balance)
uiRoom2m = Double -> Source (Balance -> SE Balance)
uiMonoRoom Double
forall a. Fractional a => a
size2
uiRoom3m :: Source (Balance -> SE Balance)
uiRoom3m = Double -> Source (Balance -> SE Balance)
uiMonoRoom Double
forall a. Fractional a => a
size3
uiRoom4m :: Source (Balance -> SE Balance)
uiRoom4m = Double -> Source (Balance -> SE Balance)
uiMonoRoom Double
forall a. Fractional a => a
size4
uiRoom5m :: Source (Balance -> SE Balance)
uiRoom5m = Double -> Source (Balance -> SE Balance)
uiMonoRoom Double
forall a. Fractional a => a
size5

uiMonoChamber :: Double -> Source Fx1
uiMonoChamber :: Double -> Source (Balance -> SE Balance)
uiMonoChamber = Double -> Double -> Source (Balance -> SE Balance)
uiMonoRevBy Double
0.8

uiChamber1m, uiChamber2m, uiChamber3m, uiChamber4m, uiChamber5m :: Source Fx1

uiChamber1m :: Source (Balance -> SE Balance)
uiChamber1m = Double -> Source (Balance -> SE Balance)
uiMonoChamber Double
forall a. Fractional a => a
size1
uiChamber2m :: Source (Balance -> SE Balance)
uiChamber2m = Double -> Source (Balance -> SE Balance)
uiMonoChamber Double
forall a. Fractional a => a
size2
uiChamber3m :: Source (Balance -> SE Balance)
uiChamber3m = Double -> Source (Balance -> SE Balance)
uiMonoChamber Double
forall a. Fractional a => a
size3
uiChamber4m :: Source (Balance -> SE Balance)
uiChamber4m = Double -> Source (Balance -> SE Balance)
uiMonoChamber Double
forall a. Fractional a => a
size4
uiChamber5m :: Source (Balance -> SE Balance)
uiChamber5m = Double -> Source (Balance -> SE Balance)
uiMonoChamber Double
forall a. Fractional a => a
size5

uiMonoHall :: Double -> Source Fx1
uiMonoHall :: Double -> Source (Balance -> SE Balance)
uiMonoHall = Double -> Double -> Source (Balance -> SE Balance)
uiMonoRevBy Double
0.9

uiHall1m, uiHall2m, uiHall3m, uiHall4m, uiHall5m :: Source Fx1

uiHall1m :: Source (Balance -> SE Balance)
uiHall1m = Double -> Source (Balance -> SE Balance)
uiMonoHall Double
forall a. Fractional a => a
size1
uiHall2m :: Source (Balance -> SE Balance)
uiHall2m = Double -> Source (Balance -> SE Balance)
uiMonoHall Double
forall a. Fractional a => a
size2
uiHall3m :: Source (Balance -> SE Balance)
uiHall3m = Double -> Source (Balance -> SE Balance)
uiMonoHall Double
forall a. Fractional a => a
size3
uiHall4m :: Source (Balance -> SE Balance)
uiHall4m = Double -> Source (Balance -> SE Balance)
uiMonoHall Double
forall a. Fractional a => a
size4
uiHall5m :: Source (Balance -> SE Balance)
uiHall5m = Double -> Source (Balance -> SE Balance)
uiMonoHall Double
forall a. Fractional a => a
size5

uiMonoCave :: Double -> Source Fx1
uiMonoCave :: Double -> Source (Balance -> SE Balance)
uiMonoCave = Double -> Double -> Source (Balance -> SE Balance)
uiMonoRevBy Double
0.99

uiCave1m, uiCave2m, uiCave3m, uiCave4m, uiCave5m :: Source Fx1

uiCave1m :: Source (Balance -> SE Balance)
uiCave1m = Double -> Source (Balance -> SE Balance)
uiMonoCave Double
forall a. Fractional a => a
size1
uiCave2m :: Source (Balance -> SE Balance)
uiCave2m = Double -> Source (Balance -> SE Balance)
uiMonoCave Double
forall a. Fractional a => a
size2
uiCave3m :: Source (Balance -> SE Balance)
uiCave3m = Double -> Source (Balance -> SE Balance)
uiMonoCave Double
forall a. Fractional a => a
size3
uiCave4m :: Source (Balance -> SE Balance)
uiCave4m = Double -> Source (Balance -> SE Balance)
uiMonoCave Double
forall a. Fractional a => a
size4
uiCave5m :: Source (Balance -> SE Balance)
uiCave5m = Double -> Source (Balance -> SE Balance)
uiMonoCave Double
forall a. Fractional a => a
size5

type ThreshSig = Sig

-------------------------------------
-- ambient guitar

-- | Ambient guitar patch. It uses @ambiEnv@ with stack of delays and a bit of compression and distortion.
-- No reverb is added. The reverb is for user to add.
--
-- > ambiGuitar thresh delayTime feedback tone driveLevel sig
--
-- For thresh try out values like 0.01, 0.02
--
-- Example, we read guitar input from soundcard first input,
-- apply ambient guitar effect and a bit of reverb:
--
-- > main = dac proc
-- >
-- > proc :: Sig2 -> SE Sig2
-- > proc (x, _) = hall 0.25 $ ambiGuitar 0.02 1 0.7 0.4 0.1 x
ambiGuitar :: ThreshSig -> DelayTime -> Feedback -> ToneSig -> DriveSig -> Sig -> SE Sig
ambiGuitar :: Balance
-> Balance
-> Balance
-> Balance
-> Balance
-> Balance
-> SE Balance
ambiGuitar Balance
thresh Balance
dt Balance
fbk Balance
toneSig Balance
drv Balance
ain = do
    Balance
envSig <- Balance -> Balance -> SE Balance
ambiEnv Balance
thresh Balance
ain
    Balance -> SE Balance
forall (m :: * -> *) a. Monad m => a -> m a
return (Balance -> SE Balance) -> Balance -> SE Balance
forall a b. (a -> b) -> a -> b
$ ( Balance -> Balance -> Balance -> Balance -> Balance -> Balance
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
adele Balance
0.35 Balance
dt Balance
fbk Balance
toneSig (Balance -> Balance) -> (Balance -> Balance) -> Balance -> Balance
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> Balance -> Balance -> Balance
forall a.
Sigs a =>
Balance -> Balance -> Balance -> Balance -> a -> a
adele Balance
0.5 (Balance
dt Balance -> Balance -> Balance
forall a. Fractional a => a -> a -> a
/ Balance
4) (Balance
fbk Balance -> Balance -> Balance
forall a. Num a => a -> a -> a
* Balance
1.25) Balance
toneSig (Balance -> Balance) -> (Balance -> Balance) -> Balance -> Balance
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
              Balance -> Balance -> Balance
saturator Balance
0.3  (Balance -> Balance) -> (Balance -> Balance) -> Balance -> Balance
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Balance -> Balance -> Balance -> Balance
forall a. Sigs a => Balance -> Balance -> a -> a
tort Balance
drv Balance
0.25) Balance
envSig