You can install TidalCycles on MacOS, Windows, and Linux. Locate the instructions below for your specific operating system.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let sprefix p = with s_p (liftA2 (++) (p::Pattern String)) | |
d1 $ sprefix "track1 track2" $ s "bd sn*2" | |
d1 $ s (fmap ("track1"++) "bd sn" ) | |
d1 $ s (flip (++) <$> "bd sn*2" <*> "track1 track2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
let iters = 400 | |
sample = "rain1z" | |
d1 $ (now) ~> do { | |
x <- slow (iters) $ run iters; | |
jux (((x/iters) ~>) . (# speed "1.005")) $ sound sample} |
https://soundcloud.com/kindohm/d-code
This is a de-construction of the above linked track and how it was composed and built with TidalCycles.
The real crux of this track and how it is composed in code depends on kick/snare pairs, located in the name
sample folder. This is really the important part. You have to know how that folder is structured before digging into the code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let _stut' n t f p = unwrap $ (\a b -> stut' a b f p) <$> n <*> t | |
durPattern p = Pattern $ \a -> map eventLengthEvent $ arc p a | |
where eventLengthEvent (a1@(s1,e1), a2, x) = (a1, a2, e1-s1) | |
stutx n t f p = _stut' (liftA2 min n (fmap floor $ durPattern p / (t+0.001))) t f p | |
cps 2 | |
d1 $ stutx "32 32" "0.1 0.1" (|*| gain "0.95") $ sound "k cp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Mike.Hodnick | |
λ cinst msys2 --verbose | |
Chocolatey v0.10.7 | |
Installing the following packages: | |
msys2 | |
By installing you accept licenses for the packages. | |
[NuGet] Installing 'msys2 20160719.1.1'. | |
[NuGet] Successfully installed 'msys2 20160719.1.1'. | |
msys2 v20160719.1.1 [Approved] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Sound.Tidal.Vis | |
import qualified Graphics.Rendering.Cairo as C | |
import Data.Colour | |
import Data.Colour.Names | |
import Data.Colour.SRGB | |
import System.Cmd | |
-- 1.640625 ratio | |
-- 2400 / 1462 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Sound.Tidal.Vis | |
import qualified Graphics.Rendering.Cairo as C | |
import Data.Colour | |
import Data.Colour.Names | |
import Data.Colour.SRGB | |
import System.Cmd | |
let vis name pat = do vLines (C.withSVGSurface) (name ++ ".svg") (600,50) pat 1 1 | |
rawSystem "/home/alex/Dropbox/bin/fixsvg.pl" [name ++ ".svg"] | |
rawSystem "convert" [name ++ ".svg", name ++ ".pdf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
my $fn = $ARGV[0]; | |
open(my $svgfh, "<$fn") | |
or die "couldn't open $fn: $!"; | |
my $svg; | |
{ | |
local $/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bps (140/120) | |
do | |
let chord1 = "[0,2,-2]" | |
chord2 = "[0,-2,-4,-7]" | |
pat = "{1 1*2 ~ 1 ~ [~ 1] ~ ~ 1*2 1*2 ~ ~ 1*4 ~}%8" | |
tmod p = whenmod 13 10 (iter 8) $ foldEvery [5,7,9] (slow (4/3)) $ foldEvery [3,4] (0.25 <~) $ p | |
stab $ rarely (stut' 1 (0.125*3) (|+| note "12")) $ | |
tmod $ every 5 (degrade) $ whenmod 8 4 (|+| n "-2") $ gain pat # note chord2 # dur "0.4" | |
|=| x (slow 3 tri1) |