Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Ducunt volentem fata - nolentem trahunt.

G. Martin Butz mbutz

💭
Ducunt volentem fata - nolentem trahunt.
View GitHub Profile
@mbutz
mbutz / gist:2ea7cdd19648c380a721
Last active Sep 22, 2018
Sonic Pi Sequencer - Proof of concept
View gist:2ea7cdd19648c380a721
# Sonic Pi Sequencer (beta)
# Not yet music, but a proof of concept and part of a toolbox to
# create pattern based music
# Rather than think about durations and time distances I'd like to think of
# bars and patterns. Something like that:
# | 16 | 1 | e | u | e | 2 | e | u | e | 3 | e | u | e | 4 | e | u | e |
# |----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|
# | Bass | x | | x | x | | | x | | | x | | | | | x | |
@mbutz
mbutz / gist:8bf1a47a608a368272f2
Last active Nov 2, 2017
Sonic Pi Sequencer - Beta 2
View gist:8bf1a47a608a368272f2
# Sonic Pi Sequencer (v2)
# Simplified notation of synth lines, can now play chords
use_debug false
set_volume! 1
use_bpm 120 # beat = quarter note
# TODO
# Make 'play_rhythm_bar' to work with an array of samples like 'play_melody_bar'
View gist:fc549569f488e93a698b
# AFX Song Sketch
use_debug false
set_volume! 1
use_bpm 128 # beat = quarter note
# TODO
# Shaker
# Rework the tune synth
# Break at 19
@mbutz
mbutz / AFX, 1.7, base
Created Aug 16, 2015
Base of AFX 1.7 - helper functions, patterns and song modules
View AFX, 1.7, base
# AFX 1.7, prepare the tune
use_debug false
set_volume! 1
use_bpm 128
load_samples [:loop_compus, :elec_wood, :drum_bass_hard, :drum_snare_hard, :drum_snare_hard, :drum_cymbal_closed, :elec_snare, :drum_tom_hi_soft]
# Helper Functions
@mbutz
mbutz / AFX, 1.7, tune
Created Aug 16, 2015
Tune of AFX 1.7 - the actual tune
View AFX, 1.7, tune
# AFX 1.7, play the tune
use_debug false
set_volume! 1
use_bpm 128
puts "01"
mod_shaker
mod_bordun
sleep 16
View AFX 1.8, first buffer
# AFX 1.8, No.1: set up some helper functions and define rhythmic/melodic patterns
use_debug false
set_volume! 1
use_bpm 128
load_samples [:loop_compus, :elec_wood, :drum_bass_hard, :drum_snare_hard, :drum_snare_hard, :drum_cymbal_closed, :elec_snare, :drum_tom_hi_soft]
# Helper Functions
View AFX 1.8, second buffer
# AFX 1.8, define song modules and instruments
define :mod_shaker do
in_thread do
2.times do
play_sample [:loop_compus, 5, 1, 0, 0.17, 0.2], get_cbsa_on_ptn_a
play_sample [:loop_compus, 5, 1, 0, 0.17, 0.2], get_cbsa_on_ptn_b
end
end
View AFX 1.8, third buffer
# AFX 1.8, play the tune
use_debug false
set_volume! 1
use_bpm 128
puts "01"
mod_shaker
mod_bordun
sleep 16
View Testing performance of SP under Linux
# Combine chords, bass and flitter
uncomment do
use_bpm 100
my_a = [:a3, :c4, :e4, :g4]
my_d = [:a3, :c4, :e4, :fs4]
# set synth_default values
define :get_sync_short do
use_synth_defaults amp: 2, attack: 0, sustain: 0, release: 0.2
View Live Loop Timing
use_bpm 110
use_debug true
set_sched_ahead_time! 2
live_loop :bar do
cue :tick
sleep 1
end
# beeps at beginning of bar