In this mini-lab you will gain practice with using the techniques of echoing and shifting sounds.
def echoes(sound, delay, num):
soundLength = getNumSamples(sound)
newLength = soundLength + (delay*num) # number of samples
newSound = makeEmptySoundFromNumSamples(newLength)
echoAmp = 1.0
for echoCount in range(0, num+1):
# 60% smaller each time after the original sound
for soundIndex in range(1, soundLength+1):
newSoundIndex = soundIndex + (delay*echoCount)
value1 = getSampleValueAt(sound, soundIndex) * echoAmp
value2 = getSampleValueAt(newSound, newSoundIndex)
setSampleValueAt(newSound, newSoundIndex, value1+value2)
echoAmp = echoAmp * .6
return newSound
.wav files to be
posted on your web page as part of Lab 7.
doubleFrequency function, and if you use the factor of
0.5 you get the same result as from halfFrequency.
.wav files
to be posted on your web page as part of Lab 7.