Skip to content

Instantly share code, notes, and snippets.

@d0lfyn
d0lfyn / 20210213-sections.rb
Last active November 27, 2021 16:27
Sections for Sonic Pi
## sections
# first functions
define :getMirrorRange do |pNum|
return [-pNum, pNum];
end
## constants ===================================================================
# A coding study done with Sonic Pi exploring the Drum'n'Bass genre.
# I used a sample from freesound.org, a female voice singing 'Shireau' to be
# found at (https://freesound.org/people/maurolupo/sounds/212669/) and some drumsamples
# from Partners In Rhyme (look for: Free Drum Loop Downloads: Drum 'n' Bass).
# Shireau
use_bpm 170
hihats = "~/projects/sonicpi/audio/samples/looplords/07/"
@rbnpi
rbnpi / ReadMe.md
Last active August 4, 2023 14:35
Sonic Pi Record / Player version 1.2 (not Pi3 friendly) See REadMe file.

Sonic Pi Record / Player version 1.3

This version is updated to work on SP 3.2 or greater. This involves a change which is detailed in teh comments at the beginning of the program. The TouchOSC template is unchanged. I have left it as a MkI TouchOSC file , but you can load it into the latest TouchOSC and it will automatically concert from a .touchosc file to the new .tosc format which will only work in the new version of TouchOSC.

The two other files enable a TouchOSC interface to be used with Sonic Pi 3 and above to allow notes to be played on Sonic Pi, and also recorded in real time for subsequent replay. Recordings can also be stored in files on your computer.

The Sonic Pi program is too long to run in a buffer, and should be run using the run_file command eg

run_file "/path/to/file/recordplayercombined-RF.rb"
@Nanomancer
Nanomancer / eastern_pluck.rb
Last active May 12, 2020 20:13
Here's the code as it ran for recording the video 'Temple Of The Sixth - dark eastern ambient - sonic pi'
## Eastern pluck & 'safari' percussion
## Coded by Nanomancer
##| set_volume! 5
##| puts "SYNC"
##| sample :elec_blip, amp: 0.5
##| sleep 8
set_volume! 0.55
# set_mixer_control! amp: 0.1, amp_slide: 0.1