Skip to content

Instantly share code, notes, and snippets.


Robin Newman rbnpi

  • Near Peterborough
View GitHub Profile
rbnpi / BeatusVirControlled-RFAuto.rb
Created Jan 27, 2017
Sonic Pi processing remote control GUI
View BeatusVirControlled-RFAuto.rb
`/usr/local/bin/sonic_pi stop`
`/usr/local/bin/sonic_pi "run_file '~/Documents/SPfromXML/BeatusVirControlled-RF.rb'"`
rbnpi / MarenzioMadrigal1.rb
Last active Aug 4, 2022
Sonic Pi plays 3 16th Century madrigals by Luca Marenzio, arranged for 5 trumpets. uses sample based voices, and features dynamic level variation. Requires SP 2.5 or later. Sample download at
View MarenzioMadrigal1.rb
# Luca Marenzio Madrigal 1553-1599 "Togli dolce ben mio" arranged for 5 trumpets coded for by Robin Newman, April 2015
#uses sample based voice, and also has variable dynamic settings for each part and final rit.
#requires version >=2.9
#Sample requires can be downloaded from
#This version altered for syntax changes. Wrosk with later versions of SP
use_debug false
path= '~/Desktop/samples/Marenzio/' #path to sample folder
#first deal with selecting and setting up the sample
inst0 = 0 #first (in fact only) sample in folder
rbnpi / SonicPiTocAndFugue-RF.rb
Last active Jul 27, 2022
Bach Toccata and Fugue played by Sonic Pi. Use run_file "/path/to/SonicPiTocAndFugue-RF.rb" to play. Hear it on
View SonicPiTocAndFugue-RF.rb
#BachTocAndFugue-RFrb (latest version)
#coded by Robin Newman from an arrangement by Guillaume Bentaieb
start = 0 #section to start playing from (fugue stats at 6)
#note data part0 (a few extra notes from part 1 which required this to play on Sonic Pi)
rbnpi / HouseOfTheRisingSunVer2.rb
Created Aug 18, 2015
HouseOfTheRisingSun-ver2.rb coded for Sonic Pi. Based on score by M Ludenhoof at,_Martin). Requires SP 2.6 or later. Hear it at This version has a different verse structure and varied instrument mix.
View HouseOfTheRisingSunVer2.rb
#House of the Rising Sun, coded for Sonic Pi by Robin Newman, August 2015
#Based on version by M Ludenhoof at,_Martin)
#Creative Commons 3.0 licence. One or two notes modified.
#version 2. Different play structure, and alternative instrument formiddle section
use_debug false
#samples used with their natural pitches
rbnpi /
Last active Jul 4, 2022
Sonic Pi program to display lissajous figures controlled by TouchOSC. Requires SP 2.12 midi-alpha6 or later. Video with details at

This program runs on Sonic Pi midi version. It works on SP 2.12-midi-alpha6 released recently to patreon subscribers of Sam Aaron see It also requires the program TouchOSC which is available for iPad or iPhone users at a very modest price. The TouchOSC file required to run this program is contained in the file index.xml To produce the TouchOSC file, download the raw file index.xml, right click it and select the Compress function. Rename the resulting file SPlissajous.touchosc and say Yes when it asks if you want to change the file extension. Open the file using the TouchOSC editor and download it to your iPad or other compatible device using the sync function. The layout is designed to fit on an iPhone or iPad. The SPlissajousTouchOSC.rb file should be downloaded and opened or pasted into a blank Sonic Pi buffer.

rbnpi / 8NotePolyphonicSetup.rb
Last active May 31, 2022
8 note polyphonic gated synths for Sonic Pi 3. Allows keyboard input with notes of any length. Requires SP3, and powerful computer at present: not Raspberry Pi. Article at video at
View 8NotePolyphonicSetup.rb
#8 note polyphony gated synth setup program
#by Robin Newman, August 2017
#Set initial states for polyphonic synth
set :vm1,0
set :vm2,0
set :vm3,0
set :vm4,0
set :vm5,0
set :vm6,0
set :vm7,0
rbnpi / ThereminPlus.rb
Last active May 30, 2022
Sonic Pi Theremin utilising two ultrasonic sensors. See post at and video at for details.
View ThereminPlus.rb
#Theremin plus, controlling pitch and ixi_techno phase by Robin Newman May 2018
#/osc/ changed to /osc*/ in line 24 to work with latest Sonic Pi Aug 2021
#I control a continously playing note (length 2000)
use_debug false
define :putsPretty do |n,p|
return num
rbnpi / GoodBadUgly-RF.rb
Last active Apr 29, 2022
The Good the Bad and the Ugly theme by Ennio Morricone on Sonic Pi (play using run_file command) Listen at
View 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
rbnpi / recordplaybackmidi.rb
Last active Apr 27, 2022
Experimental program to record realtime midi input in Sonic Pi and subsequently play it back. Video on youtube
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 EDITED April 2022 for updated midi message handling
uncomment do #comment to record, uncomment to replay
puts tlist.length
puts tlist
rbnpi / FrereSonatina.rb
Last active Apr 22, 2022
Using Sonatina Symphonic Library with Sonic Pi. Illustrated with a 19 voice round of Frere Jaques. Requires SP ver 2.10 or later an the Symphonic Library from Full article on this program at
View FrereSonatina.rb
#program to utilise 48 different sample voices from Sonatina Symphonic Library
#written by Robin Newman, March 2016
#requires Sonatina Symphonic Library from
#requires Sonic Pi ver 2.10
#plays 19 voice Frere Jqeus round!
#tested on Pi2, Pi3, Mac OSX and Windows 10.
#updated to handle new thread structure in SP2.11dev
use_debug false
#path to library samples folder (including trailing /)
path='~/Desktop/Sonatina Symphonic Orchestra/Samples/'