-
Notifications
You must be signed in to change notification settings - Fork 2
chunithm转谱:IR大重构,修正当前C2S和UGC的Parser与Generator中的许多错误。 #3
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
Open
Starrah
wants to merge
13
commits into
dev
Choose a base branch
from
refactor-chunithm
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5f8bddb
[R] ChuNote的重新设计
Starrah 0b2e921
[R] 适应 5f8bddb 中所做的修改,使能过编译
Starrah a0ff8b0
[R] Chart相关重构(初步)
Starrah 84a39e5
[R] Chart相关重构(第二步)——使用BaseChart中提供的List对象
Starrah ba1bbcc
[F&R] 1. 现在的ugcgenerator缺少SflEvent的生成/写出。
Starrah 09c5ead
[R] Chart相关重构(第三步)——移除各个谱面中的Resolution,而是parser解析存成分数、generator使用写死的固定值
Starrah d92a9e3
[R] Chart相关重构(最后一步)——三种Chart合并为统一的ChuChart!
Starrah 54bc9f4
[F] 不要屏蔽本应出现的警告
Starrah fa9dbcb
[F] UGCParser对Slide的解析
Starrah 9c13621
[+] 在ChuNote中新增Previous字段,新增BaseChuParser和FillAllPrevious通用工具方法。以实现sl…
Starrah 52af0a3
[+] UGC 对Air Slide和Air Hold的解析
Starrah b54b7e9
[+] UgcGenerator Slide、Air Hold、Air Slide的正确实现
Starrah d580e85
[F] 修一些小问题
Starrah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using MuConvert.chart; | ||
| using Rationals; | ||
|
|
||
| namespace MuConvert.chu; | ||
|
|
||
| public class ChuChart : BaseChart<ChuNote> | ||
| { | ||
| public string Title { get; set; } = ""; | ||
| public string Artist { get; set; } = ""; | ||
| public string Designer { get; set; } = ""; // 谱师 | ||
| public int Difficulty { get; set; } = 3; // 难度,0-basic, 1-advanced, ...。大多数情况下都是数字字符串。不直接存成数字是为了,万一自制谱这里写的不是数字、保留鲁棒性 | ||
|
Starrah marked this conversation as resolved.
|
||
| public string DisplayLevel { get; set; } = ""; // 显示等级,字符串 | ||
| public decimal Level { get; set; } // 定数,小数 | ||
| public string MusicId { get; set; } = "0"; | ||
| public List<(Rational Time, Rational Duration, decimal Multiplier)> SflList = []; // 所有变速声明构成的列表。 | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,55 @@ | ||
| using MuConvert.chart; | ||
| using Rationals; | ||
|
|
||
| namespace MuConvert.chu; | ||
|
|
||
| /** | ||
| * CHUNITHM 通用音符,C2S / UGC / SUS 共用此结构。 | ||
| */ | ||
| public class ChuNote | ||
| public class ChuNote: BaseNote | ||
| { | ||
| /** 音符类型 (TAP, CHR, HLD, SLD, AIR, AHD 等) */ | ||
| public string Type { get; set; } = "TAP"; | ||
| /** 小节号 */ | ||
| public int Measure { get; set; } | ||
| /** 小节内偏移 (C2S: 0–383, UGC/SUS: 0–1919) */ | ||
| public int Offset { get; set; } | ||
| /** 起始列 (0–15) */ | ||
| public int Cell { get; set; } | ||
| /** 宽度 (1–16) */ | ||
| public int Width { get; set; } = 1; | ||
| /** HLD 持续时长 */ | ||
| public int HoldDuration { get; set; } | ||
| /** SLD 持续时长 */ | ||
| public int SlideDuration { get; set; } | ||
| /** HLD/SLD/AHD/ASD等的 持续时长 */ | ||
| public Rational Duration { get; set => field = value.CanonicalForm; } = 0; | ||
|
sourcery-ai[bot] marked this conversation as resolved.
|
||
|
|
||
| /** SLD 终点列 */ | ||
| public int EndCell { get; set; } | ||
| public int EndCell | ||
| { | ||
| get => _endCell ?? Cell; | ||
| set => _endCell = value; | ||
| } | ||
| /** SLD 终点宽度 */ | ||
| public int EndWidth { get; set; } = 1; | ||
| /** CHR/FLK 附加数据(方向等) */ | ||
| public int EndWidth | ||
| { | ||
| get => _endWidth ?? Width; | ||
| set => _endWidth = value; | ||
| } | ||
|
|
||
| /** | ||
| * 当前音符的”前驱“。对不同类型的音符,其定义不同: | ||
| * - 对 Slide(SLD/SLC),是该slide对应的前一段slide。(对首段slide,该值为null) | ||
| * - 对 Air(AIR/AUR/AUL/ADW/ADR/ADL),是它所依附的音符(可以是tap\hold等任何类型,应该只要不是air系列和aircrush(ALD)都行) | ||
| * - 对 Air Slide(ASD/ASC):对首段slide,同Air的情况、是它所依附的音符;对第二段及之后的slide,同Slide的情况,是该slide对应的前一段slide。 | ||
| * | ||
| * 不难分析出,在完成整个chart之后,这个属性其实可以根据完整chart的列表动态推断的。 | ||
| * 因此,在BaseChuParser类中提供了FillAllPrevious方法,该方法应该在所有Note被正常解析完成后调用,填充所有上述类型的音符的targetNote信息。这样就不用每个Parser都写一段相似的逻辑。 | ||
| */ | ||
| public ChuNote? Previous; | ||
|
|
||
| /** CHR/FLK/Air系列音符可能会具有的标记(如UP、L、DEF等) */ | ||
| public string Tag { get; set; } = ""; | ||
| /** AIR/AHD 关联的目标音符类型 */ | ||
| public string TargetNote { get; set; } = ""; | ||
| /** AHD 持续时长 */ | ||
| public int AirHoldDuration { get; set; } | ||
| /** Air Crush 起始高度 */ | ||
| public int StartHeight { get; set; } | ||
| /** Air Crush 目标高度 */ | ||
| public int TargetHeight { get; set; } | ||
| /** Air Crush 颜色 */ | ||
| public string NoteColor { get; set; } = ""; | ||
| /** ASD/ASC/ALD上具有的、目前含义还不明确的字段,统一收集到这个里面。 */ | ||
| public List<int> ExtraData = []; | ||
|
|
||
| public override Rational EndTime => (Time + Duration).CanonicalForm; | ||
| /** Air系列音符/Slide系列音符的 关联的目标音符类型。仅供向前兼容使用。 */ | ||
| public string TargetNote => Previous?.Type ?? "N"; | ||
|
|
||
| private int? _endCell; | ||
| private int? _endWidth; | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.