I have an idea for a game feature that may be difficult if not impossible to implement in Inform 7, but I am overambitious, so here goes.
I would like to make what would essentially be a very primitive music tracker that plays samples. Basically, I would have a sound file (in the usual ogg format) that plays a single note, say, a middle C. But it would only play that sound file for X amount of seconds. Then once X seconds are up, it would play the next note (an E or whatever) for Y seconds, etc.
The same idea could be done not just with individual notes but bars of music whose real-time length is known.
Why do this in the first place? This feature could allow the player to arrange the sequence of notes or musical phrases. It also allows for randomness and variation in background music.
Basic Real Time by Sarah Morayati seems like a good candidate for this, but it doesnāt output anything until the next turn. Real Time Delays by Erik Temple (which only works for older versions of Inform, I think), will halt the game for a specified time, so it wonāt work in the background. Could either of these be modified for this use case?
Is there some Inform 6 routine I should call instead? And I confess that Iāve tried but donāt really understand Glulx Entry Points by Emily Short!
(Another approach could be detecting when the current sound file has finished playing, but as far as I know, neither the Multiple Sounds nor the Music extension does this. But maybe this would be an easier problem to solve? If you can detect when a sound has finished, you could implement a playlist of notes or music.)