0

Vue または Nuxt テンプレートでマゼンタ音楽フレームワークをセットアップする適切な方法を理解したいです。これまでのところ、例を見つけることができません。誰かがこのセットアップを手伝ってくれますか?

( https://hello-magenta.glitch.me/ )のマゼンタ音楽の Hello World の例に従っており、この例を VueJS または NuxtJS フレームワークに取り入れようとしています。

VueJSでMagentaをセットアップしようとしたレポへのリンクは次のとおりです- https://github.com/Dantonyswamy/magentamusic-vue

4

2 に答える 2

0
  1. モジュールをhttps://www.npmjs.com/package/@magenta/musicにインストールします
npm i @magenta/music
  1. モジュールを vue または nuxt の main.js に登録します。
const model = require('@magenta/music/node/music_vae');
const core = require('@magenta/music/node/core');

// These hacks below are needed because the library uses performance and fetch which
// exist in browsers but not in node. We are working on simplifying this!
const globalAny: any = global;
globalAny.performance = Date;
globalAny.fetch = require('node-fetch');

// Your code:
const model = new mode.MusicVAE('/path/to/checkpoint');
const player = new core.Player();
model
  .initialize()
  .then(() => model.sample(1))
  .then(samples => {
    player.resumeContext();
    player.start(samples[0])
  });
于 2019-09-19T03:48:40.380 に答える