From f08206c6c1ff3fe1d04c66236c7d64340208f361 Mon Sep 17 00:00:00 2001 From: Sig Date: Sat, 27 Apr 2024 22:06:02 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E9=9F=B3=E9=87=8F=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=99=82=E3=81=AB=E9=9F=B3=E5=9F=9F=E8=AA=BF=E6=95=B4=E3=81=AE?= =?UTF-8?q?=E5=87=A6=E7=90=86=EF=BC=88note=E3=81=AEkey=E3=81=AE=E3=82=B7?= =?UTF-8?q?=E3=83=95=E3=83=88=EF=BC=89=E3=81=8C=E8=A1=8C=E3=82=8F=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E6=AD=A3=E3=81=97=E3=81=8F=E9=9F=B3=E9=87=8F=E3=81=8C?= =?UTF-8?q?=E7=94=9F=E6=88=90=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/singing.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/store/singing.ts b/src/store/singing.ts index e3e4eaacc4..37794d8615 100644 --- a/src/store/singing.ts +++ b/src/store/singing.ts @@ -1338,8 +1338,8 @@ export const singingStore = createPartialStore({ `Fetched frame audio query. Phonemes are "${phonemes}".`, ); + // 音域調整を適用する shiftGuidePitch(keyRangeAdjustment, query); - scaleGuideVolume(volumeRangeAdjustment, query); const startTime = calcStartTime( phrase.notes, @@ -1363,9 +1363,12 @@ export const singingStore = createPartialStore({ }); } - // 歌い方をコピーして、ピッチ編集を適用する + // ピッチ編集を適用する前に、歌い方をコピーする singingGuide = structuredClone(toRaw(singingGuide)); + + // ピッチ編集を適用する + applyPitchEdit(singingGuide, pitchEditData, editFrameRate); // 歌声のキャッシュがあれば取得し、なければ音声合成を行う @@ -1391,11 +1394,10 @@ export const singingStore = createPartialStore({ phrase.notes, tempos, tpqn, - keyRangeAdjustment, + 0, // クエリのピッチは音域調整済みなので、音域調整の処理(noteのkeyのシフト)は行わない singingGuide.frameRate, restDurationSeconds, ); - const volumes = await dispatch("FETCH_SING_FRAME_VOLUME", { notes: notesForRequestToEngine, frameAudioQuery: singingGuide.query, @@ -1403,6 +1405,8 @@ export const singingStore = createPartialStore({ engineId: singerAndFrameRate.singer.engineId, }); singingGuide.query.volume = volumes; + + // 声量調整を適用する scaleGuideVolume(volumeRangeAdjustment, singingGuide.query); const blob = await synthesize( From b90b70b27b9ae64be16f37aaef4fa410193fca4e Mon Sep 17 00:00:00 2001 From: Sig Date: Sun, 28 Apr 2024 00:40:16 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E9=9F=B3=E9=87=8F=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=94=A8=E3=81=AB=E3=82=AF=E3=82=A8=E3=83=AA=E3=82=92=E3=82=B3?= =?UTF-8?q?=E3=83=94=E3=83=BC=E3=81=97=E3=81=A6=E3=80=81=E3=82=82=E3=81=86?= =?UTF-8?q?=E4=B8=80=E5=BA=A6f0=E3=82=B7=E3=83=95=E3=83=88=E3=81=97?= =?UTF-8?q?=E3=81=A6=E9=9F=B3=E9=87=8F=E7=94=9F=E6=88=90=E3=81=99=E3=82=8B?= =?UTF-8?q?=E5=BD=A2=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/singing.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/store/singing.ts b/src/store/singing.ts index 37794d8615..4ac543f5bd 100644 --- a/src/store/singing.ts +++ b/src/store/singing.ts @@ -1388,19 +1388,24 @@ export const singingStore = createPartialStore({ logger.info(`Loaded singing voice from cache.`); } else { - // ピッチ編集を適用したクエリから音量を作る - // 音量値はAPIを叩く毎に変わるので、calc hashしたあとに音量を取得している + // 音量生成用のクエリを作る + // ピッチ編集を適用したクエリをコピーし、 + // f0をもう一度シフトして、f0生成時の(シフトする前の)高さに戻す + const queryForVolume = structuredClone(singingGuide.query); + shiftGuidePitch(-keyRangeAdjustment, queryForVolume); const notesForRequestToEngine = createNotesForRequestToEngine( phrase.notes, tempos, tpqn, - 0, // クエリのピッチは音域調整済みなので、音域調整の処理(noteのkeyのシフト)は行わない + keyRangeAdjustment, singingGuide.frameRate, restDurationSeconds, ); + // 音量生成用のクエリから音量を作る + // 音量値はAPIを叩く毎に変わるので、calc hashしたあとに音量を取得している const volumes = await dispatch("FETCH_SING_FRAME_VOLUME", { notes: notesForRequestToEngine, - frameAudioQuery: singingGuide.query, + frameAudioQuery: queryForVolume, styleId: singingTeacherStyleId, engineId: singerAndFrameRate.singer.engineId, }); From 81845af6f8436a7b60da9b96169ed94d2244461d Mon Sep 17 00:00:00 2001 From: Sig Date: Sun, 28 Apr 2024 00:44:51 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/singing.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/singing.ts b/src/store/singing.ts index 4ac543f5bd..ec529cce28 100644 --- a/src/store/singing.ts +++ b/src/store/singing.ts @@ -1393,16 +1393,17 @@ export const singingStore = createPartialStore({ // f0をもう一度シフトして、f0生成時の(シフトする前の)高さに戻す const queryForVolume = structuredClone(singingGuide.query); shiftGuidePitch(-keyRangeAdjustment, queryForVolume); + + // 音量生成用のクエリから音量を作る + // 音量値はAPIを叩く毎に変わるので、calc hashしたあとに音量を取得している const notesForRequestToEngine = createNotesForRequestToEngine( phrase.notes, tempos, tpqn, - keyRangeAdjustment, + keyRangeAdjustment, // f0を生成するときと同様に、noteのkeyのシフトを行う singingGuide.frameRate, restDurationSeconds, ); - // 音量生成用のクエリから音量を作る - // 音量値はAPIを叩く毎に変わるので、calc hashしたあとに音量を取得している const volumes = await dispatch("FETCH_SING_FRAME_VOLUME", { notes: notesForRequestToEngine, frameAudioQuery: queryForVolume,