Skip to content

Instantly share code, notes, and snippets.

/** This script exemplifies the use of SuperCollider on Bela. When a project contains a _main.scd file, sclang is started and the content of the file is executed. If you want to interact with SuperCollider running on the board from within the SuperCollider IDE on your computer, check out the 12-SuperCollider/remote examples instead. Those files also include more code examples to interface with Bela-specific UGens. */

// live audio input
(
SynthDef(\anintest, { |out, sustain = 1, speed = 1, begin = 0, end = 1, pan, accelerate, amp = 1, offset|
var env, sound, rate, phase;
phase = Line.ar(begin, end, sustain);
rate = (begin + 1) * (speed + Sweep.kr(1, accelerate));
sound = SinOsc.ar( AnalogIn.ar( 0 ).poll.exprange( 200, 5000 ), 0, 0.1 );
OffsetOut.ar(out,
DirtPan.ar(sound, ~dirt.numChannels, pan, amp)
)
@jarmitage
jarmitage / midi.tidal
Created September 29, 2017 03:21
MIDI copy/paste -> TidalCycles
{-
Importing MIDI to TidalCycles
Beethoven 7th Symphony II Allegretto
Time signature: 2/4
Key: C Major
@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 / harmony.tidal
Created September 20, 2017 23:16
harmony and ur
do
let key = "[0 2 4]/6"
mScale = Sc.chromatic
melody = "[[7 4 5](5,8)]*2"
harmony = "0"
tonic = "[0(3,8) [<[-7*2 -5*2] [3*2 5*2]>]]"
bScale = mScale
bass = tonic
d1 $ slow 2
$ (|+| n key) $ stack [
@jarmitage
jarmitage / init.tidal
Last active December 6, 2018 11:01
init.tidal
import Sound.Tidal.SpectralTricks -- https://github.com/datamads/SpectralTricks
import Sound.Tidal.Scales as Sc
import Sound.Tidal.Chords as Ch
let (accel,_) = pF "accel" (Just 0)
(bits,_) = pI "bits" (Just 0)
(carPartial,_) = pF "carPartial" (Just 0)
(detune,_) = pF "detune" (Just 0)
@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 / 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.