Author Topic: [OSX] BS2B and crossfeed  (Read 87 times)

drummingdemon

  • Posts: 6
[OSX] BS2B and crossfeed
« on: 23 Jan '18 - 19:08 »
I'm looking into implementing BS2B (http://bs2b.sourceforge.net) in my BASS audio project on OSX - problem is, I can't really seem to get grasp on it. The author does not mention it in this thread (https://hydrogenaud.io/index.php/topic,38291.msg512058.html#msg512058), but on top of the lowpass and highboost filters, delay is needed as well.

I've tried using the BS2B VST plugin provided by the author with BASS but sadly an error is thrown saying that "it does not support realtime mode". I've been thinking about routing the raw data from BASS via stdin to the compiled BS2B executable and the getting its' output back - but it feels a 'hacky' and honestly I do not wish to interrupt the awesome signal chain of BASS.

To my understanding there currently is no separate crossfeed option available for BASS.
Is it possible to achieve crossfeeding - and by extension, the same functionality of BS2B - using the currently available set of tools or does it need to be implemented?

I was also considering creating a DSP module based on the source code of BS2B but I couldn't find any boilerplate code to start with - is there a documentation about that somewhere?

Thank you in advance!
« Last Edit: 24 Jan '18 - 12:58 by drummingdemon »

Ian @ un4seen

  • Administrator
  • Posts: 20609
Re: [OSX] BS2B and crossfeed
« Reply #1 on: 24 Jan '18 - 13:42 »
That library looks like it should be possible to use in a DSPPROC callback function, applied via BASS_ChannelSetDSP. It could look something like this:

Code: [Select]
bs2bdp = bs2b_open();
bs2bdsp = BASS_ChannelSetDSP(handle, BS2BDSP, bs2bdp, 0);

...

void CALLBACK BS2BDSP(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user)
{
t_bs2bdp bs2bdp = (t_bs2bdp)user;
bs2b_cross_feed_f(bs2bdp, (float*)buffer, length/(2*sizeof(float)));
}

That's assuming the BASS channel is floating-point, ie. you use the BASS_SAMPLE_FLOAT flag.

drummingdemon

  • Posts: 6
Re: [OSX] BS2B and crossfeed
« Reply #2 on: 24 Jan '18 - 18:00 »
Thanks Ian for the speedy support and the example - it now works wonderfully!