Author Topic: Best way to apply FX to a group of 3D samples  (Read 42 times)

Jeroen Tandberg

  • Posts: 5
Hi again, one more question from me.

Turns out there is no easy way of properly applying FX onto 3D samples in BASS. I tried two ways. First, applying FX directly onto each sample stream. Seems like a bad idea because FX is just applied to the sample in monaural mode (since all my samples are obviously mono), e.g. I get "flat" monaural reverb which generally sounds dull.

Second way is applying FX onto either master mix or to bassmix channel via sending sample streams to it in decoding mode. Applying FX to master mix is not acceptable, because I need a group of channels which will play music and looped ambience, which shouldn't be affected by FX. I thought bassmix would solve my issue, but then I learned that for some reason decoding channels doesn't support 3D mode.

So the question is, how can I group 3D samples and apply FX to them in stereo mode, while also keeping several channels unaffected by FX? Probably an approach similar to OpenAL aux send slots? This seems to be trivial task in gamedev, but in BASS it's hard to understand for me  :-\

Thanks!
« Last Edit: 19 Aug '18 - 11:29 by Jeroen Tandberg »

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: Best way to apply FX to a group of 3D samples
« Reply #1 on: 20 Aug '18 - 13:33 »
Indeed, it isn't currently possible to apply effects to just the 3D channels in the output mix. The latest BASS build (which allows playback on the "no sound" device) makes it possible in a roundabout way, by playing the 3D channels on the "no sound" device, getting that device's mix and forwarding it (with effects applied) to the main output device. But here's an update for you to try, which should make it much simpler:

   www.un4seen.com/stuff/bass.zip

It adds a new STREAMPROC_DEVICE_3D option (for use with BASS_StreamCreate) to allow access to a device's 3D channel mix. The existing STREAMPROC_DEVICE option still gives a mix of all channels (including 3D) on the device.

Jeroen Tandberg

  • Posts: 5
Re: Best way to apply FX to a group of 3D samples
« Reply #2 on: 21 Aug '18 - 00:13 »
This seems to be perfect solution for my problem! Thumbs up!

Although it seems either I am doing something wrong or this dev version is a bit broken... When I try to apply BASS_ChannelSetFX onto channel with STREAMPROC_DEVICE_3D set, I get access violation.

Ian @ un4seen

  • Administrator
  • Posts: 21024
Re: Best way to apply FX to a group of 3D samples
« Reply #3 on: 21 Aug '18 - 12:07 »
Oops, the posted update was incomplete. Another update is up now at the same URL, so please re-download to get that. Let me know if it still gives you any trouble.

Jeroen Tandberg

  • Posts: 5
Re: Best way to apply FX to a group of 3D samples
« Reply #4 on: 21 Aug '18 - 19:40 »
Yes, it works just like it should! Great job!
I got some random access violations when I messed with FX properties on the fly, but maybe it was just me, because in last 4 or 5 hours of testing I get none.

I will report if I will encounter any crashes again. Thank you so much! :)