Author Topic: pausing/resuming mod channel  (Read 94 times)

Baby

  • Posts: 36
pausing/resuming mod channel
« on: 14 May '21 - 12:18 »
Maybe I'm just blind, but is it possible to pause/resume a channel in a mod?

Ian @ un4seen

  • Administrator
  • Posts: 23632
Re: pausing/resuming mod channel
« Reply #1 on: 14 May '21 - 13:39 »
MOD channels don't play independently of each other, so it isn't possible to pause individual channels, but if muting will be sufficient then you can do that via the BASS_ATTRIB_MUSIC_VOL_CHAN settings (set them to 0).

Baby

  • Posts: 36
Re: pausing/resuming mod channel
« Reply #2 on: 14 May '21 - 16:41 »
I found out Bass respects paused (or not started?) mod channels when playing. That is, if I pause a specific channel in OpenMPT and save the file, the channel will not be played in my application.
I'm sure these channels are not muted, because I'm using BASS_ChannelSlideAttribute() with BASS_ATTRIB_MUSIC_VOL_CHAN all day and these channels never do play at all.

So I was under the impressions this could be done somehow. Not really important, but this might improve workflow (from OpenMPT to Unity and back) if I could just enable all channels when starting to play (creating a deterministic state independently from mod file). Would also allow to disable channels holding callback commands (S2x) for easier in-game logic.   

But no problem, just thought there is something in BASS already.

Ian @ un4seen

  • Administrator
  • Posts: 23632
Re: pausing/resuming mod channel
« Reply #3 on: 14 May '21 - 19:02 »
If you're referring to what I think you are then those switches in OpenMPT are for muting the channels, and BASS will indeed honour those settings when it loads the file. Muting a channel in OpenMPT is basically the same as setting the corresponding BASS_ATTRIB_MUSIC_VOL_CHAN option to 0 in BASS. In both cases, the channel's effects are still played (just the notes aren't heard).

Baby

  • Posts: 36
Re: pausing/resuming mod channel
« Reply #4 on: 15 May '21 - 09:03 »
I'm referring to the patterns tab in MPT. By clicking on the channels name (top row in pattern window) I can enable/disable a channel.

Are you sure you just set the channels volume to 0? Because I'm doing the exactly same thing to create dynamic music. And this works perfectly- with all channel but the ones exported as disabled from MPT. These channels do not react on any volume change and remain silent.

Baby

  • Posts: 36
Re: pausing/resuming mod channel
« Reply #5 on: 15 May '21 - 09:10 »
I tested a bit on disabled channels and it seems even if 'disabled', Fx are called. So my argument on game logic doesn't hold.
Just forget the whole thing.

Ian @ un4seen

  • Administrator
  • Posts: 23632
Re: pausing/resuming mod channel
« Reply #6 on: 17 May '21 - 17:10 »
I'm referring to the patterns tab in MPT. By clicking on the channels name (top row in pattern window) I can enable/disable a channel.

Are you sure you just set the channels volume to 0? Because I'm doing the exactly same thing to create dynamic music. And this works perfectly- with all channel but the ones exported as disabled from MPT. These channels do not react on any volume change and remain silent.

Yep, that's a mute switch - if you go to OpenMPT's "General" view afterwards, you will see that the "Mute" switch there has changed state too. When loading a file with muted channels in BASS, they will currently be muted permanently, ie. they cannot be unmuted via the BASS_ATTRIB_MUSIC_VOL_CHAN option. So if you will want to dynamically mute/unmute channels, all channels should be left unmuted by default in the file.

Baby

  • Posts: 36
Re: pausing/resuming mod channel
« Reply #7 on: 18 May '21 - 09:32 »
Ok, thanks for the info.