Transcript
Tweak It
Still More Options
Do this
Look up the help file of your favourite synthesizer. Use at least one option you haven’t used before!
If the cutoff: option has a low parameter such as 30, what will happen?
Educator notes
All synths have options, like amp: and pan: that are common to all the synthesizers. Incidentally, these are also the options for play! Unfortunately, Sonic Pi will only show these options in the drop-down menu. Check the help file of each synthesizer to get to know the options unique to them!
Don’t Stop the Options
Do this
Put a use_synth_defaults
in your code to change the sound of all the play commands that follow.
You can change more than one option by separating them with a comma like this:
use_synth_defaults amp: 0.5, attack: 1, release: 0.25
How many options can you give to synths with the command use_synth_defaults?
Educator notes
It can be confusing and even a bit scary for the learners when suddenly they don’t have a drop down menu while using use_synth_defaults. But there is no need to panic! Instruct the learners to keep the help file open and find the names of the options there. Typing the option names also helps in remembering them!
Options for Sections
Do this
Put two different use_synth_defaults
in your melody to create two sections.
Hint: you might want to use repeat blocks to repeat a pattern more than once. For example:
live_loop :section do
use_synth :saw
#set options for this section
use_synth_defaults attack: 1
8.times do
#play some notes
sleep 1
end
#set different options for the next part
use_synth_defaults attack: 0, release: 0.5
16.times do
#play some other notes
sleep 0.5
end
end
What will happen if you use use_synth_defaults without any parameters?
Educator notes
Misspelling an option can be a source of frustration for learners. The program will execute without errors, but there seems to be no change in sound. If nothing seems to happen, ask the learners to check that all the options are written correctly and that they have sensible values. If the values are the same as defaults, then there will also be no change either.
Every option that you don’t explicitly define in use_synth_defaults will be set to the ones shown in the helpfile. So if you want to carry over options when using multiple use_synth_defaults then you will have to type them as well.