Skip to content

Instantly share code, notes, and snippets.

@illiichi
illiichi / 10 minutes
Last active May 8, 2019 06:01
10 minutes
;; this didn't work for me. use lein instead
> clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.8.0"} overtone {:mvn/version "0.10.3"}}}' -r
@interstar
interstar / trap3.rb
Last active August 3, 2021 21:32
Trap beat for sonic pi
use_bpm 145
# Our chord sequence
p1 = [chord(:E3,"minor7"),
chord(:G3,"major7"),
chord(:A3,"minor7"),
chord(:G3,"m9"),
chord(:E3,"m9"),
chord(:C3,"minor7"),
@tado
tado / tidalForwardOsc.scd
Last active March 19, 2021 13:58
Forwarding TidalCycles OSC messages via SuperCollider
SuperDirt.start
(
//forward OSC message (localhost, port 3333)
var addr = NetAddr.new("127.0.0.1", 3333);
OSCdef(\tidalplay2, {
arg msg;
addr.sendMsg("/play2", *msg);
}, '/play2', n);
)
@tado
tado / SonicPiOsc.pde
Created November 22, 2016 03:00
Perser for log forwarding on Haskap Jam Pack
class SonicPiOsc {
String synth;
String[] paramList;
void perse(OscMessage msg) {
if (msg.checkAddrPattern("/log/multi_message")) {
String[] allList = split(msg.get(5).stringValue(), ',');
String[] synthList = split(allList[0], ':');
synth = synthList[1];
String str = msg.get(5).stringValue();
use_bpm 140
#kick
live_loop :a do
s = (ring 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.75).tick(:t1)
k = (ring :bd_ada, :bd_haus, :bd_zum).tick(:t2)
sample k, start: 0.06, finish: 1, sustain_level:0, decay:0.2, amp: 3, rate: 0.9
sleep 1 #1
end
@xavriley
xavriley / slice_n_dice.rb
Created August 7, 2015 16:22
Sonic Pi Beat Slicer 2.0
def nested_beat(el, stepsize=0)
if el.kind_of? Array
el.map {|x| nested_beat(x, (stepsize.zero? ? 1.0 : stepsize/el.length)) }
else
{level: stepsize, step: el}
end
end
def get_nested_beat(pattern)
nested_beat(pattern).flatten.map do |step|
@samaaron
samaaron / Reich Phase - Overtone
Last active December 26, 2019 20:29
Steve Reich's Piano Phase - Sonic Pi vs Overtone
(ns overtone.examples.compositions.piano-phase
(:use overtone.live
overtone.inst.sampled-piano))
;; Steve Reich's Piano Phase
(def piece [:E4 :F#4 :B4 :C#5 :D5 :F#4 :E4 :C#5 :B4 :F#4 :D5 :C#5])
(defn player
[t speed notes]
@jcieslar
jcieslar / sonic_pi.md
Last active November 14, 2015 22:43
Sonic Pi setup for Ubuntu 14.04

Ubuntu setup for Sonic Pi

Install dependencies

sudo apt-get -y --force-yes install supercollider ruby1.9.3 libqscintilla2-l10n libqscintilla2-dev qt4-dev-tools cmake libffi-dev qt4-qmake libqt4-dev

Clone repo

git clone git@github.com:samaaron/sonic-pi.git

Server extensions

@xavriley
xavriley / auto_dubstep.rb
Created June 10, 2014 21:33
Auto generating dubstep with Sonic Pi
# DUBSTEP
# Combines ideas from my other gists
current_bpm = 140.0
use_bpm current_bpm
# WOBBLE BASS
define :wob do
use_synth :dsaw
lowcut = note(:E1) # ~ 40Hz
highcut = note(:G8) # ~ 3000Hz
@reprimande
reprimande / gist:4239620
Created December 8, 2012 09:51
play binary by supercollider
(
s.waitForBoot {
var rootPath, window, view,
drawBuf, bufnum, sound, task,
width, height, fps, curX, curY, pixSize,
processFunc, loadFile;
// initial settings
rootPath = "/path/to/root/dir";
pixSize = 5;