Skip to content

Instantly share code, notes, and snippets.

View xavriley's full-sized avatar

Xavier Riley xavriley

View GitHub Profile
@xavriley
xavriley / vim_bela.md
Last active January 27, 2021 14:29
Using vim on Bela
@xavriley
xavriley / dont_drop_the_bass.rb
Created July 8, 2017 20:38
Don't Drop the Bass - Source code with comments - Brighton Ruby 2017
# ❤️ Brighton Ruby
# This code uses some features from the pre-release of Sonic Pi,
# due out later this month (touch wood!).
# If you just can't wait for the release but want to try it yourself
# you can either build the Sonic Pi master branch from source (pros: free, cons: hard)
# or share some love and contribute to the Patreon page to support Sonic Pi's development
# https://www.patreon.com/samaaron
# That will give to access to the latest pre-release versions
@xavriley
xavriley / polyrhythms.rb
Created May 15, 2015 10:53
Sonic Pi polyrhythms
# Try changing the numbers and clicking Run
@polyrhythm = [2,3]
live_loop :foo do
density(@polyrhythm.sort.first) { play :g; sleep 1 }
end
live_loop :bar, autocue: false do
sync :foo
density(@polyrhythm.sort.last) { play :c; sleep 1 }
@xavriley
xavriley / vimrc
Last active August 28, 2020 12:15
June 2020 vimrc
" Vim config
" 2020
" see ~/.config/nvim/init.vim for nvim stuff
set shell=/bin/bash
" set shell=$SHELL
"" PLUGIN MANAGEMENT
packadd minpac
call minpac#init()
@xavriley
xavriley / live_sample.rb
Created July 8, 2017 20:20
live_sample definition for Sonic Pi v2.13 and above
# place in ~/.sonic-pi/init.rb to autoload
def live_sample(name=nil, *args)
raise ArgumentError, "live_sample needs to have a unique name. For example: live_sample :foo" unless name
raise ArgumentError, "live_sample's name needs to be a string or symbol, got: #{name.inspect}. Example usage: live_sample :foo" unless (name.is_a?(Symbol) || name.is_a?(String))
ls_name = "live_sample_#{name}".to_sym
args_h = resolve_synth_opts_hash_or_array(args)
click = args_h[:click] || 4
dur = args_h[:dur]
This is Google's cache of http://www.mcld.co.uk/cymbalsynthesis/. It is a snapshot of the page as it appeared on 4 May 2020 03:03:17 GMT. The current page could have changed in the meantime. Learn more.
Full versionText-only versionView source
Tip: To quickly find your search term on this page, press Ctrl+F or ⌘-F (Mac) and use the find bar.
Cymbal synthesis tutorial
Dan Stowell
This tutorial describes an approach to synthesising decent-sounding cymbals, in a way that is efficient enough for a real-time synthesis system.
@xavriley
xavriley / gist:c1c0d255e6f2f40dcdb4
Created October 15, 2015 07:35 — forked from darinwilson/SonicPiDrumMachine
Sonic Pi Drum Machine
#########################################
## Sonic Pi Drum Machine
## coded by Darin Wilson
## changed by Xavier Riley
##
use_bpm 95
in_thread(name: :drum_machine) do
@xavriley
xavriley / bath_ruby_2016.rb
Created March 12, 2016 02:37
Final piece at BathRuby 2016
define :bo do |idx|
"Users/xriley/Dropbox/Public/sounds/barack/b#{idx}.wav"
end
use_bpm 125
live_loop :heartbeat do
sample :bd_tek, amp: 0, cutoff: (range 60, 90).mirror.tick
sleep 1
end
@xavriley
xavriley / deep_note.rb
Last active April 21, 2020 02:36
Recreating the THX sound with SonicPi
# THX Deep Note
# Second draft
# see http://www.earslap.com/article/recreating-the-thx-deep-note.html
time = 10
wait_time = (time / 3)
synths = []
rand_note = -> { rrand(note(:A2), note(:A4)) }
with_fx :normaliser, amp: 0.5 do
use_synth :dsaw
@xavriley
xavriley / README.md
Created June 18, 2018 20:34
Sonic Pi Vocoder Prototype

Prototype of vocoder on Sonic Pi

Demo here: https://www.dropbox.com/s/qiktze3ml7bz5iq/autotune_the_shipping_forecast.wav?dl=0 Original voice input here: https://soundcloud.com/jb_uk/neil-nunes-bbc-radio-4-and

This is a demo of a simple effects synth using the Vocoder.ar UGen from SuperCollider. This is a fairly primitive vocoder implementation made of a bunch of bandpass filters which are "tuned" to various frequencies.

The results are mixed, but it's difficult to get a decent reproduction of the words from this.

To get T-Pain/Imogen Heap style auto-tune it would be necessary to write a different algorithm probably using a technique called PSOLA which is described at the following links: