Question: Hip-hop DJs spin turntables back and forth so that sections of sound are played forwards and backwards quickly. Try combining backwards play (Program 108 (page

Hip-hop DJs spin turntables back and forth so that sections of sound are played forwards and backwards quickly. Try combining backwards play (Program 108 (page 248)) and frequency shifting (Program 116 (page 261)) to get the same effect. Play a second of a sound quickly forward, then quickly backward, two or three times. (You might have to move faster than just double the speed.)


Data from Program 108

def reverse(source): target = makeEmptySound (getLength(source)) sourceIndex = getlength (source)-1 for targetIndex in range (0,getLength(target)): sourceValue = getSampleValueAt (source, sourceIndex) setSampleValueAt(target, targetIndex, sourceValue) sourceIndex = sourceIndex - 1 return target


Data from Program 116

def reverse(source): target = makeEmptySound (getLength(source)) sourceIndex = getlength (source)-1 for targetIndex

def reverse(source): target = makeEmptySound (getLength(source)) sourceIndex = getlength (source)-1 for targetIndex in range (0,getLength(target)): sourceValue = getSampleValueAt (source, sourceIndex) setSampleValueAt(target, targetIndex, sourceValue) sourceIndex = sourceIndex - 1 return target

Step by Step Solution

3.35 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

def djShift sound sampleRate getSamplingRatesound Wer... 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!