-
Notifications
You must be signed in to change notification settings - Fork 0
/
workspace_zero.spi
57 lines (47 loc) · 1.26 KB
/
workspace_zero.spi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Welcome to Sonic Pi
set_volume! 0.66
set_mixer_control! hpf: 21
use_sched_ahead_time 1
#use_real_time
use_bpm :link
set_link_bpm! 60
# syncronize to bar or beat
live_loop :met do
puts "current bpm " + current_bpm.to_s
4.times do |bar|
puts "bar no: " + (bar + 1).to_s
cue :bar
4.times do |beat|
puts "beat no: " + (beat + 1).to_s
cue :beat
sleep 1
end
end
end
#midi_chord chord(:c4,:major), sustain: 0.2
#sleep 8
#midi_chord chord(:c1,:major), sustain: 8.0, port: "midi_through_midi_through_port-0_14_0", channel: 1
# e.g. arpeggiate [4,2,3], :d3, :major, [0,1,2,3,4], 4, 80
#4.times do
#in_thread(name: :piano) do
# use_midi_defaults port: "midi_through_midi_through_port-0_14_0", channel: 1
# midiarpeggiate [4,2,4], :d3, :major, [0,1,2,3], 4, 80
# midiarpeggiate [4,2,4], :g3, :major, [0,1,2,3], 4, 80
#end
#in_thread(name: :banjo) do
# use_midi_defaults port: "midi_through_midi_through_port-0_14_0", channel: 3
# midiarpeggiate [4,2,4], :a4, :major, [0,1,2,3], 4, 80
# midiarpeggiate [4,2,4], :d4, :minor, [0,1,2,3], 4, 80
#end
live_loop :kick_drum do
loop do
sample :bd_boom, rate: 0.5
sleep 0.75
play 32
sleep 0.75
sample :drum_tom_lo_soft
sleep 1
sample :drum_tom_lo_soft
sleep 1.5
end
end