Something is wrong with the current IORef implementation on iPhone. I decided not to invest further since tackling both graphics and sound synthesizing is a bit too much work.
I'm re-implementing the rika's rendering engine such that it's 100% OpenGL ES 2.0 and not backward compatible. The reason is that OpenGL ES 2.0 is a completely different interface than 1.1, keeping a separate rendering path is too much trouble.
I was able to implement the matrix and associated transformations in Haskell, the way ES 2.0 / GL 3.1 works is that there's no push / pop matrix anymore, perspective or frustum to setup projection matrix are also gone. The programmer is responsible to tell the graphics card which transformation matrix to use. It's actually more flexible than that, you can send arbitrary matrices to the graphics card (technically through uniform), and then in shader code utilize these matrices, one of them could be used as a model view matrix, another as projection matrix. Other variables could be passed as well, which could hold lighting position and material properties.
I wish someone could tell me these before.
Flashback, I wasn't able to take the computer graphics course in collage, it was a tough decision though: I had to pick an elective course either in music or programing since they are offered at the same time slot. I chose a music course, and never regretted it. But still this desire for computer graphics just kept haunting me, it's like this frikken awesome girlfriend I can never have. Finally enough is enough, I'll do it.
Anyway, for the audio part, I'll probably stick with OpenAL for simple playback and maybe pick up some Open Sound Control (OSC) code to interface it with some real synth. Still in control, yep, ... i hope.