Buffering is the main cause of delay. A number of input samples are accumulated in a buffer before the software is notified about the buffer being ready for processing. It then does whatever processing you want it to do and sends another buffer to the audio interface which will output it 1...
I'm not sure where your ln(i) comes from but that part is correct since ln(i) = i\pi/2. However it can be simplified further.
I would have just written:
i^{i} = (e^{i\pi/2})^{i} = e^{i i\pi/2} = e^{- \pi/2} and that's your answer since this is a real number already. (Wolfram Alpha confirms it)
Playing 4 dimensional tic-tac-toe is a fun way to practice one's ability to "see" in 4 dimensions. We used to do that between classes when I was in engineering school. I think we used a 4x4x4x4 hypercube. Anyway that was fun but it won't really help visualizing more complex shapes.
The problem with any interpretation that requires an 'observer' is that you have to define what an observer is. Why would some physical entities be considered observers and not others? Humans, cats, worms, bacterias, computers, measuring equipments? How do you tell the difference? You'd have to...
The standard rand() function is really bad and you'll run into problems very quickly (even for non-scientific applications like games).
An easy solution is to use a Mersenne twister generator instead. (There are some ready to use implementations linked at the bottom of the wiki page).
Except those "waves" also show particle-like behavior in some experiments. So they are something that has a particle aspect and a wave aspect. Now maybe we should have invented a new name to avoid confusion with classical particles, but when we refer to particles in a QM context we're really...