super808

estuary saturday jams

off "1s" id


-- But sometimes I like to introduce repetition
-- for a few moments. The "iter" function is kind
-- of a quick way to do it, so I dedicated a
-- switch on my controller to enable it for me:
let useIter p = every (  cI 0 "89" ) (iter 8) $ p

-> Better thank someCyclesBy ?!


-- TEMPO ;O

let minTempo = (range 1 0.333 $ (cF 0 "88"))
    maxTempo = (range 1 1.25 $ (cF 0 "88"))
    discRange a b = (segment 1 $ range a b $ shrand 70000)
    cpsDisc min max = (|* cps (discRange min max))

-- then I add the "cpsDisc" function at the top:
d1
  $ cpsDisc minTempo maxTempo
  $ (|* gain 1.2)
  $ stack [
    -- pad
    bgOn $ slow 4 $ (|+ note (shiftBy 1100 $ choose [-36,-24,-12]))
      $ note (scale "ritusen" "{0 -1 1 -2 2}%1") # pad
    , useIter $ reduce
      $ stack [
        -- kick
        bdOn $ struct main $ bd # gain 0.8
        -- perc1
        , perc1On $ someCyclesBy 0.5 (superimpose (0.125 ~>)) $ (0.0625 ~>)
          $ struct main $ perc1
        -- perc2
        , perc2On $ someCyclesBy 0.5 (superimpose (0.125 ~>)) $ (0.125 ~>)
          $ struct main $ perc2
        -- cp
        , clapOn $ struct cpp $ cp
        -- ch
        , hatOn $ sometimesBy 0.08 (|+ midichan 1)
          $ struct chp $ ch
      ]
  ] # rytm # cps (170/240)



  cceuc8 c p = euclid (floor <$> (segment 1 $ range 1 8 $ cF 0 c)) 8 $ p
  -- euclid control?



-- TIDALLOOPER :FIRE:


-- Pre-Requirement
--
-- First you should execute the following tidal code:
--
linput = pI "linput"
lname = pS "lname"

-- Now you can use linput and lname as parameter.
-- How to use it
--
-- This basic operations which are explained below is shared by all looper modes. By default 8 buffers are created, and accessible under the name 'loop' (s) and a number from 0 .. 7 (n).
--
-- The simplest form for recording is

once $ s "looper" -- writes one cycle to the loop buffer and uses the input port 0 and the sample number 0

-- After recording you can listen back to the result with

d1 $ s "loop"

-- It is possible to set the length of the recording (this is equals to the length of the events) i.e

d1 $ slow 2 $ s "loop"

-- Use n to choose a specific buffer, i.e. n "2" is equal to "write to the second buffer under of the sample bank loop".

d1 $ s "looper" # n "<0 1 2 3 4 5 6 7>"

-- And each buffer is accessible with the n function

d2 $ s "loop" # n "[0,1,2,3,4,5,6,7]"

-- You can use each input port for recording. If you use i.e. Blackhole, than the output and input ports have the same results. This way you can write the orbit results (i.e. what came from d1) to a buffer.

d1 $ s "looper" # linput 16

-- You can specifiy the name of your loop sample bank

once $ s "looper" # lname "bubu"

d1 $ s "bubu"

-- To reset all loop buffers just evaluate

once $ s "freeLoops"

-- To persist all loop buffers of a specific buffer list just evaluate

once $ s "persistLoops" # lname "bubu"

-- Note 1: I prefer to use 'qtrigger 1' to ensure, that the recording starts from the beginning of the pattern. Maybe you want to use the looper with seqP, seqPLoop or wait.

-- Note 2: If you want to use more samples under one name, than adjust the numBuffers in the Looper.scd.


-- Replace mode

-- In replace mode, each time the recording pattern is called, the specified buffer is recreated and any existing buffer is cleared. The basic looper s $ "looper" is actually the "rlooper" (for replace looper) and just a synonym.

-- To continuously play back and record a loop, the code could looks like this

d1 $ qtrigger 1 $ stack [
    s "rlooper" # n "<0 1 2 3>",
    s "loop" # n "[0,1,2,3]",
    s "808 cp!3"
]

-- If you record a loop of cycle length 1 and play it back at the same time, you will never hear a result, because the buffer is immediately rewritten at each cycle.

-- Note: You can change the default looper mode by changing the variable pLevel in the Looper.scd.

--
-- Overdub mode
--

-- Loop overdub - A mode found in many looping devices where new material can be added on top of — overdubbed on — existing loop material. This allows you to layer additional parts into a loop to create a fuller sound or a more “layered” effect. (See sweetwater.com/insync/loop-overdub)

-- In overdub mode, each time the recording pattern is called, the specified buffer is kept and the incoming audio signal is mixed to the existing one. This means that no new buffer is created if a recording has already been made for that buffer. To use the looper in overdub mode you just need to use olooper (for overdub looper) instead of looper.
--
-- To continuously play back and record a loop, the code could looks like this
--

d1 $ qtrigger 1 $ stack [s "olooper",s "loop",s "808 cp!3"]

-- Note 1: The buffer length of a buffer is set when recording for the first time and cannot be changed afterwards (unless you clear the buffer with s "freeLoops") .

-- Note 2: In an older version the additional function playAll was needed to simulate an overdub mode. This is no longer necessary because a "real" overdub mode was implemented.
