Web Audio API loop implementation in a very ugly way