-
Notifications
You must be signed in to change notification settings - Fork 309
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
WIP:音量編集機能の追加 #2263
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
音量編集機能の実装ありがとうございます!
const zoomX = store.state.sequencerZoomX; | ||
const zoomY = store.state.sequencerZoomY; | ||
const offsetX = props.offsetX; | ||
const offsetY = props.offsetY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
音量の線はシーケンサーを垂直方向にスクロールしたときに動かない方が良いかもです。なので、ここのzoomY
とoffsetY
は無くて良いかも。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
削除しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
props.offsetY
が残ってるかも…?
#2263 (comment) 指摘箇所の確認漏れで複数回に分けてコミットしてしまったので見づらいと思います。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正ありがとうございます!
// const prevCursorPos = ref< | ||
// | { prevCursorFrame: number, prevCursorFrequency: number,prevCursorVolume: number } | ||
// | undefined | ||
// >(undefined); | ||
let prevCursorFrame: number = 0; | ||
let prevCursorFrequency: number = 0; | ||
let prevCursorVolume: number = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前のコードは消してしまって大丈夫です!
また、= 0
で型は推論されるはずなので、型注釈は無くても大丈夫だと思います!
// 平滑化を行う | ||
let data = previewVolumeEdit.value.data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここはこうかも。(配列のコピーは必要ないかもですが念のため…)
// 平滑化を行う | |
let data = previewVolumeEdit.value.data; | |
const data = [...previewVolumeEdit.value.data]; |
if(Number.isNaN(linear)||linear === undefined){ | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linear
はNaN
やundefined
にはならないはずなので、この処理は必要ないと思います!
const db = linearToDecibel(linear); | ||
const y = db * -120 * zoomY - offsetY;//- ; | ||
const y = decibelToViewY(db);//- ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメントが残っていたので。
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
何のためにコメントアウトされているかが後で分からなくなるので、
コメントアウトの意図を書くか、必要なければ消して良いと思います!
|
||
const removedLineStrips: LineStrip[] = []; | ||
|
||
// 無くなったピッチデータを調べて、そのピッチデータに対応するLineStripを削除する |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ピッチ
やpitch
になっている箇所が何か所かあるかも。
src/store/singing.ts
Outdated
CLEAR_VOLUME_EDIT_DATA: { | ||
// ピッチ編集データを失くす。 | ||
mutation(state, { trackId }) { | ||
const track = getOrThrow(state.tracks, trackId); | ||
track.pitchEditData = []; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここもピッチ
、pitchEditData
になってますね。
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 = []; | |
}, |
src/store/singing.ts
Outdated
if (!isValidVolumeEditData(volumeArray)) { | ||
throw new Error("The pitch edit data is invalid."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここも。
if (!isValidVolumeEditData(volumeArray)) { | |
throw new Error("The pitch edit data is invalid."); | |
} | |
if (!isValidVolumeEditData(volumeArray)) { | |
throw new Error("The volume edit data is invalid."); | |
} |
src/sing/domain.ts
Outdated
// ピッチ編集をf0に適用する | ||
const startFrame = Math.max(0, singingGuideStartFrame); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここもピッチ
になってますね。
// ピッチ編集をf0に適用する | |
const startFrame = Math.max(0, singingGuideStartFrame); | |
// ボリューム編集をvolumeに適用する | |
const startFrame = Math.max(0, singingGuideStartFrame); |
src/domain/project/schema.ts
Outdated
@@ -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の値 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
細かいですが…
volumeEditData: z.array(z.number()), // 値の単位はdbで、データが無いところはVALUE_INDICATING_NO_DATAの値 | |
volumeEditData: z.array(z.number()), // 値の単位はdBで、データが無いところはVALUE_INDICATING_NO_DATAの値 |
48e3da6
to
301f792
Compare
内容
音量をピッチと同様にカーブを描いて編集できるようにする。
ラインの色やアイコンは暫定
問題点
volumeData.dataにundefinedが含まれているため?
関連 Issue
#2003
スクリーンショット・動画など
ツールバー
全体