Skip to content

Instantly share code, notes, and snippets.


Robin Newman rbnpi

  • Near Peterborough
View GitHub Profile
rbnpi / bari_bassic_blues-RF.rb
Created Aug 29, 2021
Bari Bassic Blues (originally for saxophone quartet and drums) by Joshua Haagen coded for Sonic Pi Hear it on
View bari_bassic_blues-RF.rb
#"Bari_Bassic_Blues" by Joshua Haagen
#originally for Saxophone Quartet and drums
#converted for Sonic Pi by Robin Newman, Aug 2021 with the composer's permission
#voiced for :dsaw synth with fxs reverb and wobble applied
#percussion parts converted to a note stream and then case statement used to select samples
#parts transposed to allow for original instrument
#use run_file "path/to/this/file" as too long for a suonic pi buffer
use_synth :dsaw
use_synth_defaults amp: 0.6
use_bpm 120
rbnpi / Gabrieli-Ch172-Septimi-RF.rb
Last active Jul 3, 2021
Gabrieli_Canzon_per_sonar_septimi_toni_a_8 coded for Sonic Pi. Hear it on
View Gabrieli-Ch172-Septimi-RF.rb
#converted to Sonic Pi code by Robin Neman from midi file by Martin Grayson Creative Commons 3.0 Attribution Non-Commercial-Share-Alike
use_synth_defaults attack: 0.03
with_fx :reverb, room:0.8,mix: 0.6 do
with_fx :level,amp: 0.5 do
use_synth :pulse
rbnpi / DanseMacabre-RF.rb
Last active Jun 18, 2021
Danse-Macabre by Saints-Saëns played by Sonic Pi hear it on
View DanseMacabre-RF.rb
#Danse Macabre by Saint-Saëns arranged for Sonic Pi by Robin Newman from a MuseScore by Salomão Sidharta
#May 2021
#use play_file "path/to/DanseBacabre-RF.rb" to play it
#note double-sharps can;t be notated in Sonic Pi so Cdouble-sharp is entered here as a D for example
use_transpose -2 #original instruments in Bb
s=0.95;r=0.05 #set sustain and release fractions
use_synth :blade
with_fx :reverb,room: 0.8, mix: 0.7 do #add osme reverb
rbnpi / Pase_el_agoa-RF.rb
Last active Mar 26, 2021
Pase el agoa 16th century anonymous piece coded for Sonic Pi. Hear it on
View Pase_el_agoa-RF.rb
#play using run_file "path/to/this/file"
#Anonymous 16th century manuscript Pase el agoa, ma Julieta dama
#"Across deep oceans" coded for Sonic Pi by Robin Newman, march 2021
#quite tricky to do to get the spread chords in the lute part sounding ok
#I love the corss rhythms of this piece.
#I could reduce the sequences of rests in most parts, but life is too short....
st=0 #starting section to play
s=0.97;r=0.03 #sustain/release fractions
#part volume and pan settings
rbnpi / VivaldiLaFollia-RF.rb
Last active Mar 22, 2021
Vivaldi's La Follia Trio Sonata in D Minor arranged for Sonic Pi Hear it on
View VivaldiLaFollia-RF.rb
#Vivaldi L Follia coded for Sonic Pi by Robin Newman, March 2021
#use run_file "path/to/this/file" to execute in Sonic Pi
st=0 #starting section (can change to start playing from any tempo change 0 - 13)
s=0.98;r=0.02 #multipliers for reslease and sustain fractions of duration
am=1 #amp multiplier changed for last 4 bars
with_fx :reverb,room: 0.8,mix: 0.6 do
with_fx :level, amp: 0.8 do #overall level multiplier
use_synth :tri #for top two parts
rbnpi / Bach_Prelude_&_Fugue_BWV848.rb
Last active Feb 7, 2021
Bach Prelude and Fugue no 3 in C# Major BWV 848 coded for Sonic Pi: execute with run_file command. Hear it on
View Bach_Prelude_&_Fugue_BWV848.rb
#midi to sonic-pi conversion using midi-sonic.rb script
#Initial script idea by theibbster developed by Robin Newman
#Tempo changes are allowed provided that they occur at the start of a note
#and at the same time in every part.
#use run_file "paht/to/this+file" to execute in Sonic Pi
#amend synth, ad fx pan settings etc manually to suit your piece
use_synth :piano #default synth
View sonicpiChallenge4.rb
#Sonic Pi Challenge #4 by Robin Newman
#I decided to generate my own binary string from text input
#which allows you to render any text here
#I liked initial code by theibbster at
#I developed this and put the two ideas together below
use_debug false
use_random_seed 6148
L= "Robin Newman's Sonic Pi challenge #4" #the text input I used
S=[] #array to hold binary represention of the string L
L.bytes.to_a.each do |x| #convert to binary 7 bit numbers for each character
rbnpi / Carol_of_the_Bells.rb
Last active Dec 22, 2020
"Carol of the Bells" coded for Sonic Pi. Entry for Monthly Challenge #3 on Hear it on
View Carol_of_the_Bells.rb
#coded for Sonic Pi by Robin Newman, Dec 22 2020
use_bpm 2*78 #twice 78rpm!! criterion for Monthly Challenge #3
s=0.95;r=0.1 #set sustain release fractions
pp=0.3;p=0.4;mf=0.6;f=0.8;ff=1 #defeine vol levels
with_fx :reverb,room: 0.8,mix: 0.8 do
use_synth :beep #synth for top part
with_fx :level ,amp: 1.3 do #most toop part relative to the others
rbnpi /
Last active Dec 28, 2020
Experimental replacement for scsynthexternal.rb in Sonic Pi3.2.2 running on New RPi OS with pulseaudio use READMEFIRST!

This hack is a temporary fix to get Sonic Pi 3.2.2 working with the new pulse-audio environment in the latest Raspberry Pi O released on 2020-12-02. Do not install it on earlier versions of the OS (unless you have done a apt upgrade)

You also need to install one other package sudo apt install pulseaudio-module-jack for it to work

The file scsynthexternal.rb is a drop in replacement for the file of the same name installed by the sonic-pi_3.2.2_f_armhf.deb file downloaded from sonic-pi-net The location of the installed file is /opt/sonic-pi/app/server/ruby/lib/scsynthexternal.rb

Download the replacement file into the Downloads folder of your Raspberry Pi. then execute the following commands make a backup

rbnpi / RandomSampleFrereJaques.rb
Last active Oct 6, 2020
Sonic Pi pays Frere Jaques using onsets from a random sample file Hear it on
View RandomSampleFrereJaques.rb
#random sample tune using Freres Jaques by Robin Newman, Oct 2020
#for random sample competition
#the random sample I was presented with was of a random elictricity buzz
#I read and save the onset info which produced 14 sections
#the first consisted of clicks, but the remainder I use to produce a "synth"
#with differnt tones. I then used these to play four aprt rounds of frere jaques
#finishing with one load very low frequency version.
use_debug false
#s holds the path to the sample from