Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# awesome information here:
# http://lodev.org/cgtutor/plasma.html
import time
import math
import random
def get_color(w, h, s=8):
@lvm
lvm / volcaBe.tidal
Created October 14, 2015 20:07
playing with tidal + tidal-midi + volca beats
cps 0.3
let ll t = (t <~)
let stcp = (|+| stt "[0.65 0.65 0.65 0.5]/4") . (|+| std "[0.1 0.1 0.666 0.1 0.1]/5")
b1 $ density 1.25 $ stack[
drum "bd(4,16)"
,
every 3 (|+| dhg "0.1") $ stack[
drum "[ch ! ! !] ! ! !"
@lvm
lvm / 2vbb.tidal
Last active December 23, 2015 21:57
cps 1
b1 $ every 2 (sometimes (within (0, 0.5) ((# std "0.9")))) $ foldEvery [3,5,7] (sometimes ((# stt "0"))) $ stack[
drum "[ch(1,3)] ! ! !"
|+| nudge (scale 0 0.5 sine1)
,
drum "[~ oh] !"
,
foldEvery [3,5] (sometimes (chop 2)) $ slowcat[
drum "[[cp cr] ~]"
@lvm
lvm / mistakes.tidal
Last active February 11, 2016 23:13
mistakes.tidal
-- Tidal: http://tidal.lurk.org/
-- Tidal-midi: https://github.com/tidalcycles/tidal-midi/
-- audio: https://soundcloud.com/xq0/mistakes-were-made
cps 1
let wf0 n = within(0, n)
sw' d h f = sometimes(within (d, h) f)
cho n pat chord = preplace(1,1) pat $ listToPat [ch + n | ch <- chord]
import System.Cmd
-- espeak: msg, voice, amp, pitch, speed
let espeak' m v a p s = system $ "espeak -v " ++ v ++ " -a " ++ a ++ " -p " ++ p ++ " -s " ++ s ++ " \"" ++ m ++ "\""
shespeak' m v a p s = system $ "espeak -v " ++ v ++ "+f1 -a " ++ a ++ " -p " ++ p ++ " -s " ++ s ++ " \"" ++ m ++ "\""
whisper' m v a p s = system $ "espeak -v " ++ v ++ "+whisper -a " ++ a ++ " -p " ++ p ++ " -s " ++ s ++ " \"" ++ m ++ "\""
croak' m v a p s = system $ "espeak -v " ++ v ++ "+croak -a " ++ a ++ " -p " ++ p ++ " -s " ++ s ++ " \"" ++ m ++ "\""
espeak m = espeak' m "en" "25" "50" "160"
shespeak m = shespeak' m "en" "25" "50" "160"
whisper m = whisper' m "en" "25" "50" "160"
@lvm
lvm / lazy-helpers.tidal
Last active March 23, 2016 18:19
Tidal lazy helpers
cps 1
-- for `espeak`
import System.Cmd
-- lazy helpers
let wf0 n = within(0, n)
sw f = sometimes(wf0 0.5 f)
sw' d h f = sometimes(within (d, h) f)
nm p = note $ toMIDI p
@lvm
lvm / tidal-fluidsynth.md
Last active February 23, 2016 05:35
tidal meets fluidsynth
note: this is a draft. there are a couple of screenshot missing.

After seeing that in OS X it's possible to use SimpleSynth, I got curious and wanted to know if the same was possibly in GNU/Linux, turns up: Yes, it's very possible; no more LMMS to play melodies (great piece of software but beats the purpose of coding music).
In a Debian based distro, the packages needed are:

  • qjackctl or patchage or aconnect (qjackctl and patchage are graphical tools but the three of them are good for the job)
  • vmpk
  • qsynth
  • fluidsynth
cps 0.8
import System.Cmd
-- lazy helpers
let wf0 n = within(0, n)
sw f = sometimes(wf0 0.5 f)
ch :: Int -> [Int] -> Pattern Int ; ch n chord = listToPat [ch + n | ch <- chord]
cho n pat chord = preplace(1,1) pat $ ch n chord
slowcho nlist pat chord = slowcat[note (cho n pat chord) | n <- nlist]
@lvm
lvm / i3conf
Last active February 14, 2021 04:18
~/.i3/config + ~/.i3status.conf
# font
font pango:Ubuntu Mono Regular 12
# settings
set $mod Mod4
set $ws workspace
set $laptop LVDS1
set $launcher dmenu_run -i -nb '#393939' -nf '#48B685' -sb '#dfefe2' -sf '#393939'
# colors
@lvm
lvm / Synthino.hs
Created June 24, 2016 13:56
synthino module for tidal-midi 0.8/0.9
module Sound.Tidal.MIDI.Synthino where
import Sound.Tidal.Params
import Sound.Tidal.MIDI.Control
keysController :: ControllerShape
keysController = ControllerShape { params = [
mCC attack_p 73,
mCC decay_p 75,
mCC sustain_p 79,