Open rosmineb opened 1 year ago
Hello,
I'm trying to use Magenta to generate a random melody.
I copied the test case: https://github.com/magenta/magenta-js/blob/485b2ccd407f9089ef4aaceb0096f50dafe047db/music/src/music_rnn/model_test.ts#L53-L64
but I'm getting strange results, specifically I have 2 issues:
const melodyrnn = new mm.MusicRNN( // "https://storage.googleapis.com/magentadata/js/checkpoints/music_rnn/melody_rnn" "https://storage.googleapis.com/magentadata/js/checkpoints/music_rnn/basic_rnn" ); const mel_teapot = { notes: [ { pitch: 69, quantizedStartStep: 0, quantizedEndStep: 2, program: 0 }, { pitch: 71, quantizedStartStep: 2, quantizedEndStep: 4, program: 0 }, { pitch: 73, quantizedStartStep: 4, quantizedEndStep: 6, program: 0 }, { pitch: 74, quantizedStartStep: 6, quantizedEndStep: 8, program: 0 }, { pitch: 76, quantizedStartStep: 8, quantizedEndStep: 10, program: 0 }, { pitch: 81, quantizedStartStep: 12, quantizedEndStep: 16, program: 0 }, { pitch: 78, quantizedStartStep: 16, quantizedEndStep: 20, program: 0 }, { pitch: 81, quantizedStartStep: 20, quantizedEndStep: 24, program: 0 }, { pitch: 76, quantizedStartStep: 24, quantizedEndStep: 32, program: 0 }, ], quantizationInfo: { stepsPerQuarter: 4 }, totalQuantizedSteps: 32, }; async function generateMelody() { try { let resultSeq1 = await melodyrnn.continueSequence(mel_teapot, 15, 1); let resultSeq2 = await melodyrnn.continueSequence(mel_teapot, 15); console.log("resultseq notes", resultSeq1.notes); // this is empty console.log("resultseq notes", resultSeq2.notes); // this is not empty } catch (error) { console.log("error", error); } }
At first there is some variety but then it just repeats pitch 77 (which isn't in the A major scale that the teapot melody uses)
What can I do to generate more unique melodies? Thanks!
I am having this same issue, which is annoying as examples online seem to generate melodies no problem. Would also like an answer to this, as I'm trying to use this for a uni project
Hello,
I'm trying to use Magenta to generate a random melody.
I copied the test case: https://github.com/magenta/magenta-js/blob/485b2ccd407f9089ef4aaceb0096f50dafe047db/music/src/music_rnn/model_test.ts#L53-L64
but I'm getting strange results, specifically I have 2 issues:
At first there is some variety but then it just repeats pitch 77 (which isn't in the A major scale that the teapot melody uses)
What can I do to generate more unique melodies? Thanks!