Question: # 6. Write a function to make a tone. A tone is a repeating pattern of sample # values. You are to make what is
# 6. Write a function to make a tone. A tone is a repeating pattern of sample # values. You are to make what is called a sawtooth pattern. A music synthesizer # is basically doing the same thing as this but with a wider variety of patterns. # There is not original_samples list. You are to make and return a list with the # following structure. # Each "sawtooth" should be values going from -10000 to 10000 counting by 1000. So # the elements should go -10000, -9000, -8000, -7000, -6000, -5000, -4000, -3000, -2000, -1000, 0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000. # Then, there should be 1000 sawtooths - the above pattern should repeat 1000 times. # This should all be in a single list. # You must use loops to make the sawtooth and the copies of the sawtooth. You # may not write out by hand the needed elements or use loop multiplication to make copies. def make_tone(): # Add code to make the function work as specified. return [] # Replace this line with your own code
# You can add small test examples here and see results from running this file instead # of the SoundApp. An example of testing the reversed_samples function is shown. if __name__ == "__main__": sample_list = [1,2,3] print("Original:", sample_list, "Reversed:", make_reversed_samples(sample_list))
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
