Question: Rewrite the echo function (Program 111 (page 258)) to generate two echoes back, each delay samples previous. Data from Program 111 def echo (delay,s1): s2

Rewrite the echo function (Program 111 (page 258)) to generate two echoes back, each delay samples previous.


Data from Program 111

def echo (delay,s1): s2 = duplicateSound (s1) for index in range (delay,

def echo (delay,s1): s2 = duplicateSound (s1) for index in range (delay, getLength(s1)): # set delay value to original value + delayed value * echoSample 0.6*getSampleValueAt(s2, index-delay) comboSample = getSampleValueAt (s1, index) + echoSample setSampleValueAt (s1, index, comboSample) play(s1) return s1

Step by Step Solution

3.46 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

def echo2delay s1 s2 duplicateSounds1 for index in range 2 delay1 g... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Computing and Programming in Pytho Questions!