Synth Player
Synth Player Object
Renardo has a number of different virtual instruments available that you can use as player objects.
To have a look at the existing selection of Renardo SynthDefs, just execute:
Choose one and create a Renardo player object using the double arrow syntax like in the example below. In Renardo, all two-character variable names, such as p1
, zz
or k7
, are reserved for Player() objects. The variable can consist of 2 letters or 1 letter + 1 number (e.g. pp or s1).
The >> in Python is usually reserved for a type of operation, like + or -, but it is not the case in Renardo.
In the following example the variable p1 will create a Player()-Object using pluck as synth/instrument. Creating a Player Object with a synthesizer and no arguments will play a single note on middle C, by default, repeatedly until stopped.
To stop an individual player object, simply execute p1.stop(). To stop all player objects, you can press CTRL+., which is a shortcut for the command Clock.clear().
Attribute degree
If you want to play musical notes, you need to give your player object some arguments. In this unique case of SynthDef you do not need to use an attribute name to change the notes being played back.
The “notes” we give to a player, meaning in this case the numbers 0, 2, and 4 are called degree
. So the example above can be also look like this:
Use can use a TimeVar-Function to control the trigger of each note player over time. If you do not use any timing, it will be played each beat as default
Just add your beat timing behind your note list, if you want to change timing
Following allocation takes place:
Beat 0 –> Note 0 | Beat 4 –> Note 2 | Beat 8 –> Note 4 | Beat 12 –> Note 0 | Beat 16 –> Note 2 |…
To check which note is player at the moment, you cann use following code using degree within Pythons print() function:
Create another list with numbers to change the time of each of the notes separately:
You can group notes and variables by enclosing multiple values of arguments as tuple in round brackets. This is often used to play chords. In the following example we play 2 notes at the same time and expand the stereo effect in the pan attribute:
It is possible to transfer a note played by one SynthDef to another. In this example s2 adds a triad to every bass note played by s1:
In addition to .follow(), you can also use the .degree argument (without brackets) to follow other players:
It is also possible to manipulate degree by adding an array of numbers to the Player object.
This raises the 4th note played by 2 degrees:
And this raises every third note by 2:
These values can be laced and grouped together
This behaviour is particularly useful when using the follow method.
Next, you can schedule players to do things!
This will tell p1 to reverse the notes every 4 beats:
You can “chain” methods together by appending them to the end of the original line:
To stop calling “reverse”, use ‘never’:
Here are a few other methods you can use!
Using “stutter” will play the same note n number of times with different attributes specified
Rotate will move all the values over by 1 in their order:
To randomise the order of the notes, use “shuffle”:
Use other Attributes
Values assigned via named attributes shape the way the instrument sounds and is played. It is possible to use other arguments the same way like the examples above using degree. For example s1.oct, s1.dur and so on.
List all universal attributes:
List all attributes of a particular SynthDef:
List all default fx attributes of Player() object:
You can see what effects are available by evaluating
Let’s use the high pass filter for an example. You can see it’s described like so: “<Fx ‘highPassFilter’ — args: hpr, hpf>“
Each effect has a “master” argument and then child arguments. Here the master argument is “hpf” (short for high pass filter) and the child argument is “hpr” (short for high pass resonance). The effect is only added when the master argument is non-zero:
This sets the high pass filter to 4000 Hz so only frequences in the audio signal above that are actually heard. Let’s change the resonance value. It’s default value is 1, so let’s make it smaller:
Notice a difference? We can use patterns / vars in our effects to make them change over time:
In the following example octave oct is increased (Default is 5), the note playing time dur (Default is 1) and the volume amp varies (Default is 1).
Note: The standard octave in Renardo is 5, which in conventional music theory is 3!
Arguments can be integers, floating points, fractions, lists, tuples, or a mix
You can also assign values to the attributes of player objects directly
Here some more useful attributes you can use in handling your players
Play only this player, muting others
And turn the solo off
Stop (not just mute) the other players
Referencing Attributes
You can set variables outside a player
If you set the duration of the second, it might not have the desired effect
It is possible for one player object to play exactly what another player is. To have one player follow another, just use the follow method:
You can explicitly reference attributes such as pitch or duration too:
Works for other attributes too
You can reference, and test for the current value. The == returns a 1 if true and a 0 if false.
This allows you to do conditionals like:
Or change it to a different amp by multiplying by 4:
Chain multiple conditionals
Which is the same as
Rests
Rests can be added by using a rest object in the dur array. The rest silences the note that would have been played. Without a rest, 5 notes (yes, a dur=1 would work, but lets be explicit to counterpoint the next example)
With a rest … 4 notes and a rest, note “4” is silenced for 4 beats:
Attributes Reference
amp - Amplitude (defaults to 1)
Sets the volume of the note/pattern
Half Volume
Creating a pattern with amp
amplify - Changes amp, by multiplying agasint the existing value (instead of overwritting)
Creating a pattern with amp
Set up a “drop” in the music (Plays at full volume for 28, then 0 for 4)
bend
benddelay - See bend
bits - The bit depth, in number of bits, that the signal is reduced to; this is a value between 1 and 24 where other values are ignored. Use crush to set the amount of reduction to the bitrate (defaults to 8)
bitcrush - See bits
blur
bpf - Band Pass Filter
bpnoise - See bpf
bpr - See bpf
bpm
buf
channel
chop - ‘Chops’ the signal into chunks using a low frequency pulse wave over the sustain of a note.
coarse
comb delay - See echo
crush
cut - Cuts a duration
cutoff
decay - See echo
degree - The degree of the note, or pitch, can be specified by keyword (also the first positional)
Which is the same as:
Only plays the “root” note of the chord
delay - A duration of time to wait before sending the information to SuperCollider (defaults to 0)
Delays every 3 note by .1
Delays every 3 note by .5
Plays the note once for each different delays
dist
dur - Durations (defaults to 1 and 1/2 for the Sample Player)
echo - Title keyword: echo, Attribute keyword(s): decay - Sets the decay time for any echo effect in beats, works best on Sample Player (defaults to 0) - Multiplied against the sustain value
env
fmod
formant
freq
hpf - High Pass Filter - Filters out all the frequencies below given value, removing lower freqencies
4000 hertz
HPF is 0 for 4 beats, then 4000 for 4 beats
Linear change on hpf from 0 take 4 beats to get to 4000, 4 beats back to 0
Linear change on hpf from 0 take 8 beats to get to 4000, then reset back to 0
With resonance change (default is 1)
With resonance change as a linvar
hpr - See hpf
lpf - Low Pass Filter - Filters out all the frequencies above given value, removing higher freqencies
4000 hertz
With resonance change as a linvar
lpr - See lpf
midinote
pan - Panning, where -1 is far left, 1 is far right (defaults to 0)
pitch - See degree
pshift
oct
rate - Variable keyword used for misc. changes to a signal. E.g. Playback rate of the Sample Player (defaults to 1)
room - Title keyword: room, Attribute keyword(s): mix
The room argument specifies the size of the room
Mix is the dry/wet mix of reverb or how much the reverb is mixed with the source. 1 is all reverb, 0 is no reverb at all. (Default 0.1)
reverb - See Room
sample - Special keyword for Sample Players; selects another audio file from the bank of samples for a sample character.
scale
shape
slide - Slide To - Slides’ the frequency value of a signal to freq * (slide+1) over the duration of a note (defaults to 0)
slidedelay
slidefrom
slider
spread
spin
striate
stutter
sus - Sustain (defaults to dur
)
swell
vib - Vibrato - Title keyword: vib, Attribute keyword(s): Vibrato (defaults to 0)
With child attribute, vibdepth (default 0.2)
vibdepth - See vib
Try this!
- Use print(SynthDef) to see all available synthesizers and try them out.
- Create a small bass line with 1-8 notes, chords with 1-8 chords, and a small melody.
- Use some of the attributes: the octave variable oct=, the duration variable dur= and/or the amplitude gain value amplify= to get a better result!