This is pretty long for an anonymous function. I'd recommend you make it a named top-level function like addNewTone() or something.