Homework #1: iPhone Programming Lab: Audio + Interaction




The class and the tutorial covered most materials for the apps of sine wave and FM synthesis, including setting up audio callback, initialization, buffer population, waveform synthesis, connecting synthesis parameters to axes of accelerometer or touching pad, etc. I implemented the toggle for app#2 by introducing a flag variable corresponding to the status of the trigger button, to switch between continuous audio outputs and manually trigger notes. I added a smaller view for changing the carrier frequency and modulator frequency by touching the screen in addition to the accelerometer way. For app#3, the delay line is implemented by setting up a circular buffer (refer to hw2 from 256a). The two-points pinch gesture is referring the method in Uri’s email :P . I think this is a pretty standard way to do multi-touch, and I also added the boundary conditions for myView. Finally, the label for showing the current delay length is by using the accelerometer callback function, which updates the input user data in real time. Therefore, any variable can be converted to UILabel for output in the similar way.



Download projects:

App #1: helloSine (updated)

App #2: fmSynthesis

App #3: delayFeedback