glk 0.73+ sound functions a go?

Is the new (as of glk 0.7.3) glulx sound programming useable now?

I ask as I wasn’t sure if Zarf’s caveat comment at the end of the following topic referred to all the new sound functionality, or just part of it:

[i]"A late note: it turns out I forgot one code change necessary for Glulxe to invoke the glk_schannel_play_multi() function. This is now checked into my github repository, but it won’t be in the released Glulxe code until, well, the next release.

If you’re implementing the new sound functionality – and you’re not David Kinder (who’s the one who noticed the problem :slight_smile: – you’ll need to grab the update to make it work."[/i]

I want to do a fade out, which is covered for in the new spec. The interpreter is crashing on compile. But it seems to crash if I even add the check for the new sound functions to it and nothing else. I think I phrased this line correctly as per the spec ( … ec-changes) ?

To decide whether rockin: (- ( glk_gestalt(gestalt_Sound2, 0) ) -)

  • Wade

My caveat comment refers only to the glk_schannel_play_multi() function.

I will do a new Glulxe release in a couple of weeks.

The error you are seeing is not an interpreter crash; it’s a compiler error. (You should include the error message when you report these things, by the way.) It’s because the new sound functions and constants have not been imported into the I7 environment, not even as I6 interfaces.

You’ll have to define them yourself. Let’s see, it will look like…

Include (-
Constant evtype_VolumeNotify = 9;
Constant gestalt_Sound2 = 21;

[ glk_schannel_create_ext _vararg_count ret;
  ! glk_schannel_create_ext(uint, uint) => schannel
  @glk 244 _vararg_count ret;
  return ret;

[ glk_schannel_play_multi _vararg_count ret;
  ! glk_schannel_play_multi(schannelarray, arraylen, uintarray, arraylen, uint)
  @glk 247 _vararg_count ret;
  return ret;

[ glk_schannel_set_volume_ext _vararg_count;
  ! glk_schannel_set_volume_ext(schannel, uint, uint, uint)
  @glk 253 _vararg_count 0;
  return 0;

[ glk_schannel_pause _vararg_count;
  ! glk_schannel_pause(schannel)
  @glk 254 _vararg_count 0;
  return 0;

[ glk_schannel_unpause _vararg_count;
  ! glk_schannel_unpause(schannel)
  @glk 255 _vararg_count 0;
  return 0;

-) after "Glulx.i6t";

Thanks for that, Zarf.

Yeah, I meant compiler crash, which I failed to type.

With the error, it was one of those ones where Inform explained in several paragraphs that it failed to compile for reasons it didn’t understand, but that some i6 thing was probably to blame. I believed it, since it compiled once I removed my line of i6.

  • Wade

I knew which error message you got, but only because I recognized the problem. In general you should always paste the error (or a recognizable chunk of it) if you want to get help in fixing it.

It should be, though not many interpreters support it as far as I know. The Windows Glk based ones (i.e. Windows Glulxe and Windows Git) do, and the Glulx interpreters in last build of Windows Inform 7, but as far as I’m aware that’s it to date. Let us know how you get on - that code hasn’t seen much testing.

I’d like to, but if it’s mostly not supported at the players’ end, I can’t dare rely on it for something that will be in ifcomp, so with this info I think I’ll have to leave it.

  • Wade