File: 03.1-Triggering-Samples.md

package info (click to toggle)
sonic-pi 3.2.2~repack-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 71,872 kB
  • sloc: ruby: 30,548; cpp: 8,490; sh: 957; ansic: 461; erlang: 360; lisp: 141; makefile: 44
file content (63 lines) | stat: -rw-r--r-- 1,498 bytes parent folder | download | duplicates (4)
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
56
57
58
59
60
61
62
63
3.1 Triggering Samples

# Triggering Samples

Playing beeps is only the beginning. Something that's a lot of fun is
triggering pre-recorded samples. Try it:

```
sample :ambi_lunar_land
```

Sonic Pi includes many samples for you to play with. You can use them
just like you use the `play` command. To play multiple samples and notes
just write them one after another:

```
play 36
play 48
sample :ambi_lunar_land
sample :ambi_drone
```

If you want to space them out in time, use the `sleep` command:

```
sample :ambi_lunar_land
sleep 1
play 48
sleep 0.5
play 36
sample :ambi_drone
sleep 1
play 36
```

Notice how Sonic Pi doesn't wait for a sound to finish before starting
the next sound. The `sleep` command only describes the separation of the
*triggering* of the sounds. This allows you to easily layer sounds
together creating interesting overlap effects.


## Discovering Samples

There are two ways to discover the range of samples provided in Sonic
Pi. First, you can use this help system. Click on Samples in the menu at
the bottom of this help screen, choose your category and then you'll see
a list of available sounds.

Alternatively you can use the *auto-completion system*. Simply type the
start of a sample group such as: `sample :ambi_` and you'll see a
drop-down of sample names appear for you to select. Try the following
category prefixes:

* `:ambi_`
* `:bass_`
* `:elec_`
* `:perc_`
* `:guit_`
* `:drum_`
* `:misc_`
* `:bd_`

Now start mixing samples into your compositions!