Question: The general functions like Program 108 (page 248) are the kind where the index array notation is really useful. Write reverse, copy, and clip using
The general functions like Program 108 (page 248) are the kind where the index array notation is really useful. Write reverse, copy, and clip using index array notation.
Data from Program 108

def reverse(source): target = makeEmptySound (getLength(source)) getlength (source)-1 for targetIndex in range (0,getLength(target)): sourceIndex = sourceValue = getSampleValueAt (source, sourceIndex) setSampleValueAt (target, targetIndex, sourceValue) - 1 sourceIndex = sourceIndex return target
Step by Step Solution
3.34 Rating (157 Votes )
There are 3 Steps involved in it
def reverse2source target makeEmptySoundgetLengthsource targetSamples getSamplestarget ... View full answer
Get step-by-step solutions from verified subject matter experts
