BASS_FX 2.4.12.1

Started by (: JOBnik! :),

Ian @ un4seen

Quote from: BenMaasI tried to set up a simple DSP effect for some echos, which worked. But i noticed one major problem. When the playback stops all DSP effects immmediatly stop too.
Is it possible to make it fade out even if the stream/sample ends? A reverb or echo effect that does not fade out it quite useless.

I know i could add some seconds silence to all soundfiles but besides the inconvenience of this it would also not help when playing and stopping loop-sounds.

BASS doesn't currently have the option of waiting for effect tails. I'll see if such an option could be added, but for now, the only way to achieve that is to add silent padding to the end of the stream yourself. It doesn't necessarily require modifying the file though; you can instead use a custom stream to do it, ie. the STREAMPROC function would decode data from the source file and then add some silence at the end of it. It could look something like this...

decoder=BASS_StreamCreateFile(FALSE, filename, 0, 0, BASS_STREAM_DECODE); // create decoder for audio file
BASS_CHANNELINFO ci;
BASS_ChannelGetInfo(decoder, &ci); // get sample format
output=BASS_StreamCreate(ci.freq, ci.chans, ci.flags&~BASS_STREAM_DECODE, StreamProc, 0); // create stream to play decoded data + silent padding
padding=BASS_ChannelSeconds2Bytes(output, paddingseconds); // length of silent padding
BASS_ChannelPlay(output, 0); // start the output

...

DWORD CALLBACK StreamProc(HSTREAM handle, void *buffer, DWORD length, void *user)
{
int r=BASS_ChannelGetData(decoder, buffer, length); // get data from the decoder
if (r<0 || !BASS_ChannelIsActive(decoder)) { // end of file, add padding...
if (r<0) r=0;
int c=min(length-r, padding); // amount of padding to add
memset(((BYTE*)buffer)+r, 0, c); // add the padding
r+=c;
padding-=c; // decrease padding counter
if (!padding) r|=BASS_STREAMPROC_END; // no more padding, end of stream
}
return r;
}

If you want to apply that to multiple streams, you could put the "decoder" and "padding" variables in a structure and pass that to the STMEAMPROC via the "user" parameter.

BenMaas

That would help for now :)
Thank you for your help.

smmsamm

I check tempo with bass32 and fx 32 it has problems on win7 64 bit after that I check tempo with 64 bit dll and every things are OK,
Please give a fx x86 version with correct functions

smmsamm

Quote from: Chriswhich Problems?

In win64 It does not play in slow/fast speed.

Chris

i did here a quick test in delphi xe5 working fine with x86 and working fine with x64.
looks like something in your code is wrong?
 show the relevant tempo code so maybe that make things clearer

smmsamm

Quote from: Chrisi did here a quick test in delphi xe5 working fine with x86 and working fine with x64.
looks like something in your code is wrong?
 show the relevant tempo code so maybe that make things clearer


I have used the demo source code and checked it again

I load a mp3 in chan
****************************
    chan := BASS_StreamCreateFile(FALSE, pChar(filename), 0, 0,
      Bass.BASS_POS_BYTE
{$IFDEF UNICODE} or BASS_UNICODE {$ENDIF});
    if chan = 0 then
    begin
      chan := BASS_MusicLoad(FALSE, pChar(filename), 0, 0, BASS_MUSIC_RAMPS or
        BASS_MUSIC_POSRESET or BASS_MUSIC_PRESCAN
{$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}, 1);
      if (chan = 0) then
      begin
        ErrorPop('Can''t play file');
        Exit;
      end;
    end;
****************************

and with changing the track bar onchanging:
****************************
  If (BASS_ChannelIsActive(chan) = 0) Then
    Exit;

  BASS_ChannelSetAttribute(chan, BASS_ATTRIB_TEMPO, tbTempo.position);

****************************
it runs BASS_ChannelSetAttribute but it does not make any effect.

Chris

I don`t see there a Tempostream!!
shouldbe something like this

 chan := BASS_StreamCreateFile(FALSE, pChar(filename), 0, 0,BASS_STREAM_DECODE or Bass.BASS_POS_BYTE or BASS_UNICODE );
 chan := BASS_FX_TempoCreate(chan, BASS_SAMPLE_LOOP or BASS_FX_FREESOURCE);

smmsamm

Quote from: ChrisI don`t see there a Tempostream!!
shouldbe something like this

 chan := BASS_StreamCreateFile(FALSE, pChar(filename), 0, 0,BASS_STREAM_DECODE or Bass.BASS_POS_BYTE or BASS_UNICODE );
 chan := BASS_FX_TempoCreate(chan, BASS_SAMPLE_LOOP or BASS_FX_FREESOURCE);

Oh excuse me I have tested it before:

    // creating stream
    chan := BASS_StreamCreateFile(FALSE, pChar(filename), 0, 0,
      Bass.BASS_POS_BYTE
{$IFDEF UNICODE} or BASS_UNICODE {$ENDIF});
    if chan = 0 then
    begin
      chan := BASS_MusicLoad(FALSE, pChar(filename), 0, 0, BASS_MUSIC_RAMPS or
        BASS_MUSIC_POSRESET or BASS_MUSIC_PRESCAN
{$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}, 1);
      if (chan = 0) then
      begin
        ErrorPop('Can''t play file');
        Exit;
      end;
    end;
    // create a new stream - decoded & resampled
    chan := BASS_FX_TempoCreate(chan, BASS_SAMPLE_LOOP Or BASS_FX_FREESOURCE);
    If (chan = 0) then
    begin
      Error('Couldnt create a resampled stream!');
      BASS_StreamFree(chan);
      Exit;
    end;

but chan value will be 0 and application will exit
when I debug before line:
    chan := BASS_FX_TempoCreate(chan, BASS_SAMPLE_LOOP Or BASS_FX_FREESOURCE);
the chan has a value like 2934456234 but after the BASS_FX_TempoCreate the chan value will be 0

Chris

 
Quote// creating stream
    chan := BASS_StreamCreateFile(FALSE, pChar(filename), 0, 0,
      Bass.BASS_POS_BYTE
{$IFDEF UNICODE} or BASS_UNICODE {$ENDIF});

must be
  chan := BASS_StreamCreateFile(FALSE, pChar(filename), 0, 0, Bass.BASS_POS_BYTE or BASS_UNICODE or BASS_STREAM_DECODE);

smmsamm

#630
Quote from: Chris
Quote// creating stream
    chan := BASS_StreamCreateFile(FALSE, pChar(filename), 0, 0,
      Bass.BASS_POS_BYTE
{$IFDEF UNICODE} or BASS_UNICODE {$ENDIF});

must be
  chan := BASS_StreamCreateFile(FALSE, pChar(filename), 0, 0, Bass.BASS_POS_BYTE or BASS_UNICODE or BASS_STREAM_DECODE);

I changed and
Again chan has value 0 after BASS_FX_TempoCreate(chan, BASS_SAMPLE_LOOP Or BASS_FX_FREESOURCE);

And I checked it with different mp3 with different bitrate and some wav but all of the time chan became to 0.

Chris

did you make a  BASS_FX_GetVersion() Call ??
by the way which Delphi Version?
If this will not help show me the complete code .

smmsamm

Quote from: Chrisdid you make a  BASS_FX_GetVersion() Call ??
by the way which Delphi Version?
If this will not help show me the complete code .
thank you for your kindly answer,
My bass_fx.dll had problem,
Now it works perfect.

aybe

Hi !

There's a slight issue while trying to free BassFx when using a 64-bit process, it will never succeed.

Whether using BassFx.FreeMe or Utils.LIBFreeLibrary it always return false.

Sample to reproduce the error :

        private static void Main(string[] args)
        {
            bool b = Bass.LoadMe();
            bool bassInit = Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
            int libLoadLibrary = Utils.LIBLoadLibrary("bass_fx.dll");
            bool libFreeLibrary = Utils.LIBFreeLibrary(libLoadLibrary);
            bool loadMe = BassFx.LoadMe();
            bool freeMe = BassFx.FreeMe();
            bool me = Bass.FreeMe();
        }

Thank you  :D

norbert

I'm trying to execute the android Reverse demo on my real devices , but the app just crashes with error:

Java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_relocate(linker.cpp:975): cannot locate symbol "__clzsi2" referenced by "libbass_fx.so"...

In my project I have a armeabi-v7a folder with libbbass.so and libbbass_fx.so.

I'm also wondering why I can't find  these calls:

BASS.BASS_PluginLoad(nativeLibDir + "/libbass_fx.so", 0) and also not BASS_FX.GetVersion()  in the Reverse.java code ?
But even when I add these calls the above error occurrs... ???

BenMaas

I wanted to ask politly if there are currently updates of BassFX in progress. I haven't implemented it yet and did some other work on my engine.
Just want to know if it's worth to wait a bit longer. (freeverb like reverb and an option to wait for effect tails would be great)

Regards, Ben.

(: JOBnik! :)

#636
Hi ;D

Here's the latest beta to test (Win32 and Win64), it includes "Freeverb" effect and C/C++ API with example.
http://www.jobnik.net/files/beta/bass_fx24109-beta.zip

I guess on next week I'll release it as final 2.4.11 version for all platforms.

Changes in this release:
* BASS_FX:
   * Fixed an issue on OSX (now it's "@loader_path" instead of "@executable_path")
   * Tempo/Reverse fixed a thread-safety crash.
   * Tempo/Reverse added CTYPE info for these streams.
   * Android, added "x86" architecture support.
   * iOS, added "arm64" architecture support.

* Tempo:
   * Updated to latest SoundTouch library version 1.8.0
   * Fixed a crash when using syncs on tempo, as described in this thread: http://www.un4seen.com/forum/?topic=15708.0
   * Added 3 interpolation algorithms to set using BASS_FX_TEMPO_ALGO_XXX flags (BASS_FX_TempoCreate):
      * BASS_FX_TEMPO_ALGO_LINEAR
      * BASS_FX_TEMPO_ALGO_CUBIC   (default)
      * BASS_FX_TEMPO_ALGO_SHANNON

* DSP:
   * Fixed a bug in BASS_FX_BFX_VOLUME_ENV effect with the "bFollow" option on mobile devices,
     as described in this thread http://www.un4seen.com/forum/?topic=15866
   * Added new effects:
     * BASS_FX_BFX_PITCHSHIFT, that uses FFT for its pitch shifting while maintaining duration.
     * BASS_FX_BFX_FREEVERB, a reverb effect.

Renegade

The bass_fx24.zip file seems to be corrupt. I've tried a couple archivers, and neither work on the file.

Size: 253 KB (259,908 bytes)

The file starts:

50 4B (PK)

So, that's correct.

(: JOBnik! :)

Hi ;D

Please try again, the website was down for a few minutes today :)