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F.rb
#arranged for Sonic Pi by Robin Newman, December 2018
#use run_file "path/to/tallis40part-RF.rb" to run it.
define :pl do |nt,durs,pan,vol=0.2|
in_thread do
nt.zip(durs).each do |n,d|
play n,attack: 0.1,sustain: d*0.9,release: d*0.1,pan: pan,amp: vol
sleep d
end
end
View SP-KeyboardController2.rb
#SP-KeyboardController2.rb
#experimental program to control Sonic Pi from the keyboard
#developed from an orbianl program written by Robin Newman, April 2016
#you can play notes direct, or initiate any of 10 liveloops
#now updated to use OSC communiation from the key polling program
#set up hash to contain notes
notes=Hash.new
#list of notes
l=[:c4,:cs4, :d4, :ds4, :e4, :f4, :fs4, :g4, :gs4, :a4, :as4, :b4, :c5, :cs5, :d5, :ds5, :e5, :f5, :fs5, :g5]
View Spirograph.py
#Author: marktini github.com/marktini
#Spirograph curve drawing program
#Version 1.0
#modified to Python3 by Robin Newman Dec 2018
#additions to allow export of x,y coords using OSC message
#with aid of pythonosc library
import math
import turtle
import random
import time
View BerliozShepherdsFarewell.rb
#ShepherdsFarewellBerliozMIDI-RF.rb
#arranged for Sonic Pi by Robin Newman November 2018
#played by virtual midi piano, audio fed back to Sonic Pi
#as live_audio input
with_fx :reverb,amp: 3,pre_amp: 1,room: 0.8,mix: 0.6 do
live_audio :min,stereo: true
end
#function to play midi notes/duration lists with optional transpose
define :mplay do |notes,durs,channel,tr,vel=100|
View apcOSC1.rb
#apcOSC1.rb
#Sonic Pi 3 automated parameter control for fx calls controlled by TouchOSC
#developed from an idea by Martin Butz. Code developed by Robin Newman, November 2018
use_osc "192.168.1.240",9000 #address of TouchOSC and input port
#initialise some parameters
#these will be updated further by signals from TouchOSC
set :start,0
set :finish,0.5
set :dur,1
set :type,:fade
View apcPROG.rb
#apcPROG.rb
#Sonic Pi 3 automated parameter control for fx calls controlled by TouchOSC
#inspired by Martin Butz. Code developed by Robin Newman, November 2018
#programatically controlled fadeing of fx opt levels
use_random_seed 886543
#setup some starting values
set :kill,false
set :finishTime,120 #duration set for the piece
#start values for next input AFTER the initial fade of the 5 fx used
View fxControlDemo.rb
#fxControlDemo.rb
#This program demonstrates the control of fx parameters to give smooth fades
#in their effects. Prompted by a thread https://in-thread.sonic-pi.net/t/smooth-parameter-automation/1626
#started by Martin Butz
#Martin Butz's original fade function renamed, and simplified
#for only two fade types fade and wave
#fade up or down is selected automatically from the relation#
#between start and finish values
define :fadeSteps do |start, finish, len, type|
View broadcastOSC.py
#!/usr/bin/env python3
#broadcast received OSC message
#written by Robin Newman, October 2018
#designed for use with Sonic Pi 3
#requires python-osc
#install with sudo pip3 install python-osc
import argparse
from pythonosc import osc_message_builder
from pythonosc import udp_client
from pythonosc import dispatcher
View SchubertSerenade-RF.rb
#SchubertSerenade-RF.rb
#arranged for Sonic Pi by Robin Newman, October 2018
#based on a midi file by Fred Nachbaur (creative Commons 3)
#downloaded from hz.imslp.info/files/imglnks/usimg/0/09/IMSLP208409-WIMA.d249-Standgit.mid
#first edited in MuseScore 3.2 and then parts converted to Sonic Pi format
#using a processing script
use_bpm 85
with_fx :reverb,room: 0.8,mix: 0.7 do
with_fx :level,amp: 1.5 do
with_fx :level,amp: 0.6 do