Wykonanie jednego z następujących wariantów wymagań:
Ciekawostka: ZTM Poznań udostępnia też trasy tramwajów, z odstępami między przystankami, pozwalając na stworzenie rekreacji przejazdu tramwajem.
Wstępne ładowanie długich plików audio: load_sample
use_synth :blade
live_loop :test do
sample :loop_amen, beat_stretch: 4
play_pattern_timed(ring(:f4, :f5, :e4, :e5), 1)
end
sample :loop_breakbeat, rate: 1
sleep sample_duration(:loop_breakbeat, rate: 1)
sample :loop_breakbeat, rate: 0.5
sleep sample_duration(:loop_breakbeat, rate: 0.5)
sample :loop_breakbeat, rate: 2
sleep sample_duration(:loop_breakbeat, rate: 2)
sample :arovane_beat_a, start: 0, finish: 0.1
sleep sample_duration(:arovane_beat_a, start: 0, finish: 0.1)
sleep 1
sample :arovane_beat_a, start: 0.9, finish: 1
sleep sample_duration(:arovane_beat_a, start: 0.8, finish: 1)
Poniższy przykład zakłada, że plik znajduje się w tej samej ścieżce co Sonic Pi. Rekomendowanym jest używanie pełnych ścieżek (absolute path).
Windows: \
należy zamienić na \\
: ścieżka "C:\Users\test\test.wav"
na "C:\\Users\\test\\test.wav"
use_bpm 60
tomatoes = "tomatoes.wav"
sample tomatoes, pitch: 12
sleep sample_duration(tomatoes)
12.times do |n|
rate = 1 + 0.25 * n
s = 0.4
f = 0.67
sample tomatoes, start: s, finish: f, rate: rate, lpf: :c7
sleep sample_duration(tomatoes, rate: rate, start: s, finish: f)
end
sample tomatoes, rate: 0.8, attack: 0, decay: 0, sustain: 0, release: sample_duration(tomatoes)
# W przypadku fxów pomaga wcześniej załadować:
load_sample "tomatoes.wav"
with_fx :panslicer, smooth: 0.25 do
with_fx :reverb do
with_fx :flanger do
with_fx :ring_mod do
sample "tomatoes.wav"
end
end
end
end