From fff788a59b4cfbfa52f9d88a6299222c400eb01a Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sun, 7 Apr 2024 00:22:23 +0900 Subject: [PATCH 01/16] =?UTF-8?q?Add:=20=E4=B8=80=E9=80=9A=E3=82=8A?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 44 +------ package.json | 2 +- src/components/Dialog/ImportMidiDialog.vue | 30 +++-- src/sing/midi.ts | 144 +++++++++++++++++++++ src/store/singing.ts | 25 ++-- 5 files changed, 186 insertions(+), 59 deletions(-) create mode 100644 src/sing/midi.ts diff --git a/package-lock.json b/package-lock.json index 63ad065289..b89c341a55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,6 @@ "dependencies": { "@gtm-support/vue-gtm": "1.2.3", "@quasar/extras": "1.10.10", - "@tonejs/midi": "2.0.28", "async-lock": "1.4.0", "buffer": "6.0.3", "clone-deep": "4.0.1", @@ -25,6 +24,7 @@ "hotkeys-js": "3.13.6", "immer": "9.0.21", "markdown-it": "13.0.2", + "midi-file": "1.2.4", "move-file": "3.0.0", "multistream": "4.1.0", "pixi.js": "7.4.0", @@ -2051,20 +2051,6 @@ "node": ">=10" } }, - "node_modules/@tonejs/midi": { - "version": "2.0.28", - "resolved": "https://registry.npmjs.org/@tonejs/midi/-/midi-2.0.28.tgz", - "integrity": "sha512-RII6YpInPsOZ5t3Si/20QKpNqB1lZ2OCFJSOzJxz38YdY/3zqDr3uaml4JuCWkdixuPqP1/TBnXzhQ39csyoVg==", - "dependencies": { - "array-flatten": "^3.0.0", - "midi-file": "^1.2.2" - } - }, - "node_modules/@tonejs/midi/node_modules/array-flatten": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz", - "integrity": "sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==" - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -9482,9 +9468,9 @@ } }, "node_modules/midi-file": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/midi-file/-/midi-file-1.2.3.tgz", - "integrity": "sha512-JsOv9cajkVkR1gbL9Jvplz6X4lPuyVfcci0kSLzXZ2WKs7TJF72m9U5rmp45/H/1As+96dXY8xgvNLiIfGOU4w==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/midi-file/-/midi-file-1.2.4.tgz", + "integrity": "sha512-B5SnBC6i2bwJIXTY9MElIydJwAmnKx+r5eJ1jknTLetzLflEl0GWveuBB6ACrQpecSRkOB6fhTx1PwXk2BVxnA==" }, "node_modules/miller-rabin": { "version": "4.0.1", @@ -14929,22 +14915,6 @@ "defer-to-connect": "^2.0.0" } }, - "@tonejs/midi": { - "version": "2.0.28", - "resolved": "https://registry.npmjs.org/@tonejs/midi/-/midi-2.0.28.tgz", - "integrity": "sha512-RII6YpInPsOZ5t3Si/20QKpNqB1lZ2OCFJSOzJxz38YdY/3zqDr3uaml4JuCWkdixuPqP1/TBnXzhQ39csyoVg==", - "requires": { - "array-flatten": "^3.0.0", - "midi-file": "^1.2.2" - }, - "dependencies": { - "array-flatten": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz", - "integrity": "sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==" - } - } - }, "@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -20930,9 +20900,9 @@ } }, "midi-file": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/midi-file/-/midi-file-1.2.3.tgz", - "integrity": "sha512-JsOv9cajkVkR1gbL9Jvplz6X4lPuyVfcci0kSLzXZ2WKs7TJF72m9U5rmp45/H/1As+96dXY8xgvNLiIfGOU4w==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/midi-file/-/midi-file-1.2.4.tgz", + "integrity": "sha512-B5SnBC6i2bwJIXTY9MElIydJwAmnKx+r5eJ1jknTLetzLflEl0GWveuBB6ACrQpecSRkOB6fhTx1PwXk2BVxnA==" }, "miller-rabin": { "version": "4.0.1", diff --git a/package.json b/package.json index 89b93a1014..9e68f241d6 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "dependencies": { "@gtm-support/vue-gtm": "1.2.3", "@quasar/extras": "1.10.10", - "@tonejs/midi": "2.0.28", "async-lock": "1.4.0", "buffer": "6.0.3", "clone-deep": "4.0.1", @@ -52,6 +51,7 @@ "hotkeys-js": "3.13.6", "immer": "9.0.21", "markdown-it": "13.0.2", + "midi-file": "1.2.4", "move-file": "3.0.0", "multistream": "4.1.0", "pixi.js": "7.4.0", diff --git a/src/components/Dialog/ImportMidiDialog.vue b/src/components/Dialog/ImportMidiDialog.vue index f034fd3684..4a9cf31da4 100644 --- a/src/components/Dialog/ImportMidiDialog.vue +++ b/src/components/Dialog/ImportMidiDialog.vue @@ -23,6 +23,7 @@ v-if="midi" v-model="selectedTrack" :options="tracks" + :disable="midiFileError != undefined" emit-value map-options label="インポートするトラック" @@ -47,7 +48,7 @@ color="toolbar-button" text-color="toolbar-button-display" class="text-no-wrap text-bold q-mr-sm" - :disabled="selectedTrack === null" + :disabled="selectedTrack === null || midiFileError != undefined" @click="handleImportTrack" /> @@ -59,7 +60,7 @@