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

Slides:



Advertisements
Similar presentations
Georgia Institute of Technology Introduction to Processing Digital Sounds.
Advertisements

4.
MATH 224 – Discrete Mathematics
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,
CS 106 Introduction to Computer Science I 02 / 18 / 2008 Instructor: Michael Eckmann.
Workshop on Peer Instruction: Making Good Clicker Questions Beth Simon Computer Science and Engineering University of California, San Diego Credits: Sara.
CS 102 Computers In Context (Multimedia)‏ 04 / 01 / 2009 Instructor: Michael Eckmann.
1 Lecture Today’s topic Arrays Reading for this Lecture: –Chaper 11.
CS 106 Introduction to Computer Science I 10 / 04 / 2006 Instructor: Michael Eckmann.
Lecture 7. Review Homework 1 (sample solution) Project 1 will be assigned next week –Draw a picture (whatever you want) in the world by using turtles.
CS 106 Introduction to Computer Science I 03 / 17 / 2008 Instructor: Michael Eckmann.
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/
Problem Solving with Data Structures using Java: A Multimedia Approach Chapter 5: Arrays: A Static Data Structure for Sounds.
CS 0.5: A Better Approach to Introductory Computer Science for Majors Bob Sloan, Pat Troy University of Illinois at Chicago SIGCSE 2008.
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/
CS 106 Introduction to Computer Science I 03 / 19 / 2007 Instructor: Michael Eckmann.
COSC 1P02 Introduction to Computer Science 4.1 Cosc 1P02 Week 4 Lecture slides “Programs are meant to be read by humans and only incidentally for computers.
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/
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.
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/
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSE8A: Introduction to Programming in Java Fall 2012 Prof. Christine Alvarado cse8afall.weebly.com.
CS 106 Introduction to Computer Science I 10 / 29 / 2007 Instructor: Michael Eckmann.
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 What is new in Java 5.0 (1.5)? Barb Ericson Georgia Institute of Technology June 2006.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Operator precedence.  Evaluate a + b * c –multiplication first? a + (b * c) –addition first? ( a + b) * c  Java solves this problem by assigning priorities.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Carnegie Mellon 1 Midterm Review : Introduction to Computer Systems Recitation 8: Monday, Oct. 14, 2013 Marjorie Carlson Section A.
CS 106 Introduction to Computer Science I 03 / 22 / 2010 Instructor: Michael Eckmann.
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.
1 CSE 142 Final Exam Review Problems. 2 Question Types expressions array mystery inheritance mystery file processing array programming Critters classes.
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/
Midterm Review Tami Meredith. Primitive Data Types byte, short, int, long Values without a decimal point,..., -1, 0, 1, 2,... float, double Values with.
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.
1 CS 177 Week 7 Recitation Slides Modifying Sounds using Loops + Discussion of some Exam Questions.
Loops. Review Control Structure – making decisions if-statement Program Design Understand what you want to do Design your solution Write and test your.
Barbara Ericson Promising Practices in CS1 Media Computation for CS1 Barbara Ericson Georgia Institute of Technology.
CSE 8A Lecture 17 Reading for next class: None (interm exam 4)
Creative Commons Attribution Non-Commercial Share Alike License
Week of 12/12/16 Test Review.
Georgia Institute of Technology
Processing Sound Ranges part 3
Introduction to Processing Digital Sounds part 2
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
Introduction to Processing Digital Sounds
Processing Sound Ranges
Creative Commons Attribution Non-Commercial Share Alike License
Creative Commons Attribution Non-Commercial Share Alike License
X y y = x2 - 3x Solutions of y = x2 - 3x y x –1 5 –2 –3 6 y = x2-3x.
Processing Sound Ranges part 3
Presentation transcript:

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

CSE8A Lecture 22 Read next class: REPEAT read Freshman seminar: Peer Instruction Research CSE 8A Art Show! ROCKED! Help future 8A students!: terminology wiki Solutions to midterm posted on moodle Advising on your next courses (next)

Majors: What courses to take next term (cape.ucsd.edu) CSE8B –(10 hours a week), 5 programs, 5 quizzes, 1 MT CSE15L (highly recommended before 12) –(2-4 hours a week) Maybe CSE20 (no programming) –(4-6 hours a week) –CSE 20 and 21 are computing “math classes” –Pre-req for 30 (and 21) –CSE21 pre-req for 100 (maybe you’ll take this in fall 2010…) if so you want to take 20 next term

Non-majors If you have/plan to take 8B, take it NEXT TERM –Hard to get “back” into programming ICAM – 8B required Hey? Interested in majoring? –WE WANT YOU! –Well paying (and cool) jobs are available in CSE! –Feel good that you “make things” other people use! –Changes likely…

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).

What does this code do? A.Sets the end of the array to 0s. B.Finds the first value C.Finds the minimum (and its location) D.Finds the maximum (and its location) E.Finds the last value …for (int i=0;i<noiseArray.length; i++) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); if (foo > a) { a = foo; b = i; }

Why would we do that?: Normalizing 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; } double factor = / a; for (int i = 0; i < noiseArray.length; i++) { SoundSample sample = noiseArray[i]; sample.setValue((int) sample.getValue() * factor)); }

How does my SoundSample[] change? public void funky() { SoundSample[] noiseArray = this.getSamples(); int zzz = 0; for (int i=0;i<noiseArray.length; i++) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); zzz += foo; } int yyy = zzz / noiseArray.length; for (int i = 0; i < noiseArray.length; i++) { SoundSample sample = noiseArray[i]; sample.setValue(yyy); }

SPEEDY: What does that code do? A.Makes it higher pitched B.Makes it louder C.Makes if lower pitched D.Makes it quieter E.Makes a silent sound public void funky() { SoundSample[] noiseArray = this.getSamples(); int zzz = 0; for (int i=0;i<noiseArray.length) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); zzz += foo; } int yyy = zzz / noiseArray.length; for (int i = 0; i < noiseArray.length; i++) { SoundSample sample = noiseArray[i]; sample.setValue(yyy); }

“Clipping” or Force to Extremes: What would happen to the array “What if all positive values (including zero) were (set to) the maximum value (32,767) and all negative values were set to the minimum value (-32,768)?

“Clipping” or Force to Extremes: What would happen to the array “ What if all positive values (including zero) were (set to) the maximum value (32,767) and all negative values were set to the minimum value (-32,768)? if (foo[i].getValue() >= 0)if (i >= 0) if (foo[i].getValue() < 0) if (i < 0) SoundSample[] foo = this.getSamples(); for (int i = 0; i < foo.length; i++) { > foo[i].setValue(32767); else foo[i].setValue(-32768);

Speaking backwards… But creating NEW Sound We want to do this: What should be the indices (indexes) we use for: sourceIndex targetIndex

Write the code… (on your own… type it in to see if it works) SoundSample[] sourceAr = source.getSamples(); SoundSample[] targetAr = target.getSamples() for ( { int value = sourceAr[sourceIndex].getValue(); targetAr[targetIndex].setValue(value); }