Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ソング:startFrameがマイナス値になりf0にundefinedが入るバグを修正 #2032

Merged
merged 2 commits into from
Apr 28, 2024

Conversation

sigprogramming
Copy link
Contributor

@sigprogramming sigprogramming commented Apr 27, 2024

内容

#2031 の修正PRです。
applyPitchEditstartFrameがマイナス値になり、f0にundefinedが入ってレンダリングに失敗するのを修正します。

SequencerPitchの方もstartFrameがマイナス値になってました…それも修正します。

関連 Issue

close #2031

その他

  • applyPitchEditのテストがあれば防げたと思うので、テストを書いていった方が良さそう
  • 区間を扱うユーティリティー関数を作った方が良いかも
  • 1小節目の頭からノートを入力すると書き出し時に一番最初の子音が消えるので、1小節目は入力不可にするorノートをエラー表示でも良いかも

@sigprogramming sigprogramming requested a review from a team as a code owner April 27, 2024 22:27
@sigprogramming sigprogramming requested review from y-chan and removed request for a team April 27, 2024 22:27
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

複雑性が上がってきていることを認知しました!(気づかず申し訳ない 🙇 )
1小節目入力不可、ありに思いました!
か、最初にノート置いてエラーが出ないこと確認、みたいなe2eテスト書くのもありかもですね!

Comment on lines -295 to 309
for (let i = 0; i < f0.length; i++) {
const phoneme = framePhonemes[i];
const startFrame = Math.max(0, singingGuideStartFrame);
const endFrame = singingGuideEndFrame;
for (let i = startFrame; i < endFrame; i++) {
const phoneme = framePhonemes[i - singingGuideStartFrame];
const unvoiced = unvoicedPhonemes.includes(phoneme);
if (!unvoiced) {
tempData[startFrame + i] = f0[i];
tempData[i] = f0[i - singingGuideStartFrame];
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

マイナスを引いてるのと、startFrameが2つあるのがちょっとややこしいかもと思いました!
ちょっと計算量もったいないけどこうでも良いかも?(数百回計算されそうだからだいぶもったいないかな・・・)

    for (let i = 0; i < f0.length; i++) {
      const phoneme = framePhonemes[i];
      const unvoiced = unvoicedPhonemes.includes(phoneme);
      if (!unvoiced) {
        // 1小節目のノートは開始が負の数になることがある
        if( startFrame + i >= 0 ) {
          tempData[startFrame + i] = f0[i];
        }
      }
    }

@Hiroshiba Hiroshiba merged commit 060e5e2 into VOICEVOX:main Apr 28, 2024
9 checks passed
sevenc-nanashi pushed a commit to sevenc-nanashi/voicevox that referenced this pull request Apr 28, 2024
* startFrameがマイナス値になりf0にundefinedが入るバグを修正

* 修正
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[song]ノーツが先頭に存在すると動作しない
2 participants