-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_commands.rb
More file actions
52 lines (41 loc) · 855 Bytes
/
basic_commands.rb
File metadata and controls
52 lines (41 loc) · 855 Bytes
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
# Basic commands
# Play a note
##| play 60 # plays the C of the 4th octave
##| play :C # plays the C of the 4th octave
# Play chord
##| play chord(:E3, :m7)
# arpeggios
##| play_pattern chord(:E3, :m7)
# scales
##| play_pattern_timed scale(:c3, :major), 0.125, release: 0.1
##| Loop
##| 4.times do
##| sample :drum_heavy_kick
##| 2.times do
##| sample :elec_blip2, rate: 2
##| sleep 0.25
##| end
##| sample :elec_snare
##| 4.times do
##| sample :drum_tom_mid_soft
##| sleep 0.125
##| end
##| end
##| Functions
##| define :foo do
##| play 50
##| sleep 1
##| play 55
##| sleep 2
##| end
##| 5.times do
##| foo
##| end
##| With params
##| define :chord_player do |root, repeats|
##| repeats.times do
##| play chord(root, :minor), release: 0.3
##| sleep 0.5
##| end
##| end
##| chord_player :e3, 4