View Issue Details

IDProjectCategoryView StatusLast Update
0001741OpenMPTGeneralpublic2024-01-12 21:42
Reportertrungj2655 Assigned ToSaga Musix  
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionopen 
Product VersionOpenMPT 1.31.04.00 / libopenmpt 0.7.3 (current stable) 
Target VersionOpenMPT 1.31.05.00 / libopenmpt 0.7.4 (upcoming stable) 
Summary0001741: F00(XM) command (Set speed: 0 ticks/row) causes problem to "Export as MIDI..."
Description

When Export as MIDI... from an XM module that has an F00 command in it, It will take time (almost forever) when get to the F00 command unlike Stream Export which will ignore that.

Steps To Reproduce
  1. Create an XM module (won't work for other formats)
  2. Import some samples/instruments and place some notes with samples/instruments (to Export as MIDI... properly)
  3. Place the F00 command (Set speed: 0 ticks/row) somewhere
  4. Export as MIDI... with whatever settings

Expected behavior: Export as MIDI... acts like Stream Export which will ignore that F00 command
Actual behavior: Export as MIDI... will take a very long time to export once it get to the F00 command unlike Stream Export which will ignore that

Additional Information

After the F00 command, OpenMPT will show the current ticks/row as 65535, decreasing or increasing the ticks/row from there will drop from 65535 to 31

Example modules (from modarchive) that have this problem:
" Forever Friends " (aws_for1.xm)
Instinct (instinct.xm)
Return of Warrior (guardian_-_return_of_the_warrior.xm)

TagsNo tags attached.
Attached Files
test.7z (360 bytes)
Has the bug occurred in previous versions?Yes
Tested code revision (in case you know it)

Activities

Saga Musix

Saga Musix

2024-01-12 21:42

administrator   ~0005822

This was already supposed to work mostly (*) the same as with stream export, but a little bug prevent MIDI / OPL export from enjoying the same end-of-song F00 optimizations as stream export. This is now fixed in r20095.

(*) However, there are still some limitations that, at least at this point in time, cannot be fixed and may lead to different outcomes: MIDI export already uses the same mechanism (in theory) as stream export, that is, the export stops as soon as there are no more active voices playing. However, one important different is that MIDI export essentially replaces all instruments with plugin-based instruments. While samples can end on their own (assuming they are not looped), Plugin-based instruments always need a corresponding note-off until OpenMPT considers that voice to be stopped.
With your particular example file, neither stream nor MIDI export can be optimized because the looped samples keep playing indefinitely. But if there was a note-off on the last row, you would get much shorter exports with both stream and MIDI export in r20095.

Updated builds with this fix will be available within a few hours from https://builds.openmpt.org/builds/ or by pointing OpenMPT's update channel to the "Next" option.

Issue History

Date Modified Username Field Change
2024-01-12 12:30 trungj2655 New Issue
2024-01-12 12:30 trungj2655 File Added: test.7z
2024-01-12 12:33 trungj2655 Steps to Reproduce Updated
2024-01-12 12:33 trungj2655 Additional Information Updated
2024-01-12 21:42 Saga Musix Assigned To => Saga Musix
2024-01-12 21:42 Saga Musix Status new => feedback
2024-01-12 21:42 Saga Musix Note Added: 0005822
2024-01-12 21:42 Saga Musix Target Version => OpenMPT 1.31.05.00 / libopenmpt 0.7.4 (upcoming stable)