The Sonic Pi Challenge is over.
Thank you to everyone who took part.
You can view Sam's final live-coded DJ set here incorporating some of your snippets 🤘
OK, this is going to be fun. It calls for some awesome ascii-art!
# ██ ██ ███ ██ ██ ██ ██ ███████ ██████ ███████ ███████ ██████ ██████ ██████ ██████
# ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ████
# ██ ██ ██ ██ ██ ██ ██ ██ █████ ██████ ███████ █████ █████ ██ ██ ██ █████ ██ ██ ██
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██
# ██████ ██ ████ ██ ████ ███████ ██ ██ ███████ ███████ ███████ ██████ ███████ ██████
#
# ╘
# ─ ╛▒╛
# ▐╫ ▄█├
# ─╟╛ █▄ ╪▓▀
# ╓┤┤┤┤┤┤┤┤┤ ╩▌ ██ ▀▓▌
# ▐▒ ╬▒ ╟▓╘ ─▓█ ▓▓├
# ▒╫ ▒╪ ▓█ ▓▓─ ▓▓▄
# ╒▒─ │▒ ▓█ ▓▓ ─▓▓─
# ╬▒ ▄▒ ╒ ╪▓═ ╬▓╬ ▌▓▄
# ╥╒ ╦╥ ╕█╒ ╙▓▐ ▄▓╫
# ▐╩ ▒▒ ▀▀
# ╒╪ ▐▄
#
# _____ __ ____ __
# / ___/____ ____ /_/____ / __ \/_/
# \__ \/ __ \/ __ \/ / ___/ / /_/ / /
# ___/ / /_/ / / / / / /__ / ____/ /
# /____/\____/_/ /_/_/\___/ /_/ /_/
#
# ___ _ _
# / __\ |__ __ _| | | ___ _ __ __ _ ___
# / / | '_ \ / _` | | |/ _ \ '_ \ / _` |/ _ \
# / /___| | | | (_| | | | __/ | | | (_| | __/
# \____/|_| |_|\__,_|_|_|\___|_| |_|\__, |\___|
# |___/
Let's get started. Hello! I'm Sam Aaron.
I created a thing called Sonic Pi which lets you turn code into music.
As part of GitHub Universe 2020 I delivered an introductory workshop on how to start live coding synths and beats with Sonic Pi.
(You may have already watched it, in which case, hello again!).
In that workshop I issued a challenge to get you to write a bit of code which I could use in my live performance. Once I have all the submissions I'll choose a nice selection of them to incorporate into my performance.
All entries will feature in a public repo so everyone will be able to jam with, mash it up and perhaps even perform your live coding debut with it at an upcoming conference.
- An open mind
- Some headphones
- A computer with Sonic Pi installed
- Willingness to share with others.
Write a short riff/melody using (scale :E, :minor_pentatonic)
.
That's really all there is to it. It can be in any style, using any synth, sample or FX that Sonic Pi offers. Ideally your riff is fairly short (otherwise if I use it I might have to trim it). This means that your code doesn't have to be very long just 3-4 lines is perfectly acceptable.
All submissions will be considered for the performance - especially very simple coded riffs.
Note that using your own samples isn't available as an option in this challenge as I won't have access to your personal sample files.
Once you've coded up your riff(s), all you need to do is to submit a pull request to this repository. Add your file(s) to the snippets
directory named with the pattern USERNAME_ID.rb
e.g. leereilly_01.rb
and leereilly_02.rb
.
Please note: All submissions are under the CC0-1.0 license. This should be your own work or work that you have the right to contribute.
- All submissions will be considered.
- Simple code is just as likely to be picked as complex code.
- Ideally the sound should play for no more than 10 seconds (any submission I use might be trimmed).
- Submissions can only be text files with the code.
- Only code covered in The Sonic Pi Tutorial will be considered.
- Have fun! Share your coded riff with your friends and see what they think!
OK, so you want to get started?
Next you might want to check out The Sonic Pi Tutorial.
I would suggest whizzing through Section 2 on Synths and the start of Section 5 on Programming Structures especially the section on iteration and loops.
Essentially you'll just need to understand play
and sleep
and which
notes to use.
The :e
:minor_pentatonic
scale includes the following
notes:
[28, 31, 33, 35, 38, 40, 43, 45, 47, 50, 52, 55, 57, 59, 62, 64, 67, 69, 71, 74, 76]
So whenever you call play
be sure to use one of these notes. For example:
# A Valid Entry
play 28
sleep 0.5
play 33
sleep 0.5
play 59
sleep 0.125
play 45
Of course, you might want to embellish your riff by using use_synth
to
change the synthesiser, use the release:
opt to change the length of
each note, use randomisation to choose one of a set of notes: [45, 52, 64, 71].choose
,
bring in samples,
use FX blocks and anything
else you find fun. If it's included in the Sonic Pi tutorial then it's
fine to use it in your submission.
So experiment and play!
The following are a few example submissions you can either use as starting points for your own or inspiration to sow creative seeds into your mind.
# Random Riff
use_random_seed 409832
8.times do
play (scale :e3, :minor_pentatonic).choose, release: rand
sleep 0.125
end
# Simple Ditty
use_synth :dsaw
play 28, release: 2
sleep 0.5
play 33, release: 0.5
sleep 0.5
play 59, release: 0.1
sleep 0.125
play 45, release: 1
# Random Rhythm Riff w/ FX
with_fx :reverb, room: 1 do
use_random_seed 23001055
use_synth :square
8.times do
play (scale :e1, :minor_pentatonic).choose, release: rand
sleep [0.125, 0.25].choose
end
end
Once you have your submission please submit a pull request adding your riff/melody to the snippets
directory named username_01
, where username is your GitHub username and 01 is just a unique identifier in case you have multiple submissions.
Please note: All submissions are under the CC0-1.0 license. This should be your own work or work that you have the right to contribute.
Thanks so much for taking part, live coding your own riff and sharing it with us. Please do tune into the performance to see if your submission will feature!
Take care and please do consider joining our friendly community: http://in-thread.sonic-pi.net