RGB flashing color between while loops

Try

r = (long) rn * audio/1024;