View Issue Details

IDProjectCategoryView StatusLast Update
0001814OpenMPTPlayback Compatibilitypublic2024-12-01 00:40
ReporterSaga Musix Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Target VersionOpenMPT 1.?? (long term goals) 
Summary0001814: Find a way to merge GetLength logic with normal playback logic
Description

The fact that GetLength re-implements most of the module playback logic is a constant source of bugs. It would be great if we could use the regular module playback logic for the task of seeking and song length calculation, as this would avoid several sources for errors, and it would make the "seeking with sample sync" feature more precise as well.

The main issue is, of course, that regular song playback changes global song state. For regular sample-based playback, just making all playback logic take a custom PlayState object instead of operating on m_PlayState would not be a big deal; various functions already do this anyway because they are shared between GetLength and regular playback code. The main issue that remains is OPL and VST processing: We essentially need a guarantee that there's nothing in the playback code that ever touches those global resources. Maybe we could move the m_opl object into the PlayState struct, so song length retrieval works on its own, local OPL emulator. Plugins are a bit more challenging though.

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

Saga Musix

Saga Musix

2024-09-10 17:32

administrator   ~0006050

For plugins, maybe we can move all everything from directly interacting with m_MixPlugins to an interface class that lives in PlayState, and either redirect the calls to the individual plugins (regular playback) or otherwise record parameter changes like we do with m_midiMacroEvaluationResults in PlayState already.

Saga Musix

Saga Musix

2024-09-26 19:43

administrator   ~0006069

Currently a pattern delay + pattern loop on the same row cause an incorrect song length calculation (see https://www.un4seen.com/forum/?topic=15448.msg143803#msg143803). I don't see an easy way to implement this correctly with the current implementation.

Saga Musix

Saga Musix

2024-09-27 16:49

administrator   ~0006072

Another obstacle here is that all the playback code currently relies on calling Order() instead of Order(SEQUENCEINDEX), i.e. it depends on the current sequence chosen for editing. I have a working copy where I intend to phase out this feature to allow for multiple sequences being edited at the same time in separate windows. I'm not sure if full multi-sqeuence editing needs to be implemented as a prerequisite, but it will definitely require some modifications to the playback code.

Saga Musix

Saga Musix

2024-10-04 09:27

administrator   ~0006076

Last edited: 2024-11-27 08:17

RowVisitor::ModuleTooComplex also needs to be able to be turned on dynamically for regular playback code.

Seeking could be optimized by not considering NNA channels (GetNNAChannel should not be called or always return CHANNELINDEX_INVALID), channel loop in Sndmix.cpp should only go up to pattern channel count.

Saga Musix

Saga Musix

2024-12-01 00:40

administrator   ~0006239

By allowing to override plugin handling in PlayState, a more elegant solution to handling PC events -> SetParameter in mod2midi would be possible.

Issue History

Date Modified Username Field Change
2024-09-10 12:43 Saga Musix New Issue
2024-09-10 17:32 Saga Musix Note Added: 0006050
2024-09-26 19:43 Saga Musix Note Added: 0006069
2024-09-27 16:49 Saga Musix Note Added: 0006072
2024-10-04 09:27 Saga Musix Note Added: 0006076
2024-11-27 08:17 Saga Musix Note Edited: 0006076
2024-12-01 00:40 Saga Musix Note Added: 0006239