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 / ReadMeFirst.md
Last active December 28, 2020 09:29
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
rbnpi / RandomSampleFrereJaques.rb
Last active October 6, 2020 12:48
Sonic Pi pays Frere Jaques using onsets from a random sample file Hear it on https://soundcloud.com/sc3rbnman/randomsamplefrerejaques
#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 https://freesound.org/search/?q=260832
@rbnpi
rbnpi / Salomone_Rossi_Corrente-RF.rb
Created September 20, 2020 15:09
seven Corrente by Salomone Rossi 1613 transcribed for Sonic Pi from a MuseScore by w8erw Hear it on soundcloud.com
#Salomone_Rossi_Corrente-RF.rb
#These 7 Corrente were written in 1613
#I have transcribed them from a MuseScore by w8erw to play on Sonic Pi.
#quite a lot of fun debugging this, especially the harpsichord part!
#program designed to send haprsichord voices to vmpk va midi and reimport live_audio
#you can also set midiplay to false and play this part with internal piano synth instead
st=0 #start section number for debug purposes normally leave at 0
midiplay = true #set to false for internal piano synth
#if using midi adjust port as necesssary
@rbnpi
rbnpi / Salomone_Rossi_Bergamasca_Canzona-RF.rb
Last active September 16, 2020 17:56
Bergamsaca by Salomene Rossi 1642 arranged for Sonic Pi. Hear it on https://soundcloud.com/rbnsonicpi/salomone-rossi-bergamasca-canzona
#Salomone_Rossi_Bergamasca_Canzona-RF.rb
#converted to Sonic Pi format by Robin newman Sept 2020
#from a MuseScore by Daniel Rubin
#use run_file "path/to/Salomone_Rossi_Bergamasca_Canzona-RF.rb"
with_fx :reverb,room: 0.7,mix: 0.7 do
with_fx :level,amp: 0.4 do
use_synth :tri
a1=[]
b1=[]
a1[0]=[:r,:D6,:D6,:C6,:E6,:D6,:C6,:B5,:D6,:C6,:B5,:A5,:G5,:A5,:B5,:C6,:A5,:G5,:D6,:G6,:F6,:E6,:E6,:D6,:C6,:B5,:A5,:B5,:C6,:D6,:C6,:B5,:A5,:G5,:G5,:A5,:G5,:D6,:E6,:F6,:G6,:F6,:E6,:D6,:C6,:B5,:A5,:B5,:C6,:D6,:C6,:B5,:A5,:B5,:C6,:D6,:E6,:F6,:G6,:F6,:E6,:C6,:D6,:E6,:F6,:G6,:E6,:Fs6,:G6,:Fs6,:G6,:Fs6,:E6,:Fs6,:G6,:D6,:G6,:F6,:E6,:E6,:D6,:C6,:B5,:G5,:A5,:B5,:G5,:D6,:B5,:C6,:B5,:A5,:G5,:A5,:G5,:D6,:B5,:C6,:D6,:E6,:F6,:D6,:E6,:C6,:D6,:E6,:F6,:G6,:E6,:Fs6,:D6,:E6,:Fs6,:G6,:A6,:Fs6,:G6,:G5,:A5,:B5,:C6,:D6,:B5,:C6,:F5,:G5,:A5,:B5,:C6,:A5,:B5,:C6,:D6,:E6,:D6,:C6,:B5,:A5,:G5,:A5,:G5,:G6,:D6,:G6,:D6,:E6,:G6,:Fs6,:E6,:Fs6,:G6,:D6,:A5,:B5,:G5,:A5,:B5,:C6,:A5,:B5,:G5,:A5,:B5,:A5,:G5,:r,:G6,:F6,:E6,:D6,:C6,:B5,:A5,:G5,:A5,:G5,:Fs5,:G5,:A5,:B5,:C
@rbnpi
rbnpi / Francesco_Turini_Triosonata_Il_Corisino-RF.rb
Last active September 15, 2020 19:14
Francesco Turini Trio Sonata Il Corisino played by Sonic Pi. Hear it on https://soundcloud.com/rbnsonicpi/francesco-turini-triosonata-il-corisino
#Francesco_Turini_Triosonata_Il_Corisino-RF.rb
#transcribed from a MuseScore by Daniel Rubin for Sonic Pi by Robin Newman Sept 2020
#makes use of external harpsichord synth in vmpk, driven by midi from Sonic piano
#with audio fed back to Sonic Pi as live_audio
#use runfile "/path/to/Francesco_Turini_Triosonata_Il_Corisino-RF.rb"
midiplay = true #for harpsichord or false for piano substitute
#notes for midi/piano parts 3,4,5 follow
a3=[]
b3=[]
a3[0]=[[:C4,:E4,:A4],[:B3,:E4,:B4],[:C4,:E4,:A4],[:D4,:F4,:A4],[:Bf3,:D4,:G4],[:C4,:E4,:G4],[:A3,:C4,:F4],[:G3,:C4,:G4],[:D4,:F4,:A4],[:B3,:E4],:Gs4,[:C4,:E4,:A4],[:F4,:A4],:E4,[:D4,:G4],[:E4,:G4],:D4,[:C4,:E4,:A4],[:D4,:Gs4],[:C4,:E4,:A4],[:B3,:E4,:B4],[:C4,:E4,:A4],[:A3,:D4,:A4],[:B3,:D4,:G4],[:G3,:C4,:G4],[:C4,:F4,:A4],[:D4,:F4,:B4],[:C4,:E4,:A4],[:B3,:E4,:Gs4],[:A3,:D4,:A4],[:D4,:F4,:A4],[:B3,:E4,:G4],[:C4,:E4,:G4],[:A3,:D4,:F4],[:A3,:E4,:A4],[:B3,:D4,:Gs4],[:C4,:E4,:A4],[:F4,:A4],:E4,:r,:E5,:r,:r,:D5,:r,[:D4,:G4,:B4],[:D4,:F4,:A4],[:E4,:A4],:Cs4,[:D4,:G4],[:D4,:G4,:
@rbnpi
rbnpi / Marco_Uccellini-Bergamsaca-RF.rb
Last active September 12, 2020 18:38
Bergamasca by Marco Uccellini (1642) transcribed for Sonic Pi Hear it on https://soundcloud.com/rbnsonicpi/marco-uccellini-bergamusca
#Marco_Uccellini-Bergamsaca-RF.rb
#transcribed for Sonic Pi format from a MuseScore by Daniel Fubin
#https://musescore.com/user/17040701/scores/5460247
#Here I have transposed it to played down an octave. Robin Newwman Septmeber 2020
#play using run_file "/path/to/Marco_Uccellini-Bergamsaca-RF.rb"
use_transpose -12
with_fx :reverb,room: 0.8,mix: 0.6 do
use_synth :beep
@rbnpi
rbnpi / JosquinDePres.rb
Created September 7, 2020 19:55
Josquin de Pres Adieu mes Amours 1430 played by Sonic Pi hear it on https://soundcloud.com/rbnsonicpi/josquin-de-pres-adieu-mes-amours
#Josquin de Pres Adieu mes Amours 1480
use_synth :tri
r=0.95;s=0.15
use_bpm 160
with_fx :reverb,room: 0.7,mix: 0.6,amp: 1 do
with_fx :level, amp: 0.8 do
a1=[:G4,:Bf4,:A4,:G4,:D5,:C5,:Bf4,:C5,:Bf4,:r,:A4,:G4,:F4,:G4,:F4,:r,:C5,:Bf4,:A4,:Bf4,:G4,:A4,:G4,:A4,:Bf4,:A4,:G4,:F4,:E4,:r,:G4,:A4,:Bf4,:C5,:D5,:r,:C5,:Bf4,:A4,:Bf4,:A4,:Bf4,:A4,:G4,:F4,:G4,:r,:F4,:G4,:A4,:Bf4,:C5,:Bf4,:A4,:G4,:Bf4,:A4,:G4,:Fs4,:G4,:Bf4,:A4,:G4,:Bf4,:A4,:C5,:Bf4,:A4,:Bf4,:A4,:G4,:F4,:E4,:F4,:G4,:A4,:G4,:Bf4,:A4,:G4,:F4,:r,:r,:C5,:Bf4,:D5,:C5,:Bf4,:A4,:G4,:Bf4,:A4,:G4,:F4,:A4,:Bf4,:C5,:Bf4,:A4,:Bf4,:A4,:G4,:F4,:E4,:F4,:G4,:A4,:G4,:Bf4,:A4,:G4,:F4,:r,:E4,:D4,:G4,:Fs4,:G4,:Bf4,:A4,:G4,:D5,:C5,:Bf4,:C5,:Bf4,:r,:A4,:G4,:F4,:G4,:F4,:r,:C5,:Bf4,:A4,:Bf4,:G4,:A4,:G4,:A4,:Bf4,:A4,:G4,:F4,:E4,:r,:G4,:A4,:Bf4,:C5,:D5,:r,:C5,:Bf4,:A4,:Bf4,:A4,:Bf4,:A4,:G4,:F4,:G4,:r,:F4,:G4,:A4,:Bf4,:C5,:Bf4,:A4,:G4,:Bf4,:A4,:G4,:Fs4,:G4]
b1=[2.0,2.0,2.0,2.0,3.0,0.5,0.5,2.0,2.0,1.0,2.0,0.5,0.5,2.0,2.0,1.0,2.0,0.5,0.5,1.0,2.0,2.0,0.5,0.5,0.5,0.5,0.5,0.5,4.0
@rbnpi
rbnpi / The_Farie_Round-RF.rb
Last active September 3, 2020 18:49
The Farie Round (Galliard) by Antony Holborne 1545-1602 coded for Sonic PI Sept 2020. Hear it on https://soundcloud.com/rbnsonicpi/fairie-round
#The_Fairie_Round-RF.rb
#A Galliard by Antony Holborne 1545 – 1602
#coded for Sonic Pi by Robin Newman, September 2020
#play using run_file "path/to/The_Farie_Round-RF.rb"
use_bpm 198
with_fx :reverb,room: 0.8, mix: 0.7 do
with_fx :level,amp: 0.95 do |v|
set :v,v
r=0.075 #release fraction
in_thread do
@rbnpi
rbnpi / JazzeupInversions.rb
Last active August 14, 2020 18:17
JazzedupInversions plays with a sequence of chord inversions in Sonic Pi. Hear it on https://soundcloud.com/sc3rbnman/jazzedupinversions
#JazzedupInversions by Robin Newman, August 2020
#started playing with chord inversions and ended up with this.
#corrected for current with_merged_synth_defaults bug in ver 3.2.2
use_bpm 60 #initial tempo
with_fx :reverb, room: 0.8,mix: 0.7 do
with_fx :ixi_techno,mix: 0.4 do
live_loop :arps do
#code to speed up and slow down tempo again
bpmchange=((knit 2,20)+(knit -4,10)).tick(:speed)
use_bpm current_bpm + bpmchange
@rbnpi
rbnpi / GoodBadUgly-RF.rb
Last active April 29, 2022 15:09
The Good the Bad and the Ugly theme by Ennio Morricone on Sonic Pi (play using run_file command) Listen at https://soundcloud.com/sc3rbnman/goodbadugly
#GoodBadUgly-RF.rb
#coded by Robin Newman, July 2020
#use run_file "path/to/GoodBadUgly-RF.rb"
with_fx :reverb, room: 0.8 do
use_synth :pluck
with_fx :compressor,amp: 2 do
a1=[]
b1=[]
a1[0]=[:r,:r,:r,:r,:r,:r,:r,[:G3,:B3,:E4],:r,[:G3,:B3,:E4],[:G3,:B3,:E4],[:G3,:B3,:E4],:r,[:G3,:B3,:E4],:r,[:G3,:B3,:E4],[:G3,:B3,:E4],[:G3,:B3,:E4],:r,[:G3,:B3,:E4],:r,[:G3,:B3,:E4],[:G3,:B3,:E4],[:G3,:B3,:E4],:r,[:G3,:B3,:E4],:r,[:G3,:B3,:E4],[:G3,:B3,:E4],[:G3,:B3,:E4],:r,:r,:r,[:G3,:B3,:E4],:r,[:G3,:B3,:E4],[:G3,:B3,:E4],[:G3,:B3,:E4],:r,[:G3,:B3,:E4],:r,[:G3,:B3,:E4],[:G3,:B3,:E4],[:G3,:B3,:E4]]