How to use the @magenta/music.MusicRNN function in @magenta/music

To help you get started, we’ve selected a few @magenta/music examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vibertthio / runn / src / index.js View on Github external
initChordRNN(chordProgression) {
    const modelCheckPoint = './checkpoints/chord_pitches_improv';
    const model = new MusicRNN(modelCheckPoint);
    model.initialize()
      .then(() => {
        console.log('initialized!');
        return model.continueSequence(
          presetMelodies['Twinkle'],
          this.nOfBars * 16,
          1.0,
          chordProgression,
          );
      })
      .then((i) => {
        console.log(i);
        this.setMelodies([i], chordProgression);
        this.model = model;
        this.setState({
          loadingModel: false,
github vibertthio / runn / src / index.js View on Github external
initRNN() {
    const modelCheckPoint = './checkpoints/basic_rnn';
    const model = new MusicRNN(modelCheckPoint);

    model.initialize()
      .then(() => {
        console.log('initialized!');
        return model.continueSequence(
          presetMelodies['Twinkle'],
          this.nOfBars * 16,
          1.0)
      })
      .then((i) => {
        this.setMelodies([i]);
        this.model = model;
        this.setState({
          loadingModel: false,
        });
        this.sound.triggerSoundEffect(4);

@magenta/music

Make music with machine learning, in the browser.

Apache-2.0
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Similar packages