Cleaned up bang loop math in java waveform generator.