Rename period and period2 to highPeriod and lowPeriod
Make computation time compensation for low period automatic

Also moved LED code to loop() instead of from playSound()

Also changed logical AND to bit shift for speed