AAP-3: Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing them to write programs more quickly and with more confidence.
AAP-3.a: Students will write statements to call procedures using the the setEffect function to code sound effects.
AAP-3.b: Students will determine the result or effect of a procedure
The objective for this section is to learn how to apply the setEffect function. The setEffect function is very versatile, and can be used to add a large number of effects to existing music samples. This allows designers to customize the music to their own liking, but at the cost of providing a very large array of sometime musically technical terminology. Students should initially focus on the limited set of effects we will cover: VOLUME, DELAY, and PITCHSHIFT. Advanced students might explore additional effects if they have more time.
There are two setEffect blocks in EarSketch. The first block has 4 parameters (track #, effect type, effect parameter, effect value) and is used to add a sound effect that applies constantly to a track.
The second setEffect block has 7 parameters (track #, effect type, effect parameter, effect start value, start location, effect end value, end location) and is used to linearly fade in or fade out a sound effect to a track.
Activity 2.11b.1 (Budget 20 minutes)
Students learn to apply the setEffect function.
1. Present the first slide of the setEffect PowerPoint and facilitate a class response on the difference between the two sounds. (The second sound is lower in volume than the first)
2. Present the next two slides to show the data types for applying an effect to 1 track or all the tracks, and where to find the many effects available in EarSketch.
3. Model in EarSketch how to add a volume effect to a track from the previous script you made. When you make the volume effect, spell volume in lowercase letters so that they can see the data type error. Then change VOLUME to all capital letters (constants are all capital letters in EarSketch) so that it runs without an error. Show the DAW so that students can see how the effect looks visually.
4. Hand out the setEffect assignment to each pair of students so that they each apply a delay and a pitch shift effect. Then they select one of the effects and listen to each others music to see if they can tell which effect their partner used. Complete Part I.
5. Review the code examples that you can copy and paste into EarSketch. Use commenting to guide you on the lowest parameter (-60) and the highest parameter (12). You can also keep the auto-populated information so that you remember what the inputs represent.
Activity 2.11b.2 (Budget 20 minutes)
Students learn how to apply the setEffect function to fade in an effect.
1. Present the second slide of the setEffect Fade PowerPoint and facilitate a class response on the difference between the three sounds. The first is the original script with guitar, drums, and piano. The second sound has a fade or volume gain for the guitar. The third sound has a fade or volume gain for the piano. Explain that it is not always practical to add an effect to an entire song and/or all of the tracks.
Volume is related to loudness, in which sounds are ordered on a scale from quiet to loud. The gradual increase or decrease in volume, like in the previous example, is called a fade. Fades can be used to start and end a piece, or even to transition between tracks, as detailed in Chapter 14. Fades are achieved by creating a VOLUME envelope with the GAIN parameter.
Present the next two slides to show the 7 parameters of the second setEffect function applied to 1 track.
3. Model in EarSketch how to linearly fade in a volume effect to a different track on the previous script you made. Show the DAW so that students can see how the fade in effect looks visually. Model in EarSketch how to linearly fade out the same track that you just faded in. Show the DAW so that students can see how the fade out effect looks visually.
4. Have students complete Part II of the setEffect Assignment. Pair of students so that they each apply a delay fade in and a pitch shift fade out effect. Then they select either the delay or pitch shift and fade in or out on a different track and listen to each others music to see if they can tell which their partner used.