Skip to content

[REBASE] Add DWI Saving Support + Fix DWI Loading#294

Open
SilentMystification wants to merge 17 commits into
uvcat7:betafrom
SilentMystification:rebase/add-dwi-saving
Open

[REBASE] Add DWI Saving Support + Fix DWI Loading#294
SilentMystification wants to merge 17 commits into
uvcat7:betafrom
SilentMystification:rebase/add-dwi-saving

Conversation

@SilentMystification

Copy link
Copy Markdown

Rebased on beta + a little bit of cleanup

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)

uvcat7 and others added 16 commits June 16, 2026 18:52
* Update issue templates and README.md
Added section for nightly builds with a link.
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.
Load:
Fix tags not being loaded
dont reuse path variable in a loop

Save:
Sort charts by difficulty before saving to file to ensure correct order.
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.

This may be personal preference but I thought this would be a useful default shortcut

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.

2 participants