For all of our activities, make sure your practice with the new blocks today. Some of the activities you can complete without using the new blocks. They do save some time and headaches. Open up the Practice Area, and take a crack at the following activities.
Create a blockly program which allows the user to load in a .wav file, and cuts the frequency by half. You can use the following wav file if you cannot find one: tada.wav
To cut the frequency of a sound in half, you want to loop over pairs of numbers in the original list. This activity will be similar to the reverse program. Create a new list, and for every 2 samples in your original list compute the average of them and put them in the new list. Then go back through and put the values from the new list into the original sound list.
Create a blockly program which allows the user to load in a .wav file, and plays the wave file with a certain sound cap. If the current samples exceed 0.5, assign the value as 0.5. If the current sample is below -0.5, set it to -0.5. You can use the following wav file if you cannot find one: tada.wav.
To reverse an audio file, you must first go and create a list which contains all of the samples from the sound in reverse order. To accomplish this, you should create an initially empty list, and add all of the samples from the sound into it. Then just copy from this list back into the original sound list.