Skip to content

Instantly share code, notes, and snippets.

View beneggett's full-sized avatar

Ben Eggett beneggett

View GitHub Profile
@rbnpi
rbnpi / SequenceGeneratorWithBinaryRhythmTune.rb
Created July 14, 2015 18:04
SP file that generates a rhythm section using a 32 bit grid for each instrument. It also generates an accompaniment using a play rhythm which is 4 bit binary numbers 0-15 in sequence. Requires SP 2.6dev including tick and note_range functions. Sound file at https://soundcloud.com/rbnman/sequencegeneratorwithbinaryrhythmtune
#sequence generator by Robin Newman.
#Based on previous work on my percussiongenerator in Dec 2014,https://gist.github.com/rbnpi/f249905887f8eadff82b
#of which I was reminded of this by the sequencer written by Martin Butz at https://gist.github.com/mbutz/2ea7cdd19648c380a721
#requires sp 2.6dev as uses named tick, tick_set and note_range functions
#noise pulse,generates a burst of noise at the start and end of the piece, and is from my program whoosh.rb
#at https://gist.github.com/rbnpi/9f32fde76ac7990d83d2
#live_loop :rhythm details...
#rhythm parts generated from a 32 pulse grid for each instrument, although many repeat earlier than that eg after 2,4,8 or 16 pulses
@gregpalaci
gregpalaci / CoffeeScript Jquery better each loop
Created July 19, 2013 07:42
CoffeeScript Jquery better each loop
# Better each() for use with coffeescript
# 1. Wraps child in jquery object
# 2. Sets child first argument, so that fat-binding can be used.
# 3. Sets @ as well, for normal binds
jQuery.fn.loop = (block) ->
for i in @
element = jQuery(i)
res = block.call element, element
break if res == false
@bf4
bf4 / Gemfile
Created July 2, 2013 18:36
Rails lograge and logstash request logging
gem 'lograge' # more readable logs
gem 'logstash-event' # for logstash json format
gem 'mono_logger' # threadsafe logging
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true