I'm looking for a demo example of timing music to graphics

Hello,

        I've started some graphics and music demos.  I'm using .xm's and graphics
in 320x200x256.  All was going well till I realized {which took way too
long} that I my timing would be off on all other computers.  Say I want
certain graphical events to happen at certain times.  I have some timers
that claim to get 1000 ticks a second, but... anyways.  I want something as
simple as flashes of light on the down-beat.  Do I have to just write the
code so it waits till a particular "tick" then flashes.  Or is there a
better way to do it.

brent