Skip to content

Instantly share code, notes, and snippets.

@c0deaddict
Created April 11, 2022 07:34
Show Gist options
  • Save c0deaddict/237c8f547778894f76832cbc6f06e2ed to your computer and use it in GitHub Desktop.
Save c0deaddict/237c8f547778894f76832cbc6f06e2ed to your computer and use it in GitHub Desktop.
sonic-pi-workshop.md

Sonic Pi workshop

Basics

play 60
play :c
sleep 1
play :e

Herhalingen

2.times do
  play :c
  sleep 0.5
  play :d
  sleep 0.5
  play :e
  sleep 0.5
  play :c
  sleep 0.5
end

Andere instrumenten

Synths ontdekken: Help => Synths

use_synth :fm
use_synth :saw
use_synth :blade
use_synth :tb303
use_synth :hoover
use_synth :mod_dsaw
use_synth :mod_pulse

2.times do
  play 60
  sleep 0.5
  play 67
  sleep 0.5
end

Samples

sample :loop_industrial
sample :bd_haus
sample :guit_e_slide
sample :drum_cymbol_closed

2.times do
  sample :loop_amen
  sleep 1.753
end

Live loops

Live aanpassen: druk op "run", de volgende loop hoor je je aanpassingen. Vloeiend!

use_bpm 60

live_loop :kick do
  sample :bd_haus, rate: 1
  sleep 0.5
end

live_loop :snare do
  sleep 0.5
  sample :sn_dolf
  sleep 0.5
end

live_loop :hihat do
  sample :drum_cymbal_closed
  sleep 0.25
end

Effecten

with_fx :reverb do
  with_fx :wobble do
    sample :guit_e_fifths
  end
end

Random

4.times do
  play [:c, :d, :e].choose
  sleep 0.25
end

Tick

Noten op volgorde afspelen.

live_loop :melodie do
  play [:c, :d, :e, :f].tick
  sleep 0.5
end

Chords

play 57
play 60
play 64

play (chord :a3, :minor)

live_loop :first do
  play chord(:a3, :minor).choose, attack: 0, release: 0.3, cutoff: 80
  sleep 0.2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment