converted params.noteLength to number before using it