Review of Last Week(s)
- Project reviews
- Great progress for most of you this week! PLEASE KEEP IN TOUCH. I have not heard from some of you in a while… Jamie worries.
- YOU ARE NOT BEING MEASURED AGAINST ONE ANOTHER, OR SOME OTHER ARBITRARY MEASURE, BUT AGAINST YOUR OWN PROGRESS AND WORK EFFORT IN THIS CLASS.
- I AM (WE ARE) HERE TO HELP YOU ACHIEVE AND LEARN. I AM (WE ARE) NOT HERE TO JUDGE OR DISPARAGE.
- Week 11: Individual meetings – SIGN UP HERE – Max/MSP scripting with java and javascript
- Week 12: PRESENTATIONS!!! 20 mins each, go through concept, ideas, context, show what you have completed. There will be new people in the audience, so START FROM THE BEGINNING
- For those using Basic Techniques as a starting point for your final projects – Make sure you’re describing what you accomplished for your Basic Techniques
Rationale
A couple of somewhat abstract concepts today – so stop thinking about your project for the next two hours.
Today we will discuss a few things that might be of use to some of you in finishing up your pieces, but otherwise will be topics we’ll definitely look at in future iterations of projects and development towards your Masters Projects.
We’ll look at strategies for ‘on change’, batch averages, running averages and standard deviations. I.e.: Thinking about what it is you want to detect and why.
Classes are a useful construct for procedural languages that allow you do ‘encapsulate’ both behavior and data.
Data Handling & Statistics (for Sensors)
When reading in sensor and such – there are a lot of interesting ways to develop ‘reactions’ to ‘inputs’. A question we often have to ask ourselves is “What is an EVENT?” in a particular situation or system. ![]()
![]()
- Thresholding – data is great than some value, or not
- Mapping – data drives an output to some end

- Counting strategies – data changes move the program/system into different behaviors

- Modes – overall timeline, etc., can drive changes in the above!

Simple Stats for Input and Output Data![]()
- Batch Average

- Moving Average
- Standard Deviation
- EXAMPLES we looked at in class

OOP = Object Oriented Programming
The conceptual basis for object orientation, is not that difficult, although it is couched in a certain language that we should be familiar with, and is often addressed in an entirely over-explained way (especially in programming textbooks). The simplest understanding is an analog to language, or words – which linguists will tell you are at once a thing, as well as often a reference to a thing. Most generally:
- Imagine the idea of a chair. This idea of a chair is a ‘class‘ – that is, it is your general concept of something that has no ‘specific’ manifestation (yet!)
- Class functions or methods refer to things that that class can general do or provide. Chairs can generally be used for sitting, or for propping open doors, or for hitting people over the head. These are functions of the class “chair.”
- Class fields or variables refer to properties of a class. Chairs could have a specific design, material, or upholstering.
- Imagine a specific chair. Having just the idea of a chair, is not particularly useful. Let’s say we’re talking about the Poul Kjaerholm chair (probably my favorite modernist chair). This chair is an ‘object‘ which is an ‘instance‘ of the class chair.
- functions or methods would be the same as for all chairs (above), but also might include elements specific to this chair. E.g.: Give-off expensive seeming leather smell.
- fields or variables would then be ‘filled in’ during an instantiation of a the object (E.g.: design: Kjaerholm, material: leather)
- Objects as ‘variable’ type:
- Creating an object from a defined class is much like creating a variable
- You must give it a name, and you must declare it (i.e.: ‘make’ one)
- Functions and fields are accessed via the dot operator
- Definining a class:
- Make a constructor (always with the same name of the class) -
- A method that defines what happens when you make an object, initialization
- Define the Class’ internal variables
- Define the Class’ functions and methods
- Make a constructor (always with the same name of the class) -
- You can have arrays of objects/classes! use tha [ ] operator
- Further conceptual info from Sun
Classes – Max/MSP
- There is a sort of ‘class’ structure to every instantiation of a Max object, more or less
- Particularly class-like structures are uses of poly~ objects, or Java/Javascript implementation in Max
Classes – Processing
- Processing allows the use of Classes, as well as their definition by the user (you)
- Reference for Processing Classes
- Reference for Processing Objects
- Example
- class_functions
- class_intro
- class_example (ball!)
- classes in the Video library, etc.
Classes – OpenFrameworks
- OpenFrameworks, unlike Max and Processing is a framework – or software framework – basically like a bunch of really big libraries/extensions, but you have to provide the infrastructure on your computer to program with
- On OSX, that infrastructure is called XCode – if you don’t have it, you can get it here
- The main difference between a library and a framework, is that a framework requires certain things of you and the way you write your code
- OF is a C++ framework – i.e.: It is a collection of C++ tools (other frameworks!!) that are designed for people like us
- The C++ language is a class-based language. It was the first, or the most popular first, language to come about after OOP really got going – so it’s designed for CLASS structures. It’s often referred to as “C with Classes.” Everything, more or less is a CLASS of something else. (This is also true of Java, Processing, etc., by the way, but most of that is obscured in Processing).
- Why? It can be REALLY fast. Like, RRREALLY fast.
- The basic idea
- C++ programs are assemblages of Class files
- Class files are composed of a ‘header’ (.h) file and a class (.cpp) file
- Headers are used to declare the Class and the methods of the class, but
- .cpp files are used to define these classes and methods
- C++ classes can define static methods (called anywhere, any time) and instance methods (called as methods of an instance of a class, i.e.: of an object)
- General usage and examples
- Download (get the FAT one)
- Every OF application is an instance of ” ofBaseApp” – which handles a bunch of stuff like fullscreen mode and user input, etc.
- Start by copying the folder “emptyExample” and renaming the folder
- Open testApp.cpp and insert code in event handling methods of the OBJECT testApp
- Note that if you want to create ‘global’ variables that can be accessed anywhere in the program – these need to be in the .h file!
- Docs for various methods/functions here
- Key addons:
- OpenCV – computer vision library (same as the one used in Max/MSP/Jitter, but much faster here)
- ofVectorMath – similar to the Shiffman Processing vector library
- NB.: There is very good reason, as OF is based on Processing, to sketch/learn first in Processing and then move/re-implement in OF!

