Skip to content

Instantly share code, notes, and snippets.

@jarmitage
jarmitage / Stream.hs
Last active December 26, 2017 23:38
Turning a TidalCycles pattern into JSON
-- Added to https://github.com/tidalcycles/Tidal/blob/1d05c6119aba8c7547bbf1512ce1f901e38e1d6c/Sound/Tidal/Stream.hs
import qualified Data.Aeson as A
-- ...
instance A.ToJSON Value where
toJSON (VS s) = A.toJSON s
toJSON (VF d) = A.toJSON d
toJSON (VI i) = A.toJSON i
@jarmitage
jarmitage / install_fonts.sh
Created November 24, 2018 19:04
Homebrew cask fonts: install all fonts not found
while read p; do
f="${p//font-/}*"
f="${f//-}"
# echo "$f"
if [[ -z `find /Users/xxx/Library/Fonts -iname "$f"` ]]; then
echo "not found: $f"
brew cask install "$p"
else
echo "found: $f"
fi
@jarmitage
jarmitage / bela-image-builder_notes.md
Last active May 22, 2020 21:12
Building a Bela image using VirtualBox and Ubuntu
@jarmitage
jarmitage / .bashrc (bela)
Last active November 15, 2022 14:44
Using the `distcc` distributed compiler with Bela
#!/bin/bash
alias watchdistcc="watch -n 0.4 rm -rf \"~/.distcc/lock/*\""
@jarmitage
jarmitage / tidal-hydra.js
Last active May 26, 2023 07:04
Drawing Tidal sounds in Atom-Hydra
// see tidal example: https://github.com/ojack/hydra-examples
p1.remove()
p1 = new P5()
p1.pixelDensity(1)
msg.setPort(3333)
tidalHistory = 128
tidal = []
sounds = {'s':[], 'c':[]}
@jarmitage
jarmitage / init-1.0.0.hs
Created December 24, 2018 22:30
tidal goodies ported to 1.0.x
module Init where
-- import Sound.Tidal.SpectralTricks
-- import qualified Sound.Tidal.Scales as Scales
-- import qualified Sound.Tidal.Chords as Chords
import Sound.Tidal.Utils
@jarmitage
jarmitage / init1.0.hs
Created January 29, 2019 20:48
Tidal init 1.0 (WIP!)
module Init where
-- import Sound.Tidal.SpectralTricks
-- import qualified Sound.Tidal.Scales as Scales
-- import qualified Sound.Tidal.Chords as Chords
import Sound.Tidal.Utils
@jarmitage
jarmitage / suf.tidal
Created February 5, 2019 23:45
N-Trance - Set You Free in TidalCycles code
do -- suf
bps (140/120)
t1 (j 0) . m . sl 4
-- . fE [3,4] (jux rev) . fE [2,5] (iter 4 . fa 3 . degBy 0.5)
-- . rarely ((> sustain "0.2") . fa 2 . degBy 0.9)
$ stack [
n (fmap (+12) $
-- almostNever (oa (3/8) 19) $ rarely (fmap (subtract 12)) $
"[-4 0 3]*2 [-5 -2 3]*2 [-7 -4 0]*2 [[-7 -4 0] [-7 1 -4]]") > s "superpiano"
,n ("[-4, -16] [-9, -21] [-7, -19] [~ [-11, -23]]")
@jarmitage
jarmitage / bey.tidal
Created February 6, 2019 00:04
Beyonce - Party in TidalCycles code
do -- bey
bps (83/120)
t1 (j 0) . m
$ stack [
-- rarely (brak . fa 2) $
s "[pcmbd:5 [~ pcmbd:5] ~ ~ ]" > end "0.3" > sp "0.9" > go "0.9:0"
,-- almostNever ((> sp "2") . fa 8 . (> pan rand)) . rarely (brak . fa 2) $
s "[[~ pcmsn:17]*2]"-- [~ ~ ~ [~ pcsn:17*4?]]]"
> rvb "0.1:0.1" > go "1:2"
,--almostNever (str 8 . chop 4 . (> pan rand)) $
@jarmitage
jarmitage / essentia_macos_anaconda.md
Created February 26, 2019 15:29
How to install Essentia on macOS using an Anaconda environment

How to install Essentia on macOS using an Anaconda environment

[This is a brief note so I don't forget how to do this, and will probably be technically obsolete before long!]

Essentia is an "Open-source library and tools for audio and music analysis, description and synthesis" (https://essentia.upf.edu)

If you use Jupyter Lab / notebooks and therefore manage your Python environments using Anaconda, AND your machine is macOS, you will not be able to install Essentia out of the box. This is because:

  • pip install essentia is currently Linux only