Sample Player
Sample Player Object
Renardo can also be used to sequence and manipulate audio samples. To do this all you need to do is use the special play() Player() object. Unlike synthesizer Player() objects, the first argument to play should be a string of characters, not numbers. As a result, more information can be encoded in the character string than the character itself means. Each character relates to a range of audio files such as kicks, hi-hats, snares, and other sounds. Each audio file will be stored in a buffer in SuperCollider.
To view which character relates to which audio file, execute:
There is a sound pack folder in Renardo called /samples/0_foxdot_default. This folder contains all characters named folders with samples. In order to use or create your own sample pack, you will need to name clone of the folder structure with top folder name like 1_my_samples, with path /samples/1_my_samples/. You can call samples from your own sample pack with the attribute spack:
The simplest drum pattern for disco is:
A character refers to a sound and whitespace is used for silence, so you can spread sounds out in time:
You also can use dots instead of whitespace:
Different types of brackets add more information to one sequence. Put two or more characters in round brackets, the sound alternates with the new loop one after the other, thus lacing sound samples:
The following is the same as ”-------=“:
Simple pattern example:
Nested brackets for more variety:
Putting characters in square brackets will play them all in the space of one beat, and will be played like one character, not simultaneous, but in quick succession
Play a triplet in the fourth beat:
and can be put in round brackets as if they were one character themselves.
Use square brackets in round brackets:
Use round brackets in squared brackets:
You can combine the brackets however you like: the following patterns are identical
Curly braces select a sample sound at random if you want more variety:
Angle brackets combine patterns to be play simultaneously:
Each character is mapped to a folder of sound files and you can select different samples by using the “sample” keyword argument:
Change the sample for each beat:
You can layer two patterns together - note the “P”, look at tutorial 4 for more information:
And change effects applied to all the layered patterns at the same time:
Example from the player tutorial, but with samples instead Conditionals…
Or change it to sample bank 2 by multiplying:
Chain multiple conditionals:
Which is the same as:
Attribute sample
Each character refers to a folder with same character. Folders with a letter as character contains 2 sub-folders namely upper and lower.
Those folders and sub-folders contain audio files, that can be called by play-Player() objects.
The audio files are arranged in alphabetical order. Use the sample attribute to select an audio file in this folder. Default is the first sample file in each folder, thus sample=0.
Like any other argument, sample can be a list (one at a time) or even a tuple (simultaneously) of values.
The example for a single character can be given within the character string itself by surrounding the character with a ”|” + the position number:
Play sample=2 for the letter ‘o’:
This will overwrite the specified value under sample:
The syntax can contain any of the parentheses previously used for the character and numbers.
Change the sample number:
Change the sign:
Play several different samples in one step:
Play a random sample:
If you decide to use several Player() objects to create e.g. a drum set, then it is recommended to use sample conventional, thus giving you a different way to change samples in time by using TimeVar() functions.
Layering sequences
You can also use < > signs to layer multiple sequences simultaneously. Let’s start with two separate sequences and then put them together in a single line of code.
Note: The *dot is equivalent to space. Like space, it is a placeholder that helps to better recognize temporal positioning
We can place any sequence between ”<>” characters in a single sequence and have them play at the same time:
This is equivalent to:
Zip can be understood as a zipper.
Each layer relates to the index in a group of values given to a Player()-object, each layer is affected only by one of those given values. This is best demonstrated by an example:
Pan each sequence hard on the left and right channels using square brackets in the pan attribute:
Expand the stereo effect by using round brackets:
Change the audio file used in the first layer:
Be careful when combining multiple layers with functions like offadd as this functions create new layers.
The following code will only affect the second layer, so the first layer is unaffected:
Try this!
Go through the characters and listen to the different examples available. Use the attribute sample=[:8]. The audio files or samples will be repeated if the character contains fewer than 9 samples (0-8 are 9 numbers) in the dedicated folder!
Name | Letter/Character |
---|---|
Kick | A v V x X W |
Snare/Rim | D i I o O t u |
Hihat | : = - a n N |
Clap/Snap | \ * h H |
Cymbal/Crash | / # e E |
Tom/Tom-like | m M p P w |
Percussion | & + d f l r R y |
SoundFX | \ b F k L Q Y z Z |
Voice | 1 2 3 4 ! < ? c C |
Bell | T |
Various | $ ; B g G j J K q U |
Noise | @ % |
Shaker | s S |
Ride | ~ |
Create a 16 beat rhythm with your preferred samples. Use Clock.bpm=120 to change the beat per minutes, or speed of rhythm in time!