Had to move cycle done clock one sooner. There was a blank clock between valid_auto going low and cycle_done going high which was causing the max_idx mux to get 0 rather than retain its value, causing the divider to go to 0 and all hell to break loose. Should be fixed now, allowing for overtone detection