From 24c2a2c85426a751ff9ae027d8c20dba780c3533 Mon Sep 17 00:00:00 2001 From: Sig Date: Sun, 15 Oct 2023 15:26:04 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B9=E3=83=8A=E3=83=83=E3=83=97=E3=82=92?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=99=E3=82=8B=E6=A9=9F=E8=83=BD=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Sing/ScoreSequencer.vue | 13 ++++++- src/components/Sing/ToolBar.vue | 51 ++++++++++++++++++++++++-- src/helpers/singHelper.ts | 32 ++++++++++++++++ src/store/singing.ts | 14 +++++++ src/store/type.ts | 5 +++ 5 files changed, 109 insertions(+), 6 deletions(-) diff --git a/src/components/Sing/ScoreSequencer.vue b/src/components/Sing/ScoreSequencer.vue index cc049378e8..e240f1b612 100644 --- a/src/components/Sing/ScoreSequencer.vue +++ b/src/components/Sing/ScoreSequencer.vue @@ -144,6 +144,8 @@ import { baseYToNoteNumber, keyInfos, getDoremiFromNoteNumber, + getNoteTypes, + isTriplet, } from "@/helpers/singHelper"; export default defineComponent({ @@ -253,8 +255,15 @@ export default defineComponent({ if (noteNumber < 0) { return; } - // NOTE: ノートの追加は1/8をベース - const duration = getNoteDuration(8, tpqn.value); + // NOTE: ノートの長さはスナップをベース + const snapType = state.sequencerSnapType; + const noteTypes = getNoteTypes(tpqn.value).filter((value) => { + return value <= 8; // 最小の長さは1/8 + }); + const noteType = + noteTypes.find((value) => value === snapType) ?? + noteTypes[noteTypes.length - 1]; + const duration = getNoteDuration(noteType, tpqn.value); const lyric = getDoremiFromNoteNumber(noteNumber); // NOTE: 仮ID const id = uuidv4(); diff --git a/src/components/Sing/ToolBar.vue b/src/components/Sing/ToolBar.vue index c65a010c5b..d70d571d6b 100644 --- a/src/components/Sing/ToolBar.vue +++ b/src/components/Sing/ToolBar.vue @@ -74,9 +74,18 @@
- +
@@ -84,6 +93,7 @@