cleaned up sound generator