Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test how the interpreter handles loop marks in MODs #1

Open
angstsmurf opened this issue Oct 25, 2018 · 3 comments
Open

Test how the interpreter handles loop marks in MODs #1

angstsmurf opened this issue Oct 25, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@angstsmurf
Copy link
Owner

See garglk/garglk#160

We would need a good short sample of a MOD with a loop mark, and perhaps an OGG of how it is supposed to sound, for comparison.

Eliuk reports an issue with mod playback:

mod format has a loop mark.
if glk loops a mod, should respect the loop mark
garglk doesn't respect the loop mark in mods.
and loops all track, from begining.

(not all mods have a loop mark)

@angstsmurf angstsmurf added the enhancement New feature or request label Oct 25, 2018
@angstsmurf angstsmurf changed the title Test how interpreter handles loop marks in MODs Test how the interpreter handles loop marks in MODs Oct 25, 2018
@cspiegel
Copy link

cspiegel commented Feb 7, 2024

I've been going through ooooold issues in Gargoyle, and came across this reference.

I think there are a couple things to deal with here.

First, Blorb is underspecified when it comes to MOD files and looping. It doesn't take into account the fact that MODs can loop back and effectively play for an infinite amount of time.

Second, the request here isn't clear as to what the expectation is. Is the expectation that if glk_schannel_play_ext is called with a repeats value of -1, the in-built looping in the MOD (if any) should be honored? Or should the looping, if present, always be honored?

My feeling is that you shouldn't use MODs with looping, or at least, don't expect that looping to be honored. No other formats have this optional looping (the V3 looping chunk is an oddity that doesn't really count here).

Moreover, if repeats is 2, for example, what is expected? If the MOD loop info is to be honored in a consistent manner, then presumably this loop should be used for the repeat. Or does the loop only matter if infinite repeats are desired? And this requires a lot more work dealing with the MOD library, if it even exposes this sort of control.

Basically, it's a huge can of worms, especially given how complex MOD files can be. Unless there's a really good reason not to, I plan on closing the Gargoyle issue as WONTFIX with the rationale that MOD looping is out of the scope of IF games. And if you really want this sort of behavior, it's possible to embed a couple Vorbis files (or if you're feeling adventurous, you can pull apart the MOD file in a tracker), one of which is the first part of the song, and the second is the "to be looped" part. Set a event handler for when the first part ends, then start up the second in an infinite loop.

@angstsmurf
Copy link
Owner Author

Agreed that it is not worth the trouble to implement.

It would be nice to have an API for looping sounds properly, though. The current system is pretty rough. As I understand it, AIFF and Ogg files may also contain loop marks.

On the other hand, there doesn't seem to be a huge interest in making Glulx games with sound anyway.

@cspiegel
Copy link

cspiegel commented Feb 9, 2024

I wasn't even aware of AIFF and Ogg looping behaviors! Previously I sort of argued that since MOD stood alone, its looping shouldn't be honored. Now I'll make the opposite argument and say that since no other formats with looping are supported, MOD shouldn't be either.

I agree this is really an API/specification issue. Unless Blorb/Glk are updated to clarify looping, I'll treat all files as not-internally-looping and continue to ignore them. Thanks for the input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants