Advanced Topics 1
In addition to the sample slicing presented in the previous topic, you can also use the audio effect
:slicer to add some “rhythmic and chops” to your music. It basically alters the volume of the sound over time (and this effect is often called amplitude modulation). Now let’s start our experiment with this effect by creating a new
live_loop in an empty buffer and use the sample
:loop_breakbeat as our building block:
The loop should now sound the same as in the video below. We are using the red color to indicate the volume of the sound and in this example it should be at maximum.
Now let’s add the slicer effect to the
live_loop by using the familiar
with_fx command. If you don’t remember or know how the effects are used in Sonic Pi, you can read more about them in the previous chapter called Effects.
Now the newly added slicer effect sounds too harsh and we’ll need to tune it a little bit. The main options of the slicer effect are
mix. You can use them to control the amplitude modulation. The option
phase is the frequency how fast or slow the amplitude modulation occurs. The default value for
0.25 which means that the effect occurs every 1/16th note. Because of this the previous example sounded rather hectic.
Slicer effect can modulate the amplitude by using four different waveforms:
2 (triangle) and
3(sinewave). By default,
wave is set to
1 which means that is uses pulse (also known as square) wave to modulate the amplitude. The pictures below illustrate what the waveforms look like and how they increase or decrease the amplitude (area marked with red color) over time.
Now let’s try to change the waveform to the saw (
wave: 0). This should make the effect a little bit smoother and less abrupt.
Let’s double the duration of the phase (
phase: 0.5) and switch the waveform to pulse (
Now what happens if we use the following options (
phase: 0.5, wave: 1) with the effect:
This way it’s quite easy to add some rhythm, variance and dynamics to the drum loops. Remember that you can also use this with the synthesizers in Sonic Pi!
Here is the last slicer effect example that uses longer phase times with the slicer effect: