quick exercise
play

Quick Exercise What kind of sound does this method ... public Sound - PowerPoint PPT Presentation

Quick Exercise What kind of sound does this method ... public Sound makeSound1( int seconds ) { int length = framesFor(seconds); Sound result = new Sound( length ); for (int i = 0; i < length; i++ ) result.setSampleValueAt( i, X );


  1. Quick Exercise What kind of sound does this method ... public Sound makeSound1( int seconds ) { int length = framesFor(seconds); Sound result = new Sound( length ); for (int i = 0; i < length; i++ ) result.setSampleValueAt( i, X ); return result; } ... produce for these values of X : i 10*i i*i

  2. Open Problem #1 Eugene the Chipmunk

  3. Changing a Sound's Frequency How can we recreate the top curve?

  4. Solution #1

  5. Solution #2

  6. Open Problem #2 Negating an image was easy. We inverted an image, but...

  7. Exercise Let's try inverting at the middle value between the maximum and minimum values, rather than at 0. Write Java statements to... 1. ... find that midpoint. 2. ... for a given sample in slot i, find the corresponding value on the other side of the midpoint. You may assume the existence of methods maximumValue() and minimumValue() .

  8. Ack! Still no change in the sound.

  9. Ack! Still no change in the sound BECAUSE still no change in shape of waves!

  10. Last Exercise for a While Write a method called reverse() that creates a new sound, copies this into, but in reverse order, and returns the new sound as its answer.

  11. Upcoming Days THU Finish reading Chapter 9. Begin work on Homework 5. TUE No class — Mike Volz in the lab WED Lab as usual — bring headphones THU No class — Mike Volz in the lab TUE Submit Homework 5. Read Chapter 10.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend