gists/looptober-25.hs
2023-10-25 13:38:50 +02:00

52 lines
1.8 KiB
Haskell

-- sets the amount of operator 'op' in the superfm output mix
-- (1 <= op <= 6)
fmamp :: Int -> Pattern Double -> ControlPattern
fmamp op = pF ("amp" ++ show op)
-- sets the ratio for operator 'op'.
-- the frequency is note * ratio + detune Hz
-- (1 <= op <= 6)
fmratio :: Int -> Pattern Double -> ControlPattern
fmratio op = pF ("ratio" ++ show op)
-- set the detune for operator 'op'
fmdetune :: Int -> Pattern Double -> ControlPattern
fmdetune op = pF ("detune" ++ show op)
-- set the modulation of oerator opa by operator opb
-- if opa == opb, then the modulation amount is multiplied by the
-- 'feedback' parameter
fmmod :: Int -> Int -> Pattern Double -> ControlPattern
fmmod opa opb = pF ("mod" ++ show opa ++ show opb)
-- feedback
fmfeedback :: Pattern Double -> ControlPattern
fmfeedback = pF "feedback"
-- Envelope definition: each operator has an envelop with 4 steps
fmeglevel :: Int -> Int -> Pattern Double -> ControlPattern
fmeglevel op step = pF ("eglevel" ++ show op ++ show step)
-- Envelope definition: sets the rate at which the envelope moves
-- between steps. Low numbers are slow, high numbers are fast.
fmegrate :: Int -> Int -> Pattern Double -> ControlPattern
fmegrate op step = pF ("egrate" ++ show op ++ show step)
do
resetCycles
d1 $ sometimes (# fmmod 1 2 saw)
$ sometimesBy "<0.0625 0.125 0.25>" ((1/8) ~>)
$ n "d!4"
# s "superfm"
# fmamp 1 1
# fmdetune 1 (slow 2 sine * 1.4)
# pan (range (1/4) (3/4) $ slow 2 sine)
# amp 0.15
d2 $ stack [
s "akailinnbd*4"
, sometimes (while "f!2 t f" $ ply 4) $ s "akailinnsd*2"
, s "rolandtr909lt/2"
]
d3 $ slow 2 $ s "supernoise" # n "d4" # amp "<0 0.05 0>" # voice "<0!2 1 0>"
d4 $ s "[~ cpluck]*4" # lpf (range 300 450 $ slow 4 saw) # hpf 150
d5 $ s "<~!2 [~ cpluck:6*4] ~>" # up "d6"