IRremote for my 8x8x8 led cube on the mega

I think I know what the problem is ... I think the program just loops everytime the patern effect is finished.
What I need is a loop just for the IR.... but how ??

Thats excatly whats happening, I put the irrecv.decode` line somewhere else
and everytime the cube effect changed, the code ran past that line and the result was printed.

But I need the IR to recieve all the time ... not just when the code changes the cube effect. So how do I create a loop for that?

Roon_cube_Mega.ino (25.2 KB)