Added new beat calculating function for rests. Rewrote Duck Hunt
demo to show its use.