Write a funciton that takes three sounds and blends them tog

Write a funciton that takes three sounds and blends them together. Start with
, then a blend of sound1 and then a blend of sound2 and , and finally end with the rest of .

Hints:

Use array index notation to access sample values - i.e. use the functions getSampleValuesAt and setSampleValuesAt .

Use index variables mapped to each sound and a target index. (PYTHON JES VERSION)

Solution

# this function blends two sounds together, and returns # >>> sound1 = note(300, 1, 20500) # >>> sound2 = note(450, 1, 20500) # >>> sound3 = blendSounds(sound1, sound2) def blendSounds(sound1, sound2): newSound = makeEmptySound(min(getLength(sound1), getLength(sound2))) for i in range(0, getLength(newSound)): value1 = getSampleValueAt(sound1, i) value2 = getSampleValueAt(sound2, i) setSampleValueAt(newSound, i, value1*.5 + value2*.5) play(newSound) return newSound
Write a funciton that takes three sounds and blends them together. Start with , then a blend of sound1 and then a blend of sound2 and , and finally end with the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site