BASS_FX 2.4.12.1

Started by (: JOBnik! :),

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 :)

Renegade

Quote from: (: JOBnik! :)Hi ;D

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

Still no love. Same error. :(

I can download it no problem - I just can't extract anything.

(: JOBnik! :)

Hi ;D

Please try downloading with different browser.
I myself tried with Chrome and IE and could extract without any problem.
Maybe your antivirus is blocking it?

victor

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

I guess on next week I'll release it as final 2.4.11 version for all platforms.
when will you release the 2.4.11?
Could you please make a download with an OSX beta?

Thanks.

devid1988

Hi  ;D
Works well with me
  But how does it work on Delphi

freeverb

Thank you very much


(: JOBnik! :)

Hi ;D

there's now version 2.4.11 is released

2.4.11 - 02/09/2014
* BASS_FX:
   * Fixed an issue on OSX (The Xcode project's "Installation Directory" setting set to "@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 (some effects are buggy, will be fixed soon).
   * iOS, added "arm64" architecture support.
   * Fixed Delphi/Pascal unit by changing "FLOAT" to "Single".
   * Added C/C++ "freeverb" example.

* 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.

BenMaas

Hi.

I think the Delphi version of bass_fx.pas has some minor mistakes.

   // Freeverb
const
   BASS_BFX_FREEVERB_MODE_FREEZE = 1;

type
   BASS_BFX_FREEVERB = record
      fDryMix: Single;                 // dry (unaffected) signal mix            [0........1], def. 0
      fWetMix: Single;                 // wet (affected) signal mix            [0........3], def. 1.0f
      fRoomSize: Single;               // room size                        [0........1], def. 0.5f
      fDamp: Single;                   // damping                           [0........1], def. 0.5f
      fWidth: Single;                  // stereo width                        [0........1], def. 1
      lMode: DWORD;                   // 0 or BASS_BFX_FREEVERB_MODE_FREEZE, def. 0 (no freeze)
      lChannel: Integer;              // BASS_BFX_CHANxxx flag/s
   end;

Also :

   // tempo algorithm flags
   BASS_FX_TEMPO_ALGO_LINEAR  = $200 ;      
   BASS_FX_TEMPO_ALGO_CUBIC   = $400  ;            // default
   BASS_FX_TEMPO_ALGO_SHANNON = $800 ;

Red stuff was missing.

BenMaas

hi again.

Some posts earlier Ian @ Un4seen posted a way to add silent padding to a sample. Since i am a delphi user and never got into C i have a bit trouble to convert it. Would be really nice if someone could help me.

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;
}

I know most of the equivalent syntax but i don't know what the counterpart for memset is.

(: JOBnik! :)

Hi ;D

Thanks, Delphi/Pascal unit is fixed now :)

Quote from: BenMaasHi.

I think the Delphi version of bass_fx.pas has some minor mistakes.

   // Freeverb
const
   BASS_BFX_FREEVERB_MODE_FREEZE = 1;

type
   BASS_BFX_FREEVERB = record
      fDryMix: Single;                 // dry (unaffected) signal mix            [0........1], def. 0
      fWetMix: Single;                 // wet (affected) signal mix            [0........3], def. 1.0f
      fRoomSize: Single;               // room size                        [0........1], def. 0.5f
      fDamp: Single;                   // damping                           [0........1], def. 0.5f
      fWidth: Single;                  // stereo width                        [0........1], def. 1
      lMode: DWORD;                   // 0 or BASS_BFX_FREEVERB_MODE_FREEZE, def. 0 (no freeze)
      lChannel: Integer;              // BASS_BFX_CHANxxx flag/s
   end;

Also :

   // tempo algorithm flags
   BASS_FX_TEMPO_ALGO_LINEAR  = $200 ;      
   BASS_FX_TEMPO_ALGO_CUBIC   = $400  ;            // default
   BASS_FX_TEMPO_ALGO_SHANNON = $800 ;

Red stuff was missing.

devid1988

#648
Thank you very much
It works successfully


 ;D

BenMaas

#649
Effecttails for Delphi users :

I managed to get Ians example making effecttails possible to work under Delphi and thought that i can share it.

var

    decoder,chan : Dword;
    silentpadding : Qword;
    ci : Bass_channelinfo;

 decoder := BASS_StreamCreateFile(FALSE, pchar(filename), 0, 0, BASS_STREAM_DECODE or BASS_UNICODE);
  BASS_ChannelGetInfo(decoder, ci);

  chan := BASS_StreamCreate(ci.freq, ci.chans, ci.flags and not BASS_STREAM_DECODE, @effecttailcallback, 0);
  silentpadding := BASS_ChannelSeconds2Bytes(chan, 10);  //a maximum freeverb effect has an effecttail of about 9 seconds, so 10 seconds should be enough for any setting

  BASS_ChannelPlay(chan, FALSE);

function  effecttailcallback (handle: HSTREAM; buffer: Pointer; length: DWORD; user: Pointer): DWORD; stdcall;
var r,c : integer;
      buffer2 : pointer;
      buf2car : cardinal;

begin
//
r := BASS_ChannelGetData(decoder, buffer, length); // get data from the decoder
if ((r < 0) or (BASS_ChannelIsActive(decoder) = BASS_ACTIVE_STOPPED)) then  // end of file, add padding...
begin
                if (r<0) then r:=0;
c := min(length-r, silentpadding); // amount of padding to add

                buf2car := cardinal (buffer);
                buffer2 := pointer (buf2car + r)
                fillchar (buffer^, c , #0);

r := r + c;
silentpadding := silentpadding - c; // decrease padding counter

if silentpadding <= 0 then r := BASS_STREAMPROC_END; // no more padding, end of stream
end;

result := r;
end;