Skip to content

Instantly share code, notes, and snippets.

Avatar

Robin Newman rbnpi

  • Near Peterborough
View GitHub Profile
@rbnpi
rbnpi / RandomSampleFrereJaques.rb
Last active Oct 6, 2020
Sonic Pi pays Frere Jaques using onsets from a random sample file Hear it on https://soundcloud.com/sc3rbnman/randomsamplefrerejaques
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 https://freesound.org/search/?q=260832
@rbnpi
rbnpi / Salomone_Rossi_Corrente-RF.rb
Created Sep 20, 2020
seven Corrente by Salomone Rossi 1613 transcribed for Sonic Pi from a MuseScore by w8erw Hear it on soundcloud.com
View Salomone_Rossi_Corrente-RF.rb
#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
View Salomone_Rossi_Bergamasca_Canzona-RF.rb
#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
View Francesco_Turini_Triosonata_Il_Corisino-RF.rb
#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 Sep 12, 2020
Bergamasca by Marco Uccellini (1642) transcribed for Sonic Pi Hear it on https://soundcloud.com/rbnsonicpi/marco-uccellini-bergamusca
View Marco_Uccellini-Bergamsaca-RF.rb
#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 Sep 7, 2020
Josquin de Pres Adieu mes Amours 1430 played by Sonic Pi hear it on https://soundcloud.com/rbnsonicpi/josquin-de-pres-adieu-mes-amours
View JosquinDePres.rb
#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 Sep 3, 2020
The Farie Round (Galliard) by Antony Holborne 1545-1602 coded for Sonic PI Sept 2020. Hear it on https://soundcloud.com/rbnsonicpi/fairie-round
View The_Farie_Round-RF.rb
#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 Aug 14, 2020
JazzedupInversions plays with a sequence of chord inversions in Sonic Pi. Hear it on https://soundcloud.com/sc3rbnman/jazzedupinversions
View JazzeupInversions.rb
#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 Aug 15, 2020
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
View GoodBadUgly-RF.rb
#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]]
@rbnpi
rbnpi / recordplaybackmidi.rb
Last active Nov 29, 2020
Experimental program to record realtime midi input in Sonic Pi and subsequently play it back. Video on youtube https://youtu.be/0hq2L_ADen8
View recordplaybackmidi.rb
#program to record realtime midi input,and then replay it.
#records midi input from say a keyboard, saving data into array tlist
#this can then be replayed. Records, note pitch, time started,
#velocity of key and note duration.
#coded by Robin Newman April 2020
uncomment do #comment to record, uncomment to replay
tlist=get(:tlist)
puts tlist.length
puts tlist
You can’t perform that action at this time.