Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ejconlon committed Feb 17, 2024
1 parent e6ea238 commit 975c4aa
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 135 deletions.
1 change: 1 addition & 0 deletions BootDirt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Data.Ratio ((%))
import Data.Sequence (Seq)
import Data.Sequence qualified as Seq
import Minipat.Dirt.Boot
import Minipat.Dirt.Params
import Minipat.Dirt.Prelude

dirtInst <- initialize
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,33 @@ A mini pattern language for music, like Tidal
* `squiz`
* `range`


Even more combinators to implement:

```
-- seqP :: Seq (CycleTime, CycleTime, Stream a) -> Stream a
-- seqPLoop :: Seq (CycleTime, CycleTime, Stream a) -> Stream a
-- rotL, rotR
-- rev
-- swingBy
-- swing
-- cat
-- fast
-- fastBy
-- slowBy
-- slow
-- echo
-- off
-- cat
-- fastCat
-- timeCat
-- randCat
-- wrandCat
-- append
-- fastAppend
-- slowAppend
-- wedge
-- fromList
-- fastFromList
-- slowFromList
```
1 change: 1 addition & 0 deletions minipat-dirt/minipat-dirt.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ library
Minipat.Dirt.Logger
Minipat.Dirt.Notes
Minipat.Dirt.Osc
Minipat.Dirt.Params
Minipat.Dirt.Prelude
Minipat.Dirt.Resources
Minipat.Dirt.Test
Expand Down
117 changes: 117 additions & 0 deletions minipat-dirt/src/Minipat/Dirt/Params.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{-# LANGUAGE OverloadedStrings #-}

module Minipat.Dirt.Params where

import Data.Int (Int32)
import Data.Text (Text)
import Minipat.Dirt.Attrs (Attr (..))
import Minipat.EStream (EStream)

pF :: (Real a) => Text -> EStream a -> EStream (Attr Float)
pF k = fmap (Attr k . realToFrac)

pI :: (Integral a) => Text -> EStream a -> EStream (Attr Int32)
pI k = fmap (Attr k . fromIntegral)

accelerate
, attack
, bandf
, bandq
, cutoff
, delay
, delayfeedback
, delaytime
, distort
, djf
, dry
, hcutoff
, hold
, hresonance
, legato
, leslie
, lrate
, lsize
, pan
, phaserdepth
, phaserrate
, release
, resonance
, room
, size
, slide
, squiz
, sustain
, tremolodepth
, tremolorate
:: (Real a) => EStream a -> EStream (Attr Float)
accelerate = pF "accelerate"
attack = pF "attack"
bandf = pF "bandf"
bandq = pF "bandq"
cutoff = pF "cutoff"
delay = pF "delay"
delayfeedback = pF "delayfeedback"
delaytime = pF "delaytime"
distort = pF "distort"
djf = pF "djf"
dry = pF "dry"
hcutoff = pF "hcutoff"
hold = pF "hold"
hresonance = pF "hresonance"
legato = pF "legato"
leslie = pF "leslie"
lrate = pF "lrate"
lsize = pF "lsize"
pan = pF "pan"
phaserdepth = pF "phaserdepth"
phaserrate = pF "phaserrate"
release = pF "release"
resonance = pF "resonance"
room = pF "room"
size = pF "size"
slide = pF "slide"
squiz = pF "squiz"
sustain = pF "sustain"
tremolodepth = pF "tremolodepth"
tremolorate = pF "tremolorate"

-- Shorthand for those effect parameters
accel
, att
, bpf
, bpq
, delayfb
, delayt
, dist
, hpf
, hpq
, leg
, lpf
, lpq
, phasdp
, phasr
, rel
, res
, sz
, tremdp
, tremr
:: (Real a) => EStream a -> EStream (Attr Float)
att = attack
bpf = bandf
bpq = bandq
delayfb = delayfeedback
delayt = delaytime
dist = distort
hpf = hcutoff
hpq = hresonance
leg = legato
lpf = cutoff
lpq = resonance
phasdp = phaserdepth
phasr = phaserrate
rel = release
res = resonance
sz = size
tremdp = tremolodepth
tremr = tremolorate
accel = accelerate
Loading

0 comments on commit 975c4aa

Please sign in to comment.