# Lesson 6 # In this lesson, you will learn about some special # features of Sonic Pi that let you play around with # and change sounds. # General Instructions: # # This lesson contains three examples and three # exercises (A, B, C). # # To listen to an example, change "comment" # to "uncomment" on the "comment do" line, # then click the "Run" menu command at the # top of the Sonic Pi editor window. # When you are done with the example, turn # it off by changing "uncomment" back to # "comment," and move on to the next section # of the lesson. # # Synthesizers # Effects # Samples # Synthesizers: Sonic Pi has about twenty different # synthesizers (synths) built in. You can easily change # from one synth to another with the use_synth command. # Here are some examples of synth names: Beep, Blade, # Chipnoise, Piano, Pluck, Saw, Sine. You can find a # complete list of synths in Sonic Pi by clicking on the # "Synths" tab on the help menu bar (between the "Examples" # and "Fx" tabs). When you type the "use_synth" command, # Sonic Pi provides an auto-complete menu giving a list # of synths to choose. # Example 1 - Changing the synthesizer comment do use_bpm 100 use_synth :prophet myNote = 60 myTime = 1 13.times do play myNote sleep myTime myNote = myNote + 1 end end # # Exercise A # Change the synth in Example 1 to the following synths: # Chipbass # Dark # Ambience # Fm # Growl # Hoover # Prophet # Effects. Effects are processors that change the # characteristics of a sound. Effects can be added # to sounds created within a do...end block of code using # the with_fx command. You can find a list of effects # available in Sonic Pi by clicking the "Fx" tab on the # help menu (between "Synths" and "Samples"). # # Example 2 - Effects: comment do use_bpm 100 myNote = 60 myTime = 1 13.times do with_fx :echo do play myNote sleep myTime if myNote < 67 myNote = myNote + 1 else myNote = myNote - 2 end end end end # # Exercise B - modify Example 2 to use the following # effects: # Distortion # Flanger # Octaver # Reverb # Vowel # Samples. Sonic Pi provides a number of recorded samples. # You can trigger them using the sample command followed # by the name of the sample. The samples are organized by # type, with a prefix for each type. For example, drum sounds # use the prefix drum_, looping sounds have the prefix loop_. # You can find the a list of samples using the "Samples" tab # on the help menu (between "fx" and "Lang"). # Example 3 - Samples: comment do use_bpm 100 myNote = 60 myTime = 1 13.times do play myNote sleep myTime myNote = myNote + 1 sample :ambi_swoosh end end # Exercise C # 1) modify Example 3: # a) set myTime = 3; # b) delete "myNote = 60" line # c) delete "myNote = myNote + 1" line # d) move "sample :ambi_swoosh" line # above "sleep myTime" line # 2) Change the code to use the following samples: # a) ambi_drone # b) ambi_piano # c) ambi_choir # d) drum_heavy_kick # e) drum_snare_hard # f) drum_cymbal_open # g) glitch_robot1 # h) misc_burp # i) guit_harmonics # j) vinyl_scratch