Skip to content

Instantly share code, notes, and snippets.

@ctford
ctford / song.clj
Created September 28, 2014 19:22
Tuesday - written with Overtone and Leipzig.
(ns tuesday.song
(:require [overtone.live :refer :all]
[leipzig.melody :refer :all]
[leipzig.scale :as scale]
[leipzig.live :as live]
[leipzig.chord :as chord]
[leipzig.temperament :as temperament]))
; Instruments
(definst bass [freq 110 volume 1.0]
@xavriley
xavriley / arpeggiator.rb
Last active August 29, 2015 14:23
Sonic Pi note_range function
def note_range_demo(low_note, high_note, options={})
low_note = Note.resolve_midi_note(low_note)
high_note = Note.resolve_midi_note(high_note)
potential_note_range = Range.new(low_note, high_note)
if options[:pitches]
pitch_classes = options[:pitches].map {|x| Note.resolve_note_name(x) }
note_pool = potential_note_range.select {|n|
@kindohm
kindohm / timing.rb
Created July 22, 2015 17:45
timing
live_loop :thing do
sample :drum_bass_hard
sleep 0.75
4.times do
sample :drum_cymbal_soft, rate: rrand(2,4)
sleep 0.125
end
end
live_loop :snare do
@rbnpi
rbnpi / scaletypecontrolledarpeggios.rb
Last active August 29, 2015 14:25
scaletypecontrolledarpeggios.rb An exercise in composing a piece based on scale types, three chords and arpeggios. Fully commented to explain how it works. Needs SP 2.6. Audio on https://soundcloud.com/rbnman/scaletypecontrolledarpeggios
#loading...#scaletypecontrolledarpeggios.rb by Robin Newman, July 2015. Requires sp2.6
#A study using arpeggios with different scale formats. Also utilising rings and ticks
#This was a great exercise to explore different Sonic Pi (and Ruby) commands
#eg tick, look, ring, note_range for SP and string manipulation commands and eval for Ruby to mention some.
#First of all in the defined procedures which enable you to extract info about different scale types
#and to generate the rings required for the piece to work.
#Basically the code generates a pool of notes for three separate chords and then transposes those notes
#using notes 0,3,4 and 4 (down an octave) for each of the distinct 8 note scales supported in Sonic Pi
# Both live loops play in total rhythmical sync.
# Notice that they are both using the same seed
# One in Ruby and the other in the synthdef ;-)
# Note: needs Sonic Pi v2.7 to work correctly
live_loop :foo do
use_random_seed 10
64.times do
#samples = Dir.glob("/path/to/samples/*.wav")
#samples = [:loop_amen_full, :ambi_choir]
#samples = [:ambi_choir]
samples = [:guit_harmonics]
#starts = (ring 0, 0.25, 0.5, 0.75)
#starts = range(0, 0.875, 0.125)
starts = range(0, 0.875, 0.0625)
#starts = (0..10).collect{rand(1)}
live_loop :drums do
with_fx :level, amp:1.0 do
sample :bd_ada, attack:0, sustain_level:0, decay: 0.1, start: 0, amp:2, rate:0.5
sleep 0.125
with_fx :reverb, mix:0.2, room:0.5 do
sample :perc_snap, attack:0, sustain_level:0, decay: (ring 0.1, 0.1, 0.1, 0.5).tick(:t1), start: 0, amp:1, rate:(ring -2, -3, -4, -5).tick(:t1b)
sleep 0.125
with_fx :krush, mix:0.7 do
sample :misc_burp, attack:0, sustain_level:0, decay: 0.4, start: 0.5, amp:(ring 0.4, 0.6, 0.8, 0).tick(:t2), rate:0.9
end
# Coded by Sam Aaron
bizet_bass = (ring :d, :r, :r, :a, :f5, :r, :a, :r)
#bizet_bass = (ring :d, :r, :r, :Bb, :g5, :r, :Bb, :r)
live_loop :bizet do
with_fx :reverb, room: 1, mix: 0.3 do
with_fx :slicer, phase: 0.125 do
synth :blade, note: :d4, release: 8, cutoff: 100, amp: 1.5
end
16.times do
@rbnpi
rbnpi / WindowsInstall.md
Last active December 31, 2015 12:20
THIS IS NOW INSTALLED IN THE SONIC PI DISTRIBUTION AND UPDATED COPIES SHOULD BE REFERENCED THERE.

SONIC PI DETAILED BUILD YOUR OWN INSTRUCTIONS FOR WINDOWS 10 BASED ON LATEST SP 2.9dev after e7fde3a

Last revision 23rd December 2015 @ 11;25 (added win32-process gem install)

Test bed was a Windows 10 64bit install (running under vmware fusion on a Mac)

This document details the process from beginning to end to build Sonic Pi 2.9dev and I hope it will be useful to others, and encourage them to have a go themselves.

Prerequisite. A windows 10 computer with internet connection and working soundcard.

@wojtekerbetowski
wojtekerbetowski / output.md
Last active March 14, 2017 21:44
Load most common PyWaw speakers

Output on 14.03.2017

$ python pywaw.py 
Collecting beautifulsoup4
  Using cached beautifulsoup4-4.5.3-py3-none-any.whl
Collecting requests
  Using cached requests-2.13.0-py2.py3-none-any.whl
Installing collected packages: beautifulsoup4, requests
Successfully installed beautifulsoup4-4.5.3 requests-2.13.0