Skip to content

Add DWI Saving Support + Fix DWI Loading#278

Open
SilentMystification wants to merge 8 commits into
uvcat7:releasefrom
SilentMystification:feature/add-dwi-saving-support
Open

Add DWI Saving Support + Fix DWI Loading#278
SilentMystification wants to merge 8 commits into
uvcat7:releasefrom
SilentMystification:feature/add-dwi-saving-support

Conversation

@SilentMystification
Copy link
Copy Markdown

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
Each measure selects the most compact bracket mode that covers all its notes:

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 | fallback


[] 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)

only use <> for 3+ note holds and not mixed hold / note
`{` 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
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I believe this makes sense as a default shortcut as many other programs use this exact combination to initiate the Save As flow.

@SilentMystification SilentMystification changed the title Feature/add dwi saving support Add DWI Saving Support + Fix DWI Loading May 21, 2026
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.

1 participant