View SpeakingMusicalClock.rb
#Sonic Pi playing and speaking clock by Robin Newman version 0.8
#requires samples saying zero,1-20,30,40 and 50 saved in that order in a folder
#uses Ruby Time.now function to get time info. This is split up by functions
#hours, mins and secs to give three integer values (24 hour clock)
use_debug false
use_sched_ahead_time 0 #important no delays for a clock!
#adjust next four lines to select options
set :enabletenths,true
set :enablesecs,true
set :enablespeech,true
View sensetestserver.py
from sense_hat import SenseHat, ACTION_PRESSED, ACTION_HELD, ACTION_RELEASED
from signal import pause
from pythonosc import osc_message_builder
from pythonosc import udp_client
from pythonosc import dispatcher
from pythonosc import osc_server
import argparse
import sys
x = 3
View Hexome.rb
#hexome.rb based on a project by Mike Smith in The Magpi issue 58, replacing processing with Sonic Pi 3
#Written by Robin Newman
use_debug false
use_midi_logging false
use_cue_logging false
use_arg_checks false
use_osc_logging true
use_osc "172.20.10.5",9000 #change to match address of your TouchOSC device
#setup up sample locations
path="~/Documents/Processing/hexome/Hexome_Sim/data" #adjust to suit your system
View InspiringPiSound.rb
#inspiring sonic pi driver
#start sudo inspserver.py --ip 172.20.10.6 on client
use_osc "localhost",4559 #osc destination for the local machine
remote_ip_address="172.20.10.6" #adjust this for your setup.
# uncomment next to lines to shutdown client raspberry pi
##| osc_send remote_ip_address,8000, "/hello/shutdown"
##| stop
use_bpm 140 #initial setting of bpm (set to 160 by the first bpm_mul
View BachBWVV811Gavotte-RF.rb
#Bach BWV8111 Gavotte I, II transcribed for Sonic Pi by Robin Newman, December 2017
#This took me lnoger than useual because of the time to track down some missing rests in part 3
#I used varions functions below, used at end to do this. Left there for future reference
#I spread the right and left hands slightly in the stereo spectrum and also
#added some reverb.
#I played with the sustain/release settings for each hand, to give a slightly more staccato effect in the playing.
#Need to use run_file "/path/to/this/filename" to execute from a Sonic Pi buffer
use_debug false
#################################### debugging routing follow
View VisualFrereJaques.rb
#Frere jaques with visualization in Processing
#written by Robin Newman, December 23rd 2017
#info from Sonic Pi transmitted in OSC messages to drive the processing sketch
#A 4 part round is played, and each part is represented by a separate column
#the colour of each part varies with pitch as does the vertical postion of each note
#The radius of each "note" depends on its duration.
nmax=2 #number of iterations of Frère Jaques played
use_osc_logging true
#note and duration data for Frère Jaques
nf=[:c4,:d4,:e4,:c4]*2+[:e4,:f4,:g4]*2+[:g4,:a4,:g4,:f4,:e4,:c4]*2+[:c4,:g3,:c4]*2
View dm.rb
#dm.rb
#Drum pattern generator inspired by https://mynoise.net/NoiseMachines/polyrhythmBeatGenerator.php
#Control is by means of a TouchOSC screen on a tablet
#coded by Robin Newman, December 2017
#uses 10 components to a drum pattern, each playing at a different number of "hits' per cycle
#ranging from 1 to 10. Individual componetn volumes, pan positions and samples can be set
#a master volume is provided, and the tempo can be chosen from 5 values
#A start/stop sync button stops and starts the sequence at the beginning of a new cycle.
#Patterns can be saved in JSON tect files and restored, with two banks giving 20 files
#A safety enable save interloc prevents inadvertent overwriting.
View tomtom_rhythms.rb
#Tomtom rhythms found on wikipedia https://en.wikipedia.org/wiki/Rhythm_in_Sub-Saharan_Africa#/media/File:Standard_pattern,_six_beats.png
#form the basis of this piece coded for Sonic PI by Robin Newman, December 2017
l1=(ring 1,0,1,0,1,0,1,0,1,0,1,0)
l2=(ring 0,1,0,1,0,1,0,1,0,1,0,1)
l3=(ring 0,1,0,0,1,1,0,1,0,1,0,1)
l4=(ring 1,0,1,0,1,1,0,1,0,1,0,1)
l=(ring l1,l2,l3,l4)
set :kill,0 #initialise kill flag
View SonicPiControlsHELMsynth.rb
#program to illustrate interaction between HELM synth and Sonic Pi
#using midi, written by Robin Newman, December 2017
# HELM is a fantastic donateware synth, and you can control its settings
#using midi_cc messages, using HELM's learn midi assignment feature.
#this example uses an arpeggiating synth setting, and adjusts
#the arpeggio rate and the volume, synced to adjusting
#the BPM setting in Sonic Pi.
#The audio from HELM is fed back to Sonic Pi using live_audio
View FanfareForStCecilia'sHall-samples.rb
#Fanfare for St Cecilia's Hall by Andrew Blair, first performed 29th November 2017
#at the official opening of St Cecilia's Hall by HRH The Princess Royal, following a major refurbishment
#coded by Robin Newman, December 2017 with the composer's permission
#I am using code I developed to play samples from Sonatina Symphonic Library, but I have replaced
#the trumpet samples with ones I created myself, using the same file names.
#path to library samples folder (including trailing /)
path="~/Desktop/samples/Fanfare/"
#create array of instrument details