FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.

Slides:



Advertisements
Similar presentations
Is the shape below a function? Explain. Find the domain and range.
Advertisements

Introduction to Programming
What to do for Project 2?.
Line Balancing Problem A B C 4.1mins D 1.7mins E 2.7 mins F 3.3 mins G 2.6 mins 2.2 mins 3.4 mins.
Basic Spreadsheet Functions Objective Functions are predefined formulas that perform calculations by using specific values, called arguments, in.
Steps to determining v vs. t curve from s vs. t curve (1)draw a set of axes (v vs t) directly under the s vs. t curve (2)locate all minimums, maximums,
Priority Queues and Heaps. Overview Our last ADT: PriorityQueueADT A new data structure: heaps One more sorting algorithm: heapsort Priority Queues and.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2010/2011.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2010/2011.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
DSA Processing. Links Processing.org My Processing page Ben Fry Ben Fry’s Thesis on Computational Information DesignThesis Casey Reas siteCasey Reas Casey.
CMSC 104, Version 8/061L22Arrays1.ppt Arrays, Part 1 of 2 Topics Definition of a Data Structure Definition of an Array Array Declaration, Initialization,
Math – Getting Information from the Graph of a Function 1.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
Relationships of CREATED BY CANDACE SMALLEY
Today in Pre-Calculus Go over homework Notes: Finding Extrema –You’ll need a graphing calculator (id’s please) Homework.
Variables and Arithmetic. From last class More drawing functions: strokeWeight(n); // higher the n value broader the stroke fill(k) ; // single parameter.
Array Processing - 2. Objectives Demonstrate a swap. Demonstrate a linear search of an unsorted array Demonstrate how to search an array for a high value.
SECTION 1.3 PROPERTIES OF FUNCTIONS PROPERTIES OF FUNCTIONS.
Increasing/ Decreasing
Arrays. An array is a collection “The Dinner offers an array of choices.” In computer programming, an array is a collection of variables of the same data.
Objects. The Heart of the Matter - The "Black Box" Object-oriented software is all about objects. An object is a "black box" which receives and sends.
XNA Basic Displaying Image & Collision Detect. What’s format image that XNA support? XNA support only.bmp.png and.jpg image..PNG have transparent region.
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
Characteristics of Polynomials: Domain, Range, & Intercepts
Functions (but not trig functions!)
Computer Science I Arrays. Parallel structures. Classwork/Homework: Build your own bouncing things.
2.4 Measures of Variation Coach Bridges NOTES. What you should learn…. How to find the range of a data set How to find the range of a data set How to.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
Functions Structured Programming. Topics to be covered Introduction to Functions Defining a function Calling a function Arguments, local variables and.
Review Array – int[] diameters = new int[10]; – diameters[0], diameters[2], diameters[9] – diameters.length Indexing starts at 0 A way to have a collection.
Introduction to sound using processing. 2 Minim –A sound library which uses javasound library –Provide convenient but flexible way to play,, synthesize.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
Directions  You will create your own polynomial using your birth month numbers as the coefficients. Not only will you need to complete the informational.
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
Sample calculation.
Do Now from 1.2a Find the domain of the function algebraically and support your answer graphically. Find the range of the function.
Algebra 2/Trig Higher Order Polynomials Test Review
Chapter 14, Translate & Rotate
Extreme Values of Functions
Algebra II Elements 5.8: Analyze Graphs of Polynomial Functions
EXTREMA and average rates of change
Open intervals of increasing, decreasing & constant functions
Today in Pre-Calculus Go over homework Need a calculator
20 minutes maximum exhibits
Chapter 6 Loops (iteration).
4.1 – Extreme Values of Functions
Let’s Review Functions
For Net Art Lecture 2 J Parker
Extreme Values of Functions
Characteristics of Polynomials: Domain, Range, & Intercepts
Characteristics of Polynomials: Domain, Range, & Intercepts
2.1(c) Notes: Quadratic Functions
Homework Analyzing Graphs
Just a question for Mac users:
1.5 Graphs of Functions.
Chapter 10 Algorithms.
Mechanics of Materials Engr Lecture 20 More Mohr’s Circles
(3, 2) 2 -3 (-4, -3) -2 (5, -2) 1. a) Find: f(3) = ______
Characteristics of Polynomials: Domain, Range, & Intercepts
How About Some PI? Trigonometry Feb 18,2009.
Welcome: The graph of f(x) = |x – 3| – 6 is given below
Analysis of Absolute Value Functions Date:______________________
Chapter 13, Math A few Examples.
Let’s Review Functions
Let’s Review Functions
Let’s Review Functions
Presentation transcript:

FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012

ASSIGNMENT 3 DUE DATE 21 DEC 2012 COLLECTION VIA ACS

REQUIREMENTS o Create your own music visualization (20%) o Select your audio / music o Design your visualization o Use of Minim audio library (30%) o Program complexity (20%) o Creative graphics (30%)

EXAMPLE

EXAMPLE

EXAMPLE

SAMPLE PROGRAM

Import library Define player and beat detector objects import ddf.minim.*; import ddf.minim.analysis.*; Minim minim; AudioPlayer player; BeatDetect beat; int n = 5; float[][] a = new float[n][n];

SAMPLE PROGRAM Create objects & Initialize array elements void setup() { size(400, 400); minim = new Minim(this); player = minim.loadFile("test2.mp3"); beat = new BeatDetect( player.bufferSize(), player.sampleRate() ); player.play(); // initialize item size for (int i=0; i<n; i++) { for (int j=0; j<n; j++) { a[i][j] = 40; }

SAMPLE PROGRAM Beat detection and rendering void draw() { beat.detect(player.mix); background(0); strokeWeight(4); for (int i=0; i<n; i++) { for (int j=0; j<n; j++) { // enlarge corresponding circle if onset if (beat.isOnset(i*5+j)) { a[i][j] = 80; } float s = a[i][j]; float c = map(s, 40, 80, 200, 255); noFill(); stroke(c); ellipse(i*80+40, j*80+40, s, s); fill(c); noStroke(); ellipse(i*80+40, j*80+40, s / 2, s / 2); // decrease circle sizes if (a[i][j] > 40) { a[i][j] *= 0.95; } }

SAMPLE PROGRAM Do not forget to add the stop( ) function void stop() { player.close(); minim.stop(); super.stop(); }

USEFUL FUNCTIONS & REFERENCES o map (value, low1, high1, low2, high2) o Re-maps a number from one range to another o constrain(value, min, max) o Constrains a value to not exceed a maximum and minimum value. o abs(value) o Calculates the absolute value (always position) of a number.