Please help me boil this down

Eli, it a nice piece, it make me think about a end-scene, or a OST for a final boss fight for a RPG game (like final fantasy VII). What I find really impressive (and I want to understand it) it’s the control code you did for this piece. I’m looking for understend the |i| after the define function, and the tracker list at the beginning. Maybe it something like defining a pattern sequence, it would be really usefull.