Difference between revisions of "CSC111 Sound Modification Exercises"

From dftwiki3
Jump to: navigation, search
Line 2: Line 2:
 
----
 
----
 
<onlydft>
 
<onlydft>
 +
=First we solve it in Pure Python with a List of integers=
 
<source lang="python">
 
<source lang="python">
 
# playing with an array of numbers
 
# playing with an array of numbers
Line 67: Line 68:
  
 
      
 
      
 +
</source>
 +
=Then we apply the Algorithm to JES=
 +
<source lang="python">
 +
file = pickAFile()
 +
sound = makeSound( file )
 +
blockingPlay( sound )
 +
 +
startClear = 10561
 +
noSamples = getLength( sound )
 +
 +
for i in range( startClear, noSamples ):
 +
  setSampleValueAt( sound, i, 0 )
 +
 
 +
blockingPlay( sound )
 +
 +
lenSeq = 10502
 +
startRepeat = 4071
 +
for i in range( lenSeq-1, -1, -1 ):
 +
  j = i + startRepeat
 +
  valueRight = getSampleValueAt( sound, j )
 +
  valueLeft  = getSampleValueAt( sound, i )
 +
  setSampleValueAt( sound, j, valueRight + valueLeft/3 )
 +
 
 +
blockingPlay( sound )
 +
 
</source>
 
</source>
 
</onlydft>
 
</onlydft>

Revision as of 11:30, 26 February 2014

--D. Thiebaut (talk) 10:17, 26 February 2014 (EST)



...