Generate musical patterns with Node.js