Skip to content

Instantly share code, notes, and snippets.

View rbnpi's full-sized avatar

Robin Newman rbnpi

  • Near Peterborough
View GitHub Profile
@rbnpi
rbnpi / A_README SONIC_PI PLAY FILES
Last active June 17, 2017 01:14
Sonic-Pi music files for Raspberry PiGraphic Desktop
THESE FILES WERE WRITTEN FOR SONIC PI VERSION 1
THEY WILL REQUIRE REVISION TO WORK ON VERSION 2
I HAVE OTHER FILES FOR VERSION 2 POSTED ON MY BLOG
SOME OF THESE FILES ARE POSTED THERE IN REVISED VERSIONS
http://rbnrpi.wordpress.com
Posted here will be music files for use with Sonic-Pi on the Raspberry Pi.
If you have the Sonic-Pi music program isntalled (it is on the latest distribution for Raspian) you can start it up from the Graphic Desktop (there is a link under Education on the Start Menu). You can then copy and past the contents of one of the play files into one of the 8 workspace windows and click play to play it.
@rbnpi
rbnpi / c-minorstudy
Created November 19, 2014 17:39
Sonic-Pi sounds based on c-minor scale: requires features in version 2.1
#playing with code loops and c-minor scales. Robin Newman Nov 2014
#this piece controls 7 loops with a metronome loops generating cues
#which also selects a synth name from a given list and stores it in a global variable
#a loop (vset) controls the overall volume of the piece, fading it up and down
use_debug false
set_volume! 0 #set initial volume
with_fx :reverb,room: 0.8 do
live_loop :metro do
$S = [:tri,:prophet,:fm,:zawa,:saw].choose
@rbnpi
rbnpi / Instructions for use
Created November 19, 2014 17:50
Creating 3 samples with Sonic-Pi and then reusing them in second program: Prophwazsaw
The programs were created using a near release beta of Sonic-Pi 2.1
Because of the processing required these programs will not work effectively on a
Raspberry Pi, but require the more powerful resources available on the Mac version of
Sonic Pi, although they should also work on a more powerful Linux box under say Ubuntu.
and probably on the Windows version of Sonic Pi too, although I haven't tested this.
The first program createsamples uses 6 live_coding loops to generate a pattern of notes
related to a c minor scale, together with a background ambi_lunar_land sound. The timing
is controlled by cue and sync commands using the metronome thread metro.
@rbnpi
rbnpi / puppetonastring.txt
Created November 22, 2014 10:34
Puppet on a String for Sonic Pi 2.1
#Puppet on a String transcribed by Robin Newman
set_sched_ahead_time! 4
v = :tri
bv = :saw
ba = 0.3 #b vol
s = 1.0 / 15.5 #tempo 116 c/min
dsq = 1 * s #note length definitions
sq = 2 * s
@rbnpi
rbnpi / studyinGminor.txt
Created November 22, 2014 16:38
StudfyinGminor for Sonic-Pi 2.1
#study in g minor for Sonic Pi 2,1 by Robin Newman November 2014
live_loop :voice do
sync :foo
$s = [:prophet,:beep,:tri,:fm,:zawa].choose #set the synth each time loop foo3 finishes
sync :change
end
set_volume! 1
k=0
with_fx :reverb,room: 0.8,mix: 0.8 do #add overall reverb
live_loop :foo do
@rbnpi
rbnpi / GlassArmonicaPlaysMozart.rb
Last active August 27, 2022 18:47
Glass Armonica for Sonic Pi plays Mozart UPDATED to use rpitch: (introduced after this was first written) to calculate sample rate. MUCH simpler
#a Glass Armonica "voice" for Sonic Pi by Robin Newman November 2014
# revised to use rpitch 2018; corrected 2022 for missing tr function
#This simulates the Glass Armonica invented by Benjamin Franklin and for which Mozart
#composed the piece played here
#This version uses rpitch: parameter added to Sonic Pi after the original was written in 2014
##| sample :ambi_glass_rub
##| play :fs5
##| puts note(:fs5)
##| stop
use_debug false
@rbnpi
rbnpi / harmonisedscales.rb
Last active August 29, 2015 14:10
Harmonised scales using chord inversions
#defining chord inversions, and using them to harmonise an ascending and descending scale
#by Robin Newman, November 2014
#the pattern is repeated at semitone intervals 12 times
#written by Robin Newman Nov 2014 using Sonic Pi 2.1
use_debug false
set_sched_ahead_time! 2 #set to about 55 to run on Pi!!!!!!
q=0.12 #note length used
use_synth :tri
with_fx :reverb,room: 0.8 do #add some reverb for interest
@rbnpi
rbnpi / percussionprogrammegenerator.rb
Created December 1, 2014 18:33
Percussion Programme Generator for Sonic-Pi 2.1 SUPERSEDED BY VERSION 2
#Percussion track generator by Robin Newman, 1st December 2014 for Sonic-Pi 2.1
#Inspired by an article http://www.soundonsound.com/sos/feb98/articles/rythm.html
#This program generates a percussion programme defined over two bars quantised to 32 pulses per bar
#up to 10 instruments can be incorporated
#any instrument can sound on any pulse
#one of three volumes can be chosen for each instrument for each pulse
#a variable p sets the pulse tempo for each programme
#a variable n sets the number of bars the track will play for in 2 bar increments
#In this example three drum programmes are defined num = 1 to num = 3. num=0 plays silence
#These can be chosen in a live_loop by changing the variable num
@rbnpi
rbnpi / basssamplevoices.rb
Last active August 29, 2015 14:10
Sample based voices for all bass_xxx_c samples built into Sonic Pi, except for :bass_hit_c
#sample based voices for any bass_xxx_c samples over 4 octave range from :c2 to :c5 by Robin Newman December 2014
#use pl(inst,n,d=0.2,pan=0,v=0.8) to play a note where n is note symbol,d duration,v volume
#or plarray(inst,nt,dur,sh=0,vol=0.8,pan=0) to play lists of note symbols and durations
#where inst is samplename,nt and dur are note symbol and duration arrays,sh transpose shift
use_debug false
rm = 2**(1.0/12) #rate multiplier between adjacent semitones (twelth root of 2)
inst = :bass_hard_c #to define scope of inst variable set up here. Used as a parameter later
s=1.0/16 #speed multiplier give 2 crotchet/sec or 120 bpm
shift=0
@rbnpi
rbnpi / BassVoicesFrere.rb
Created December 3, 2014 18:16
Sonic Pi Sampled based Bass Voices play chords and Frere Jaques Round
#bass sample voices for Sonic Pi version 2. With Frere Jaques and chords examples
#sample based voices for any bass_xxx_c samples over 4 octave range from :c2 to :c5 by Robin Newman December 2014
#use pl(inst,n,d=0.2,pan=0,v=0.8) to play a note where n is note,d duration,v volume
#or plarray(inst,nt,dur,sh=0,vol=0.8,pan=0) to play lists of notes and durations
#where inst is samplename,nt and dur are note and duration arrays,sh transpose shift
#tidied up tr, pl, plarray definitions and added plchord to play chords.
#all of them now accept symbolic or numeric note entry
use_debug false