Skip to content

Instantly share code, notes, and snippets.

Darin Wilson darinwilson

View GitHub Profile
@darinwilson
darinwilson / clock_sync.txt
Created Mar 2, 2017
Sonic Pi MIDI clock sync
View clock_sync.txt
use_bpm 120
midi_start
live_loop :clock do
midi_clock_beat
sleep 1
end
live_loop :kick do
sample :bd_haus
@darinwilson
darinwilson / cpu_dreams.txt
Created Feb 22, 2017
CPU Dreams - for Sonic Pi
View cpu_dreams.txt
# Source code for a Sonic Pi piece (http://sonic-pi.net/)
#
# This an extension of an earlier piece I wrote with
# Sonic Pi called "Ambient Experiment". I added a new
# voice and routed the notes out via MIDI so that the
# sounds could be generated in Ableton Live.
#
# Audio version: https://soundcloud.com/darinwilson/cpu-dreams
#
# The piece consists of four long loops, each of which
@darinwilson
darinwilson / ep8.exs
Created Jan 17, 2016
LearnElixir.tv Episode 8 Exercise
View ep8.exs
def join(strs, separator) do
last = List.last(strs)
for str <- strs, into: "" do
if str != last do
str <> separator
else
str
end
end
end
@darinwilson
darinwilson / nation_builder_events.rb
Created Dec 21, 2015
Exercise using the NationBuilder Events API
View nation_builder_events.rb
#
# This is very rudimentary web app that allows you to create and update
# an Event record using the NationBuilder API. This covers just the
# basics - many details have been left out.
#
# The app was built in Ruby 2.2.0, using the Sinatra web framework, and the
# NationBuilder API Ruby gem.
#
# To run the app:
# * gem install sinatra
@darinwilson
darinwilson / nation_builder_people.rb
Created Dec 21, 2015
Exercise using the NationBuilder People API endpoint
View nation_builder_people.rb
#
# This is very rudimentary web app that allows you to create, update, and
# delete a Person record using the NationBuilder API. This covers just the
# basics - many details have been left out.
#
# The app was built in Ruby 2.2.0, using the Sinatra web framework, and the
# NationBuilder API Ruby gem.
#
# To run the app:
# * gem install sinatra
View sonic_pi_examples.txt
##############################################
## Example 1 - play a note
play 60
##############################################
## Example 2 - play 4 random notes
4.times do
play rrand_i(60, 90)
sleep 0.5
@darinwilson
darinwilson / SonicPiDrumMachine
Last active Feb 3, 2019
Sonic Pi Drum Machine
View SonicPiDrumMachine
#########################################
## Sonic Pi Drum Machine
## coded by Darin Wilson
##
use_bpm 95
in_thread(name: :drum_machine) do
# choose your kit here (can be :acoustic, :acoustic_soft, :electro, :toy)
View Sonic Pi : Phasing Piano
# Phasing Piano for Sonic Pi, coded by Darin Wilson
# inspired by Steve Reich's Clapping Music
#
# This piece consists of two threads, each playing the same short melodic phrase.
#
# On every third pass through the phrase, one of the threads shifts the phase by
# 1/4 of a beat, moving it more and more out of phase. Eventually, it comes
# back around to where it started, and the piece ends.
use_synth :piano
@darinwilson
darinwilson / ambient1
Created Aug 14, 2015
Ambient experiment using Sonic Pi
View ambient1
# Ambient experiment for Sonic Pi (http://sonic-pi.net/)
#
# The piece consists of three long loops, each of which plays one of
# two randomly selected pitches. Each note has different attack,
# release and sleep values, so that they move in and out of phase
# with each other. This can play for quite awhile without
# repeating itself :)
live_loop :note1 do
use_synth :hollow
@darinwilson
darinwilson / art_crash_output
Created Apr 29, 2015
Output of ART crash when instantiating a RoundRect with RubyMotion Android
View art_crash_output
Start com.yourcompany.round_rect_crash/.MainActivity
--------- beginning of system
--------- beginning of main
I/com/yourcompany/round_rect_crash( 1607): creating RoundRect with Java
I/com/yourcompany/round_rect_crash( 1607): #<android.graphics.drawable.shapes.RoundRectShape:0x100019>
I/com/yourcompany/round_rect_crash( 1607): creating RoundRect with Ruby
E/art ( 1607): 0xb405ce80 SpaceTypeMallocSpace begin=0x12c00000,end=0x12e01000,limit=0x22c00000,size=2MB,capacity=96MB,non_growth_limit_capacity=256MB,name="main rosalloc space"]
E/art ( 1607): 0xb425ff60 allocspace main rosalloc space live-bitmap 3[begin=0x12c00000,end=0x22c00000]
E/art ( 1607): 0xb427f300 allocspace main rosalloc space mark-bitmap 3[begin=0x12c00000,end=0x22c00000]
E/art ( 1607): 0xb4050480 SpaceTypeImageSpace begin=0x6fec0000,end=0x70835000,size=9MB,name="/data/dalvik-cache/x86/system@framework@boot.art"]
You can’t perform that action at this time.