MuseScore I/O の内部構造を段階的に整理し import/export の責務境界を明確化#167
Merged
Conversation
## 概要 `src/ts/musescore-io.ts` の内部構造を整理し、MuseScore import / export の責務境界をこれまでより明確にする変更です。 このコミットでは、公開 API の追加や削除ではなく、主に内部 helper・状態・処理単位の分解と再構成が行われています。 あわせて、生成物である `src/js/main.js` および `mikuscore.html` が更新されています。 ## 変更内容 ### 1. MuseScore import 側の処理分解 `src/ts/musescore-io.ts` で、MuseScore -> MusicXML 変換の part / measure / voice 単位の処理が分解されています。 含まれる変更例: - measure 単位の attribute 出力要否判定の切り出し - import 時の measure header 組み立て処理の分離 - part 内 voice 番号解決 helper の分離 - primary measure / staff measure 解決 helper の追加 - measure 完成処理の分離 - voice 出力処理の分離 ### 2. MusicXML export 側の処理分解 MusicXML -> MuseScore 変換でも、metadata / part scaffold / measure context / staff state / voice rendering などの単位で helper や型が追加されています。 含まれる変更例: - part identity、document body、staff state などの型追加 - MusicXML metadata 読み取り helper の整理 - part 定義 body / instrument XML の組み立て処理の分離 - measure context に clef / key / time / repeat などの出力判断を集約 - direction seed の XML 化 helper の追加 - export の voice / measure / staff 単位の描画処理分離 - MusicXML note / direction / barline の child dispatch 処理分解 ### 3. measure / voice / event データフローの明示化 内部的に、以下のような責務のまとまりがより明示されています。 - import 側: - measure header 判定 - part voice 解決 - voice event 出力 - measure 完成処理 - export 側: - metadata 抽出 - part scaffold 構築 - measure context 構築 - staff state 更新 - voice event 生成 - child dispatch 処理 ### 4. 生成物の更新 以下の生成物が更新されています。 - `src/js/main.js` - `mikuscore.html` ## 変更ファイル - `src/ts/musescore-io.ts` - `src/js/main.js` - `mikuscore.html` ## 目的 この変更の主目的は、`src/ts/musescore-io.ts` に集中していた import / export / 共通 helper の責務を段階的に整理し、今後の仕様拡張や追加分割に備えた内部構造に近づけることです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
src/ts/musescore-io.tsの内部構造を整理し、MuseScore import / export の責務境界をこれまでより明確にする変更です。 このコミットでは、公開 API の追加や削除ではなく、主に内部 helper・状態・処理単位の分解と再構成が行われています。あわせて、生成物である
src/js/main.jsおよびmikuscore.htmlが更新されています。変更内容
1. MuseScore import 側の処理分解
src/ts/musescore-io.tsで、MuseScore -> MusicXML 変換の part / measure / voice 単位の処理が分解されています。含まれる変更例:
2. MusicXML export 側の処理分解
MusicXML -> MuseScore 変換でも、metadata / part scaffold / measure context / staff state / voice rendering などの単位で helper や型が追加されています。
含まれる変更例:
3. measure / voice / event データフローの明示化
内部的に、以下のような責務のまとまりがより明示されています。
4. 生成物の更新
以下の生成物が更新されています。
src/js/main.jsmikuscore.html変更ファイル
src/ts/musescore-io.tssrc/js/main.jsmikuscore.html目的
この変更の主目的は、
src/ts/musescore-io.tsに集中していた import / export / 共通 helper の責務を段階的に整理し、今後の仕様拡張や追加分割に備えた内部構造に近づけることです。