Skip to content

Instantly share code, notes, and snippets.

bps (170/120)
let one p = stut' 1 (0.125/2) (|*| gain "1") $ p
rep' n p = stut' (n-1) (0.125/2*3) (|*| gain "1") $ p
shift p = (1024 <~) p
shift' x p = (x <~) p
r1 $
whenmod 20 18 (foldEvery [2,3] (slow (4/3))) $
whenmod 16 13 (iter 8) $
@kindohm
kindohm / 04.hs
Created December 7, 2016 13:39
04.tidal
bps (220/120)
-- drums
r1 $ stack [
rep 6 $ midinote "0/2",
(0.25 <~) $ rep 8 $ midinote "3/3",
slow 2 $ (0.25 ~>) $ rep 11 $ midinote "1/4",
foldEvery [2,3,4] (0.25 ~>) $ midinote "2([5 3 7]/3,8)" ]
-- synth
@kindohm
kindohm / example.hs
Created December 9, 2016 18:55
do example
do
d1 $ sound "bd sn"
|=| speed (slow 3 sine1)
|=| pan (slow 5 saw1)
d2 $ sound "arpy*8?"
|=| shape (density 3 saw1)
@kindohm
kindohm / provider.js
Created February 10, 2017 14:15
pure javascript TextDocumentContentProvider for vscode
var vscode = require('vscode');
class PostWindowContentProvider {
constructor() {
this._onDidChange = new vscode.EventEmitter();
}
provideTextDocumentContent(uri) {
return 'Hi I am some content.';
}
get onDidChange() {
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)
@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 $/;
@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"]
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 / 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]
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"