Progress on the iOS drum app

A follower on Facebook asked how the viz is being done, it’s pretty simple actually, but you have to know about how things flow in the app.

The keys are just controllers. Instead of MIDI notes they fire off messages of “bass1” or “drumPad3”. The routine that handles that has access to the star “size” and bumps it up.

The starfield routine draws the stars with that new size, and over time shrinks the stars back to “normal” size. The stars are randomly added to the starfield and I do some simple trig to figure out what angle from the absolute center they are so as the stars accelerate towards the edges of the screen they at least are coming out radially from the center.

The starfield also clears itself on every frame, except when you push the throttle up. That changes it to darken on every frame by some %. At the top of the throttle it isn’t darkening much so you get to see all the previous frames, hence the zooming look to it.

Speaking of frames, I have a timer that goes off about 20 frames a sec. That timer redraws the starfield. It also tells the scopes to redraw.

The scopes in the left and right are looking at the output buffer for the actual audio being sent out the headphone jack. The left/right scopes are reversed, hence the mirrored pattern. The scopes are 2 separate UIViews and I’ve just told them to draw whatever is in the current audio buffer.

The audio buffer is being handled by Novocaine and I’m currently at about 12 ms, so it’s something like 500 samples.

The center “target” is actually the effects slider and when you drag it around that’s just a button being clipping in a UIView. There’s a permanent low/high-pass filter on the output signal and that effects slider just selects the algorithm and sets the Q and f0 parameters accordingly.

And the volume throttle is a UIView that’s inside another view. I’ve constrained it to only go up/down, so the outer view is working as a track.

Oh, and the whole starship cockpit is one very large PNG with a transparent cutout in the middle for the starfield. The buttons are each a custom UIButton that does things like turn on/off when you press them, or in the case of the upper right drum pad buttons they work as toggles.