RTcmix esoterica I/II
It's not really "esoterica", I just thought that would be a snazzy
title. Essentially we developed a full app, a little game in which
the user 'chases' a rectangle around the device screen. Clicking
on the rectangle turns on and off the Klaus Schulze synthesis
algorithm, and also speeds up the rectangle.
Along the way we did a bit of object-oriented programming. Also, at the
end of class we tried a few of the example apps included in the
OF distribution (in the [OF-release-directory]/examples/ios/ directory).
Be sure to include the code under item #2a on the
ofRTcmix-iOS setup page
in the "main.mm" file.
Links
- C++ tutorial
-- I meant to link this in on one of our earlier pages, but now that
we're creating objects it's probably not a bad reference for you
to have. Pretty in-depth, but there if you want it.
- OpenFrameworks Documentation
-- This is linked on other pages, but what the heck, I'll put it here too.
Class Notes and Project Downloads
Instead of a single package download that has a complete Xcode project,
I'm going to list each of the iterations of the ofApp.mm/ofApp.h files,
and the "mybutton.cpp/h" files as we worked through them in class.
Although they will have names like "ofApp2a.mm", you should rename
them "ofApp.mm" (etc.) for compilation in your Xcode project.
- ofApp1.mm/ofApp1.h
-- draw a single red rectangle
- ofApp2a.mm/ofApp2a.h
-- set the background color, draw a red rectangle and detect a click
inside of it.
- ofApp2b.mm/ofApp2b.h
-- set the background color, draw a red rectangle, detect a click
inside of it, and reset the color depending on the clicked 'state'.
- ofApp3a.mm/ofApp3a.h
 
mybutton1.cpp/mybutton1.h
-- do all the button operations, but encapsulate it in a 'mybutton'
object. Also use relative values to place the button instead of
absolute pixel values (for different device screen sizes).
- ofApp3b.mm/ofApp3b.h
 
mybutton2.cpp/mybutton2.h
-- add audio back in; the button turns it on and off.
- ofApp3c.mm/ofApp3c.h
 
mybutton3.cpp/mybutton3.h
-- animate the button!
[note: This was the code we developed in class,
and it is slightly different from the other examples up to this point.
It also has a slight bug when the rectangle hits the boundary. See if
you can fix it! -- I'll show the fix in class next time.]
Assignment
+ fix the 'boundary bug' in the final ofApp3c example.