Add DWI Saving Support + Fix DWI Loading#278
Open
SilentMystification wants to merge 8 commits into
Open
Conversation
`{` was being parsed as a 48th note instead of a 64th note.
Previous implementation worked around buggy `{}` brackets, now that it's been fixed implement all bracket types properly.
| FILE_OPEN = ctrl + o | ||
| FILE_SAVE = ctrl + s | ||
| FILE_SAVE_AS = | ||
| FILE_SAVE_AS = ctrl + shift + s |
Author
There was a problem hiding this comment.
I believe this makes sense as a default shortcut as many other programs use this exact combination to initiate the Save As flow.
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.
Summary
I have been making charts for Dance Maniax Update which uses the DWI format. ArrowVortex is my preferred step file editor and supports loading DWI files, but does not support saving DWI files.
Prior to this I had to go through an error prone multiprogram export to convert my ArrowVortex *.sm file to a *.dwi file.
This PR aims to change that. There are 3 major things implemented here:
Add DWI file saving support with full bracket coverage
Implements SaveDwi to serialize ArrowVortex simfiles to the DWI format.
Bug fix — LoadDwi {} quantization
{ was incorrectly assigned quantization 4 (48th notes). The correct value per DMX and StepMania 3.9 is 3 (64th notes, 1/64 * BEATS_PER_MEASURE). Any DWI file containing {} brackets previously loaded with notes at wrong positions.
Bug fix — LoadDwi closing bracket reset
All closing brackets (), ], }, ') reset the quantization to 24 (8th notes, 24 rows/slot). The previous value of 32 has no correspondence to any standard note division in ArrowVortex's 192-row system (192 ÷ 32 = 6 slots/measure) and would place subsequent bare notes at wrong row positions. The correct reset value matches the parser's own initial quantization: 192 / 8 = 24.
DWI Saving Details
Metadata
Writes #TITLE, #ARTIST, #GENRE, #FILE, #GAP, #BPM, #CHANGEBPM, #FREEZE, #SAMPLESTART, #SAMPLELENGTH, and #DISPLAYBPM. Timing offset is converted from AV's seconds-based offset to DWI's negated millisecond GAP. BPM changes and stops are written as comma-separated beat=value lists using DWI_beat = AV_row / 12.0.
Charts
Supports SINGLE, DOUBLE, COUPLE, and SOLO styles. Enforces DWI's one-chart-per-difficulty constraint with a warning on duplicates. Each chart header ends with a newline so note data starts on the following line.
Note data — quantization
Bracket | Grid | Rows/slot | Condition -- | -- | -- | -- none | 8th | 24 | all rows divisible by 24 () | 16th | 12 | all rows divisible by 12 [] | 24th | 8 | all rows divisible by 8 (triplets) {} | 64th | 3 | all rows divisible by 3 `' | 192nd | 1 | fallbackEach measure selects the most compact bracket mode that covers all its notes:
[] and {} cover disjoint note sets, so a measure mixing 24th and 64th notes falls back to 192nd.
Note encoding
Single note → numpad digit (4 2 8 6)
Two simultaneous notes → corner digit (7 1 9 3) or letter combo
3+ simultaneous → multi-note bracket
Hold heads: X!X or PairChar!PairChar for 1–2; <ABC!ABC> for 3+
One tap + one hold head → CornerChar!HoldChar without brackets (e.g. 7!4 for Up tap, Left hold)