RNN-Based Generation of Polyphonic Music and Jazz Improvisation