Processing Sound Ranges part 1

Slides:



Advertisements
Similar presentations
ManipulatingPictures-Mod6-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology.
Advertisements

Georgia Institute of Technology Speed part 5 Barb Ericson Georgia Institute of Technology May 2006.
Non-linear digital editing Adobe Premier. Linear editing analog video editing with tapes cut tape or film and splice clip at end LINEAR: assemble front.
Intro-Sound-part31 Introduction to Processing Digital Sounds part 3 Barb Ericson Georgia Institute of Technology Oct 2009.
Georgia Institute of Technology Movies part 3 Barb Ericson Georgia Institute of Technology April 2006.
Intro-Sound-part21 Introduction to Processing Digital Sounds part 2 Barb Ericson Georgia Institute of Technology Oct 2009.
NestedLoops-part31 Nested Loops – part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 7: Modifying Samples in a Range.
Georgia Institute of Technology Speed part 3 Barb Ericson Georgia Institute of Technology May 2006.
Chapter 7: Modifying Samples in a Range. Chapter Objectives.
Georgia Institute of Technology Processing Sound Ranges Barb Ericson Georgia Institute of Technology July 2005.
UsingSoundRanges-part21 Processing Sound Ranges part 2 Barb Ericson Georgia Institute of Technology Oct 2009.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 7: Modifying Samples in a Range.
Georgia Institute of Technology Manipulating Pictures, Arrays, and Loops Barb Ericson Georgia Institute of Technology August 2005.
NestedLoops-Mod7-part31 Two-Dimensional Arrays and Nested Loops – part 3 Bugs in the garden Originally by Barb Ericson Georgia Institute of Technology.
Georgia Institute of Technology Two-Dimensional Arrays and Nested Loops – part 5 Barb Ericson Georgia Institute of Technology August 2005.
NestedLoops-part41 Nested Loops – part 4 Barb Ericson Georgia Institute of Technology Nov 2009.
Georgia Institute of Technology More on Creating Classes part 2 Barb Ericson Georgia Institute of Technology Oct 2005.
CreatingSubclasses1 Barb Ericson Georgia Institute of Technology Dec 2009.
CPSC1301 Computer Science 1 Chapter 8 Introduction to Processing Digital Sounds part 3.
CPSC1301 Computer Science 1 Chapter 4 Manipulating Pictures, Arrays, and Loops part 5.
Georgia Institute of Technology Creating Classes part 4 Barb Ericson Georgia Institute of Technology May 2006.
Georgia Institute of Technology Movies part 4 Barb Ericson Georgia Institute of Technology April 2006.
CreatingClasses-SlideShow-part31 Creating Classes part 3 Barb Ericson Georgia Institute of Technology Dec 2009.
Georgia Institute of Technology Creating Classes part 2 Barb Ericson Georgia Institute of Technology June 2006.
Georgia Institute of Technology Speed part 4 Barb Ericson Georgia Institute of Technology May 2006.
Chapter 8: Modifying Samples in a Range. Chapter Objectives.
Georgia Institute of Technology More on Creating Classes part 1 Barb Ericson Georgia Institute of Technology Oct 2005.
Intro-Sound-Mod10-part31 Introduction to Processing Digital Sounds part 3 while loop, tracing, for loop, parameters Barb Ericson Georgia Institute of Technology.
ManipulatingPictures-part31 Manipulating Pictures, Arrays, and Loops part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
04-ManipulatingPictures-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology June 2008.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 7A Arrays (Concepts)
String and Lists Dr. José M. Reyes Álamo. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list.
Georgia Institute of Technology More on Creating Classes Barb Ericson Georgia Institute of Technology June 2006.
Manipulating Pictures, Arrays, and Loops part 2
Manipulating Pictures, Arrays, and Loops part 2
Manipulating Pictures, Arrays, and Loops part 3
Georgia Institute of Technology
Processing Sound Ranges part 3
Barb Ericson Georgia Institute of Technology Dec 2009
Manipulating Pictures, Arrays, and Loops part 2
Manipulating Pictures, Arrays, and Loops part 2
For Loops October 12, 2017.
Manipulating Pictures, Arrays, and Loops
Chapter 7: Modifying Samples in a Range
Barb Ericson Georgia Institute of Technology August 2005
Introduction to Processing Digital Sounds part 2
Manipulating Pictures, Arrays, and Loops part 5
Chapter 6: Functions Starting Out with C++ Early Objects Ninth Edition
Arrays versus ArrayList
Processing Sound Ranges part 1
Chapter 7: Modifying Samples in a Range
Manipulating Pictures, Arrays, and Loops part 3
Barb Ericson Georgia Institute of Technology June 2006
Introduction to Processing Digital Sounds part 3
Workshop for Programming And Systems Management Teachers
Manipulating Pictures, Arrays, and Loops
Manipulating Pictures, Arrays, and Loops
Manipulating Pictures, Arrays, and Loops
Introduction to Processing Digital Sounds
Processing Sound Ranges part 2
Processing Sound Ranges
Barb Ericson Georgia Institute of Technology May 2006
More on Creating Classes
Manipulating Pictures, Arrays, and Loops
Processing Sound Ranges part 3
Creating and Modifying Text part 3
Manipulating Pictures, Arrays, and Loops part 6
Corresponds with Chapter 5
Creating Sounds and MIDI
Presentation transcript:

Processing Sound Ranges part 1 Barb Ericson Georgia Institute of Technology Sept 2005 Georgia Institute of Technology

Georgia Institute of Technology Learning Goals Processing ranges of Sound values Creating a sound clip Splicing sounds together Computing concepts Looping through a range Returning a value from a method Change more than one variable in a for loop Georgia Institute of Technology

Georgia Institute of Technology Creating a Sound Clip To clip the “This” out of “This is a test”. Determine where it starts and stops Using the sound explorer: String file = FileChooser.getMediaPath(“thisisatest.wav”); Sound s = new Sound(file); s.explore(); Georgia Institute of Technology

Finding the End of the This Play before bar to check Position the bar Get the index Georgia Institute of Technology

Georgia Institute of Technology To Create a Sound Clip Create a new Sound object Of the appropriate size Ending value – starting value + 1 Loop from start to end (inclusive) for (int x = start; x <= end; x++) Use getSampleValueAt(index) And setSampleValueAt(index,value); Return the new sound object Georgia Institute of Technology

Georgia Institute of Technology Clip Method public Sound clip(int start, int end) { // calc the num samples int numSamples = end - start + 1; Sound target = new Sound(numSamples); int value = 0; int targetIndex = 0; // copy from start to end for (int i = start; i <= end; i++, targetIndex++) { value = this.getSampleValueAt(i); target.setSampleValueAt(targetIndex, value); } return target; Georgia Institute of Technology

Testing the Clip Method String file = FileChooser.getMediaPath( “thisisatest.wav”); Sound s = new Sound(file); Sound s2 = s.clip(0,8500); s2.write( FileChooser.getMediaPath(“this.wav”)); s2.play(); Georgia Institute of Technology

Georgia Institute of Technology Challenge Create a clip of “is” from thisisatest.wav Determine where to start and end the clip Create the clip Write it to a file Georgia Institute of Technology

Returning a Value from a Method To return a value from a method Include a return statement in the body of the method The type of the thing being returned must match the declared return type The clip method declared that it returned a Sound object The return statement returned the target Sound object If the types don’t match you will get a compile error Georgia Institute of Technology

Splicing Sounds Together Originally meant cutting the sound tape into segments and then assembling them in the right order Easy to do digitally Copy more then one sound into a target sound Track the source index and target index Georgia Institute of Technology

Georgia Institute of Technology Splice Method public void splice() { Sound sound1 = new Sound(FileChooser.getMediaPath(“guzdial.wav”)); Sound sound2 = new Sound(FileChooser.getMediaPath("is.wav")); int targetIndex = 0; // the starting place on the target int value = 0; // copy all of sound 1 into the current sound (target) for (int i = 0; i < sound1.getLength(); i++, targetIndex++) value = sound1.getSampleValueAt(i); this.setSampleValueAt(targetIndex,value); } Georgia Institute of Technology

Splice Method - Continued // create silence between words by setting values to 0 for (int i = 0; i < (int) (this.getSamplingRate() * 0.1); i++, targetIndex++) { this.setSampleValueAt(targetIndex,0); } // copy all of sound 2 into the current sound (target) i < sound2.getLength(); value = sound2.getSampleValueAt(i); this.setSampleValueAt(targetIndex,value); Georgia Institute of Technology

Testing the Splice Method String silence = FileChooser.getMediaPath( "sec3silence.wav"); Sound target = new Sound(silence); target.explore(); target.splice(); Georgia Institute of Technology

Georgia Institute of Technology Summary You can work with ranges by changing the start and end value of an index in a loop You can return a value from a method Declare the return type Use a return statement You are not required to change a variable in a for loop But you can change more than 1 Georgia Institute of Technology