Skip to content

Instantly share code, notes, and snippets.

View mbutz's full-sized avatar
💭
Cum Deus calculat fit mundus

G. Martin Butz mbutz

💭
Cum Deus calculat fit mundus
View GitHub Profile
@mbutz
mbutz / base-clarinet-and-modulo.rb
Created March 2, 2017 20:14
FM sounding like bass clarinet
# Bass Clarinet
master_vol = (line 0, 1, inclusive: true, steps: 50).ramp
bass_vol = 0.5
bass_rhythm = (ring 0.25, 0.75, 1, 0.75, 0.25, 0.5, 0.5).shuffle # makes 4 quarters or one bar on the whole
bass_depth = (line 0, 12, steps: 6) # (ring 0.0, 2.0, 4.0, 6.0, 8.0, 10.0) for fm depth:
bass_room = (ring 100, 150, 200, 300)
bass_cycle = 32 # the complete bassline
bass_phrase = bass_cycle / 4 # One of the four patterns
@mbutz
mbutz / supercollider_rhodes
Created April 7, 2017 16:34
Rudimentary Fender Rhodes Synth Definition for Sonic Pi with SuperCollider
// Thanks to snappizz, http://sccode.org/1-522 thanks to hint and help by Alexandre Enkerli
// At least you can specify frequency as a midi note
(
SynthDef(\rhodes, {
|
// standard meanings
out_bus = 0, note = 60, amp = 1, out = 0, gate = 1, pan = 0,
// all of these range from 0 to 1
vel = 0.8, modIndex = 0.2, mix = 0.2, lfoSpeed = 0.4, lfoDepth = 0.1
|
# filename: noise-to-music-2017-04.30.rb
# You can find a video of a live coded version here: https://www.youtube.com/watch?v=80Sw7G-4nno
use_bpm 120
live_loop :bar do
sleep 4
end
live_loop :ptn, sync: :bar do
# filename: modulo-random-melody.rb
use_bpm 120
live_loop :bar do
sleep 4
end
live_loop :phrase, sync: :bar do
sleep 4 * 2
# See https://www.youtube.com/watch?v=gm11KxJyYCA for a video example
use_bpm 120
# 8-beat loop to synchronize live_loops and
# to know, when recording will start which is:
# after every completed 8-beats, see :drums for
# knowing, when 8 beats are over ...
live_loop :metro do
sleep 8
# Basic live looper with Midi Control
# filename: lib-live-looper.rb
# Jack-Connections:
# Midi-Controller => Midi Through
# Soft Synth => Supercollider
# Setup for Arturia Minilab mkII
# Arm track for recording
# Pad 1 -> Track 1
# key: live looper
# point_line: 1
# point_index: 2
# --
# filename: ctl-live-looper.rb
set :metro_vol, 0.5
set :my_bpm, 120
set :playback_master, 10
set :rec_level, 2
use_bpm 120
use_synth :piano
use_synth_defaults attack: 0.0, release: 0.75, stereo_width: 1, vel: 0.15
phrase_len = 64
cycle_len = phrase_len * 3 # here: 4 bars
chn = 1
live_loop :metro do
sleep 4
@mbutz
mbutz / Sonic Pi Live Looper with touchosc: Controller Script
Last active November 5, 2017 16:11
Sonic Pi Live Looper with touchosc: Controller, Library and touchosc layout
# key: live looper touchosc
# filename: live_looper_touchosc.sps
# point_line: 1
# point_index: 2
# --
# Please configure connections between Sonic Pi and touchosc:
set :ip, "192.168.2.150"
set :port, 4000
# where can this script find the library?
# Superflu v2
# filename: superflu-02.rb
# Listen to version 1 at: https://soundcloud.com/mbutz/superflu-1
use_bpm 120
# Download sample from: www.mkblog.org/download/superflu.wav
# and adjust path to sample:
path="~/projects/sonicpi/playground/audio/samples/sonicpi"
# Unfortunately I did not save the code for the creation of this loop