Translate

sample :guit_em9, rate: 1
25/250
SourceTranslationState
1783
A.17 Sample Stretching
A.12 サンプルをスライスする
1784
Sample Stretching
サンプルをスライスする
1785
When people discover Sonic Pi, one of the first things they learn is how simple it is to play pre-recorded sounds using the `sample` function. For example, you can play an industrial drum loop, hear the sound of a choir or even listen to a vinyl scratch all via a single line of code. However, many people don't realise that you can actually vary the speed that the sample is played back at for some powerful effects and a whole new level of control over your recorded sounds. So, fire up a copy of Sonic Pi and let's get started stretching some samples!
1786
Slowing Samples Down
サンプル
1787
To modify the playback rate of a sample we need to use the `rate:` opt:
1788
sample :guit_em9, rate: 1
sample :guit_em9, rate: 1
1789
If we specify a `rate:` of `1` then the sample is played back at the normal rate. If we want to play it back at half speed we simply use a `rate:` of `0.5`:
1790
Notice that this has two effects on the audio. Firstly the sample sounds lower in pitch and secondly it takes twice as long to play back (see the sidebar for an explanation of why this is the case). We can even choose lower and lower rates moving towards `0`, so a `rate:` of `0.25` is a quarter speed, `0.1` is a tenth of the speed, etc. Try playing with some low rates and see if you can turn the sound into a low rumble.
choose:選択
1791
Speeding Samples Up
サンプル
1792
In addition to making the sound longer and lower using a small rate, we can use higher rates to make the sound shorter and higher. Let's play with a drum loop this time. First, take a listen to how it sounds at the default rate of `1`:
1793
sample :loop_amen, rate: 1
sample :loop_amen, rate: -1

Loading…

Loading…

Glossary

Source Translation
rate レート
playback rate 再生レート
Sample Packs サンプルパック

Source information

Flags
no-wrap
Source string location
A.17-sample-stretching.md:18
Source string age
a year ago
Translation file
etc/doc/lang/sonic-pi-tutorial-ja.po, string 1788
String priority
Medium
Failing checks