thgrund / tidal-looper

Different looper variants for SuperDirt to provide live sampling in TidalCycles.
GNU General Public License v3.0
94 stars 2 forks source link

Provide README as a .tidal file #1

Open jarmitage opened 3 years ago

jarmitage commented 3 years ago

I just made this for myself and thought I would share it in case you want to include it

Great projects, thanks for sharing

-- ## 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 https://www.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.
thgrund commented 3 years ago

Thanks for sharing and the kind words!

If I look at it this way, it's a good idea to create a TidalCycles tutorial variant for the looper and tweak that a bit more. I will think about it in the next days.

jarmitage commented 3 years ago

Here's the classic in case you need inspiration https://github.com/tidalcycles/tidal-workshop/blob/master/workshop.tidal