Skip to content

Instantly share code, notes, and snippets.

View jarmitage's full-sized avatar

Jack Armitage jarmitage

View GitHub Profile
@jarmitage
jarmitage / functions.tidal
Created April 23, 2019 14:39
An idea for arranging a track in tidal
mutePatterns g = mapM (streamMute tidal) g
muteIntPatterns g = mutePatterns (map show g)
mutePatterns' s g = mutePatterns (fromJust $ lookup g s)
unmutePatterns g = mapM (streamUnmute tidal) g
unmuteIntPatterns g = unmutePatterns (map show g)
unmutePatterns' s g = unmutePatterns (fromJust $ lookup g s)
soloPatterns g = mapM (streamSolo tidal) g
soloPatterns' s g = soloPatterns (fromJust $ lookup g s)
unsoloPatterns g = mapM (streamUnsolo tidal) g
unsoloPatterns' s g = unsoloPatterns (fromJust $ lookup g s)
@jarmitage
jarmitage / cling_bela.md
Created April 11, 2019 17:42
Using the Cling C++ Interpreter on the Bela Platform
@jarmitage
jarmitage / 127_zpbb_2.0.tidal
Created March 23, 2019 04:12
127_zpbb_2.0.tidal
do -- zpbb3
bps (127/120)
d1 . m . sl 2 -- zp 1
. ev 4 (# hpf' "1e3 4e3 7e3" 0.3)
$ struct "t(3,8)!2" $ n ("0 1") # s "cutzpbb3"
+ sp "1 [1 0.5? 0.25?]" # rvb "0.1:0.1"
# gco "0.3:1:0" # hpf' 5e3 0.2
d2 . i . sl 8 -- zp 2
. juxBy 0.25 (rev) . iter 4 . str 4
. ev 4 (chop 2 . (# pan rand)) . ev 2 ((|+| sp "-2"))
@jarmitage
jarmitage / applescript_run.py
Last active September 24, 2021 03:34
Running AppleScripts from Python
import subprocess
def applescript_to_list (file, path="/my/default/path/"):
# open an applescript and return its contents as a list
applescript = open(path + file + ".applescript", "r")
lines = applescript.readlines()
applescript.close()
return lines
def applescript_list_to_string (script_list):
@jarmitage
jarmitage / multi-bela.md
Last active March 7, 2019 11:41
Using Bela build scripts across multiple Bela's simultaneously

Using Bela build scripts across multiple Bela's simultaneously

Suppose you are trying to program two Bela's at the same time (yes this was an actual need of mine).

You can achieve this using Bela's build_project.sh script [1] and some tweaking.

Basic setup

First you need to change the IP address and DHCP settings of one of your Bela's [2], so that you can connect to your two devices separately and simultaneously.

@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
@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 / 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 / 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 / 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