Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/http://creativecommons.org/licenses/by-nc-

Slides:



Advertisements
Similar presentations
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 21: Strings (cont.)
Advertisements

Conditionals-part31 Conditionals – part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Intro-Sound-part31 Introduction to Processing Digital Sounds part 3 Barb Ericson Georgia Institute of Technology Oct 2009.
Peer Instruction for the First Time: Experiences of a First Time User in Computer Science Beth Simon Computer Science and Engineering University of California,
Homework Any Questions?. Statements / Blocks, Section 3.1 An expression becomes a statement when it is followed by a semicolon x = 0; Braces are used.
REPETITION (loops or iteration) Schneider: Sec. 6.1 & 6.3.
Workshop on Peer Instruction: Making Good Clicker Questions Beth Simon Computer Science and Engineering University of California, San Diego Credits: Sara.
Original image: 512 pixels by 512 pixels. Probe is the size of 1 pixel. Picture is sampled at every pixel ( samples taken)
Loops Chapter 4. It repeats a set of statements while a condition is true. while (condition) { execute these statements; } “while” structures.
Loops Chapter 4. It repeats a set of statements while a condition is true. while (condition) { execute these statements; } “while” structures.
Intro-Sound-part21 Introduction to Processing Digital Sounds part 2 Barb Ericson Georgia Institute of Technology Oct 2009.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
NestedLoops-part11 Nested Loops – part 1 Barb Ericson Georgia Institute of Technology Nov 2009.
Replacing colors using if We don’t have to do one-to-one changes or replacements of color We can use if to decide if we want to make a change.  We could.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSE8A Lecture3 TODO: –Finish PSA1 individually (no partner!) and turn it in with the bundlePSA1 command GET AN INTERVIEW for PSA1 from a tutor See tutor.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Georgia Institute of Technology Processing Sound Ranges Barb Ericson Georgia Institute of Technology July 2005.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CS122 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Spring 2011.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
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.
More C++ Bryce Boe 2013/10/23 CS24, Fall Outline Project 1 Review Alignment and Padding Finish C++ Introduction.
Introduction to Methods Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com April 1, 2013.
CSE 201 – Elementary Computer Programming 1 Extra Exercises Sourceshttp://
Georgia Institute of Technology What is new in Java 5.0 (1.5)? Barb Ericson Georgia Institute of Technology June 2006.
Printing with for Loops To print a character multiple times, use a for loop. for (int j = 1; j
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
CSE 8A Lecture 13 Reading for next class: Chapter 9 Today’s topics: –Sounds! Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Thursday.
CSE 8A Lecture 14 Reading for next class: None (INTERM EXAM #3) Today’s topics: –More Sounds! PSA 6 due tonight PSA 7 (sounds) due next Monday (11/19)
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSE8A Lecture 5 TODO: –FINISH PSA2 WITH YOUR PARTNER! Read next class: Section 5.1. PLAY WITH CODE! –Get stuck, then figure out how to get unstuck – it’s.
COSC 1P02 Introduction to Computer Science 5.1 Cosc 1P02 Week 5 Lecture slides Psychiatrist to patient "You have nothing to worry about - anyone who can.
Intro-Sound-Mod10-part31 Introduction to Processing Digital Sounds part 3 while loop, tracing, for loop, parameters Barb Ericson Georgia Institute of Technology.
04-ManipulatingPictures-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology June 2008.
Lecture 4: For Loops Announcements & Review Announcements Examples posted after lecture on schedule Discussion Section exercises on line before 9am Tuesdays.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
BEGINNER PROGRAMMING LESSON
CSE 8A Lecture 17 Reading for next class: None (interm exam 4)
Creative Commons Attribution Non-Commercial Share Alike License
Processing Sound Ranges part 1
Manipulating Pictures, Arrays, and Loops
CS 2308 Exam I Review.
Introduction to Processing Digital Sounds part 2
Manipulating Pictures, Arrays, and Loops part 5
CSE 8A Lecture 6 Reading for next class:
Processing Sound Ranges part 1
Barb Ericson Georgia Institute of Technology June 2006
Introduction to Processing Digital Sounds part 3
Creative Commons Attribution Non-Commercial Share Alike License
Homework Any Questions?.
Manipulating Pictures, Arrays, and Loops
Georgia Institute of Technology
Introduction to Processing Digital Sounds
Warm Up 7/27-28 List 2 pieces of Lab equipment you used last year
Processing Sound Ranges
Creative Commons Attribution Non-Commercial Share Alike License
Creative Commons Attribution Non-Commercial Share Alike License
Introduction to Programming in MATLAB
February , 2009 CSE 113 B.
Presentation transcript:

Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/ sa/3.0/ Original Developer: Beth Simon, 2009

CSE8A Lecture 21 Read next class: read pg and Freshman seminar: Peer Instruction Research CSE 8A Art Show! Sat Nov 14 10:30-12 noon –Print out your code! –Show up at 10am to tape up your poster and code! –What do we have on chromakey? (check out wiki) Help future 8A students! –Wiki of CSE terminology (demo) Solutions to midterm posted on moodle –Pick up midterms today (solutions don’t have problems listed)

Picking up midterm after class (I’ll bring leftovers up to discussion and to class on Monday)

By the end of today’s class you should be able to… LG41: Read, trace, and write code to change the volume of a Sound object (using for each, while and for loops) LG42: Compare and contrast the difference between changing the Color of Pixels in a Picture to changing the volume of SoundSamples in a Sound. LG43: Trace execution of sound code using multiple loops and if statements. LG44: Be able to use either array-based or method-based (API) access for (getting/reading, setting/writing) sound File. LG45: Be able to explain in plain English what code modifying Sounds does. LG46: Trace indexing patterns in code to perform Sound manipulations (e.g., reversing a sound).

Lab Note: More than one way to modify Sounds SoundSample[] noiseArray = noise.getSamples(); for (int i = 0; i < noiseArray.length; i++) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); sample.setValue(foo/2); } int foo = noise.getSampleValueAt(); noise.setSampleValueAt(foo/2); int foo = noise.getSampleValueAt(i); noise.setSampleValueAt(foo/2); int foo = noise.getSampleValueAt(i); noise.setSampleValueAt(i,foo/2); int foo = this.getSampleValueAt(); this.setSampleValueAt(foo/2); int foo = this.getSampleValueAt(i); this.setSampleValueAt(i,foo/2);

Conceptual Highlight Get/Read Value Pixel[] foo = xxx.getPixels(); Color c = foo[i].getColor(); Pixel bar = xxx.getPixel(x,y); Color c = bar.getColor(); SoundSample[] foo = xxx.getSamples(); int value = foo[i].getValue(); int value = xxx.getSampleValueAt(i); Set/Modify Value foo[i].setColor(modC); Pixel bar = xxx.getPixel(x,y); bar.setColor(modC); foo[i].setValue(modValue); xxx.setSampleValueAt(i,modValue);

For you to practice Write that code using a –While loop Write a code that reduces the volume of every other SoundSample. What does that really sound like?

Lab Review: What does this code do? A.Erases half of the sound B.Changes the result sound based on the this sound C.Replaces the parameter sound with the calling object sound D.Puts the last half of the calling object sound into the parameter sound E.Replaces the last half of the parameter sound with the last half of the result sound public void lab7Quiz3(Sound mySound) { Sound[] source = this.getSamples(); Sound[] result = mySound.getSamples(); for (int i = source.length/2; i < source.length; i++) { int value = source[i].getValue(); result[i].setValue(value); }

What’s printed by this code? (assume calling object ( this ) as shown) A.0,9 B.60,0 C.90,5 D.100,4 E.None of the above public void guess() { SoundSample[] noiseArray = this.getSamples(); int a, b = 0; for (int i=0;i<noiseArray.length; i++) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); if (foo > a) { a = foo; b = i; } S.o.pln(a + “,”+b); }

What’s printed by this code? (assume calling object ( this ) as shown) A.0,9 B.0,6 C.90,5 D.32767, 0 E.None of the above public void guess() { SoundSample[] noiseArray = this.getSamples(); int a = 32767; int b = 0; for (int i=0;i<noiseArray.length; i++) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); if (foo < a) { a = foo; b = i; } S.o.pln(a + “,”+b); }