Skip to content

Instantly share code, notes, and snippets.

@kindohm
kindohm / readme.md
Last active September 27, 2017 02:11
new tidal install instructions draft

You can install TidalCycles on MacOS, Windows, and Linux. Locate the instructions below for your specific operating system.

Mac OS

1. Prerequisites

@kindohm
kindohm / banks.hs
Last active September 15, 2017 13:21
Tidal Sample Bank Approach
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")
do
let iters = 400
sample = "rain1z"
d1 $ (now) ~> do {
x <- slow (iters) $ run iters;
jux (((x/iters) ~>) . (# speed "1.005")) $ sound sample}
@kindohm
kindohm / _readme.md
Last active August 30, 2017 20:16
d-code info

d-code info

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.

sample composition strategy

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:

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"
@kindohm
kindohm / msys-choco-install-output.txt
Created July 7, 2017 14:12
cinst msys2 --verbose
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]
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
@kindohm
kindohm / tidal-vis-call-edges.hs
Created June 29, 2017 14:45
tidal-vis and calls .pl file
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"]
@kindohm
kindohm / tidal-vis-edges.pl
Created June 29, 2017 14:18
removes line borders in tidal-vis outputs
#!/usr/bin/perl -w
use strict;
my $fn = $ARGV[0];
open(my $svgfh, "<$fn")
or die "couldn't open $fn: $!";
my $svg;
{
local $/;
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)