Skip to content

Instantly share code, notes, and snippets.

View darinwilson's full-sized avatar

Darin Wilson darinwilson

View GitHub Profile
@darinwilson
darinwilson / request.java
Last active March 21, 2020 22:07
Java extension to get a POST request working with Volley in RubyMotion for Android
/*
* This assumes that you have a file called request.rb in the same directory, and that
* the file contains a subclass of Volley request object
*
* The code in this .java file gets added to the Java wrapper around our Ruby class at
* compile time. This contains a few shims to work around cases where RubyMotion is
* currently not generating correctly typed versions of these methods.
*
* http://hipbyte.myjetbrains.com/youtrack/issue/RM-724
*
# 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 / clock_sync.txt
Created March 2, 2017 21:58
Sonic Pi MIDI clock sync
use_bpm 120
midi_start
live_loop :clock do
midi_clock_beat
sleep 1
end
live_loop :kick do
sample :bd_haus
@darinwilson
darinwilson / ambient1
Created August 14, 2015 19:46
Ambient experiment using Sonic Pi
# 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 / SonicPiDrumMachine
Last active March 2, 2024 20:11
Sonic Pi Drum Machine
#########################################
## 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)
@darinwilson
darinwilson / sonic_pi_examples.txt
Last active March 15, 2024 14:59
Sonic Pi Examples
##############################################
## Example 1 - play a note
play 60
##############################################
## Example 2 - play 4 random notes
4.times do
play rrand_i(60, 90)
sleep 0.5