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

WIP:音量編集機能の追加 #2263

Closed
wants to merge 0 commits into from

Conversation

rokujyushi
Copy link
Contributor

内容

音量をピッチと同様にカーブを描いて編集できるようにする。
ラインの色やアイコンは暫定

問題点

  • COMMAND_SET_VOLUME_EDIT_DATA(src\store\singing.ts 2705行目)でエラーになる
    volumeData.dataにundefinedが含まれているため?
  • UIの上の音量の基準が不明
  • 音量編集に不要なコードが恐らく含まれている

関連 Issue

#2003

スクリーンショット・動画など

ツールバー

image

全体

image

Copy link
Contributor

@sigprogramming sigprogramming left a comment

Choose a reason for hiding this comment

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

音量編集機能の実装ありがとうございます!

src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
Comment on lines 109 to 112
const zoomX = store.state.sequencerZoomX;
const zoomY = store.state.sequencerZoomY;
const offsetX = props.offsetX;
const offsetY = props.offsetY;
Copy link
Contributor

@sigprogramming sigprogramming Sep 8, 2024

Choose a reason for hiding this comment

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

音量の線はシーケンサーを垂直方向にスクロールしたときに動かない方が良いかもです。なので、ここのzoomYoffsetYは無くて良いかも。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

削除しました。

Copy link
Contributor

Choose a reason for hiding this comment

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

props.offsetYが残ってるかも…?

src/sing/domain.ts Outdated Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
@rokujyushi rokujyushi changed the title 音量編集機能の追加 WIP:音量編集機能の追加 Oct 12, 2024
@rokujyushi
Copy link
Contributor Author

#2263 (comment)
#2263 (comment)
以上の二つ以外の指摘箇所についてはソースコードの修正を行ないました。
音量のカーブを書いてもエラーが発生しなくなりました。

指摘箇所の確認漏れで複数回に分けてコミットしてしまったので見づらいと思います。
すみません。

Copy link
Contributor

@sigprogramming sigprogramming left a comment

Choose a reason for hiding this comment

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

修正ありがとうございます!

Comment on lines 433 to 439
// const prevCursorPos = ref<
// | { prevCursorFrame: number, prevCursorFrequency: number,prevCursorVolume: number }
// | undefined
// >(undefined);
let prevCursorFrame: number = 0;
let prevCursorFrequency: number = 0;
let prevCursorVolume: number = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

前のコードは消してしまって大丈夫です!
また、= 0で型は推論されるはずなので、型注釈は無くても大丈夫だと思います!

Comment on lines 1096 to 1097
// 平滑化を行う
let data = previewVolumeEdit.value.data;
Copy link
Contributor

@sigprogramming sigprogramming Oct 13, 2024

Choose a reason for hiding this comment

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

ここはこうかも。(配列のコピーは必要ないかもですが念のため…)

Suggested change
// 平滑化を行う
let data = previewVolumeEdit.value.data;
const data = [...previewVolumeEdit.value.data];

Comment on lines 178 to 180
if(Number.isNaN(linear)||linear === undefined){
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

linearNaNundefinedにはならないはずなので、この処理は必要ないと思います!

const db = linearToDecibel(linear);
const y = db * -120 * zoomY - offsetY;//- ;
const y = decibelToViewY(db);//- ;
Copy link
Contributor

Choose a reason for hiding this comment

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

コメントが残っていたので。

Suggested change
const y = decibelToViewY(db);//- ;
const y = decibelToViewY(db);

@@ -257,7 +258,7 @@ const setVolumeDataToVolumeLine = async (
};

const generateOriginalVolumeData = () => {
const unvoicedPhonemes = UNVOICED_PHONEMES;
//const unvoicedPhonemes = UNVOICED_PHONEMES;
Copy link
Contributor

Choose a reason for hiding this comment

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

何のためにコメントアウトされているかが後で分からなくなるので、
コメントアウトの意図を書くか、必要なければ消して良いと思います!


const removedLineStrips: LineStrip[] = [];

// 無くなったピッチデータを調べて、そのピッチデータに対応するLineStripを削除する
Copy link
Contributor

Choose a reason for hiding this comment

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

ピッチpitchになっている箇所が何か所かあるかも。

Comment on lines 792 to 797
CLEAR_VOLUME_EDIT_DATA: {
// ピッチ編集データを失くす。
mutation(state, { trackId }) {
const track = getOrThrow(state.tracks, trackId);
track.pitchEditData = [];
},
Copy link
Contributor

Choose a reason for hiding this comment

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

ここもピッチpitchEditDataになってますね。

Suggested change
CLEAR_VOLUME_EDIT_DATA: {
// ピッチ編集データを失くす
mutation(state, { trackId }) {
const track = getOrThrow(state.tracks, trackId);
track.pitchEditData = [];
},
CLEAR_VOLUME_EDIT_DATA: {
// ボリューム編集データを失くす
mutation(state, { trackId }) {
const track = getOrThrow(state.tracks, trackId);
track.volumeEditData = [];
},

Comment on lines 772 to 774
if (!isValidVolumeEditData(volumeArray)) {
throw new Error("The pitch edit data is invalid.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

ここも。

Suggested change
if (!isValidVolumeEditData(volumeArray)) {
throw new Error("The pitch edit data is invalid.");
}
if (!isValidVolumeEditData(volumeArray)) {
throw new Error("The volume edit data is invalid.");
}

Comment on lines 550 to 551
// ピッチ編集をf0に適用する
const startFrame = Math.max(0, singingGuideStartFrame);
Copy link
Contributor

Choose a reason for hiding this comment

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

ここもピッチになってますね。

Suggested change
// ピッチ編集をf0に適用する
const startFrame = Math.max(0, singingGuideStartFrame);
// ボリューム編集をvolumeに適用する
const startFrame = Math.max(0, singingGuideStartFrame);

@@ -91,6 +91,7 @@ export const trackSchema = z.object({
volumeRangeAdjustment: z.number(), // 声量調整量
notes: z.array(noteSchema),
pitchEditData: z.array(z.number()), // 値の単位はHzで、データが無いところはVALUE_INDICATING_NO_DATAの値
volumeEditData: z.array(z.number()), // 値の単位はdbで、データが無いところはVALUE_INDICATING_NO_DATAの値
Copy link
Contributor

Choose a reason for hiding this comment

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

細かいですが…

Suggested change
volumeEditData: z.array(z.number()), // 値の単位はdbで、データが無いところはVALUE_INDICATING_NO_DATAの値
volumeEditData: z.array(z.number()), // 値の単位はdBで、データが無いところはVALUE_INDICATING_NO_DATAの値

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.

2 participants