BASS_FX 2.4.12.1

Started by (: JOBnik! :),

Irrational86

Quote from: MB_SOFTI'm surprised you was not able to reproduce the problem as i'm having the problem to all my users on very different hardware/os systems. Note that the problem occurs when starting play the file from the absolute begin position; if i seek the start position of 1 or 2 seconds then it play fine.
I had this happen to me when I used the (AutoAmp) code that Ian posted on this board a long time ago. It is due to the amount of silence in the begining of the file. Since the concept of the AutoAmp is to reduce the volume even more when it is below certain level, it will keep reducing the Gain factor, making the factor so small, that to increase it to a normal (louder) volume takes time, or never happens...

The fix is to make some checks and not let the AmpGain go toooo low...

MB_SOFT

Hi Jobnik,
i sent you a private message with a link to a small application test that hopefully will demonstrate you the "silence" problem..

Let me know your results...

thank you
Maurizio

(: JOBnik! :)

Hi ;D

BASS_FX is updated to version 2.1.0.2 :)

The updates are:

2.1.0.2 - 07/05/2005
--------------------
* DSP:
  * Chorus: fixed a bug, that would convert stereo to mono.
  * Low Pass Filter: fixed a bug, that would convert stereo to mono.
  * DynamicAMP: another bug fix, that would sometimes cause a total silence.
  + Added:
    * A new effect: Distortion
    * DSPFX.TXT - a values to use with some effects, to achieve different
                           effect with the same one (not using other effect/s) :)

Have fun!

8) JOBnik! 8)

(: JOBnik! :)

#163
Hi ;D

1st of all I would like to say, that BASS_FX is 3 years old (from yesterday!) :)
And I would like to thank all BASS_FX users for using it :)

In a few days I'll release a new 2.1.0.3 version, that won't include any GPL code, so it will be for sure, that BASS_FX is usable in any commercial softwares.

Thanks a lot!

Have fun!

8) JOBnik! 8)

HarryHar

When I use a BASS_FX_TempoCreate stream, I can't seem to be able to do this

procedure TfrmPlayer.SetLoopSync;
begin
  NextLoopSync := BASS_ChannelSetSync(uBassFrame.aOutputChannel[fPlayerId], BASS_SYNC_ONETIME or BASS_SYNC_POS or BASS_SYNC_MIXTIME,BASS_ChannelSeconds2Bytes(uBassFrame.aOutputChannel[fPlayerId], LoopEnd / 1000), LoopEvent, Integer( Self ));
end;

procedure TfrmPlayer.MyLoopEvent(Sender: TObject);
begin
  if Looping then begin
    SetPosition( LoopStart );
    SetLoopSync;
  end;
end;
The program freezes. It looks like the SetPosition is not executed before I set the newsync pos, wich is still the current, so it locks up.

If I fall back to a standard Bass_stream, all works fine,

Any idea?

gr. Harold

Chris

Hi
Integer( Self )
Thats wrong must be
DWORD(self)
 
QuoteIf I fall back to a standard Bass_stream, all works fine

Please Show how you will create the tempo stream.....

and with which version you are working of the bass_fx.dll

Greets Chris

HarryHar

Hello chris,

Here's the code you requested.

function TBassFrame.Load(const aFilename : String ): Boolean;
var
  Flags : Integer;
  BassStream : HStream;
begin
  Flags := 0;
  if HasMulti then begin
    case MainOutputChannels of
      osFront  : Flags := BASS_SPEAKER_FRONT;
      osRear   : Flags := BASS_SPEAKER_REAR;
      osCentre : Flags := BASS_SPEAKER_CENLFE;
    end;
  end;

  if UseSetPos then
    Flags := Flags or BASS_MP3_SETPOS;

  if isFloat[ PlayerId ] then
    Flags := Flags or BASS_SAMPLE_FLOAT;

  BassStream := BASS_StreamCreateFile( False, Pchar( aFilename ),0,0, Flags or Bass_Stream_Decode);

  aOutputChannel[fPlayerId] := BASS_FX_TempoCreate( BassStream, Flags );
end;

I also found out that EndSyncs I use appear to happen buffersize miliseconds too soon, where buffersize is set using :

BASS_SetConfig(BASS_CONFIG_BUFFER, buffersize)
and buffersize = 3000 the syncpoint fires 3 seconden before the actual position in the stream. It's just Like it looks at the underlaying basschannel and not the tempo channel.

gr. Harold

Chris

#167
Hi

try this please
function TBassFrame.Load(const aFilename : String ): Boolean;
var
  Flags : Integer;
begin
  Flags := 0;
  if HasMulti then begin
    case MainOutputChannels of
      osFront  : Flags := BASS_SPEAKER_FRONT;
      osRear   : Flags := BASS_SPEAKER_REAR;
      osCentre : Flags := BASS_SPEAKER_CENLFE;
    end;
  end;

  if UseSetPos then
    Flags := Flags or BASS_MP3_SETPOS;

  if isFloat[ PlayerId ] then
    Flags := Flags or BASS_SAMPLE_FLOAT;

  aOutputChannel[fPlayerId] := BASS_StreamCreateFile( False, Pchar( aFilename ),0,0, Flags or Bass_Stream_Decode);
  if aOutputChannel[fPlayerId] = 0 then
  begin
     // Error Dedecting........the audiofile is not loaded
     exit;
  end;
   aOutputChannel[fPlayerId] := BASS_FX_TempoCreate( aOutputChannel, Flags or BASS_FX_FREESOURCE );
end;
Greets Chris


HarryHar

Hi Chris,

Sorry, doesn't make any difference.

How about the endsync problem? Maybe I need to be talking to the underlaying bassChannel?

gr. Harold

Chris

You will meant a notify if a channel has end ??
i'm using that in my aplication (also tempo,bass)
with the tempochannel
and its absolute accurate
Greets Chris

HarryHar

I hardly even use the End sync, the biggest problem I have is an SyncPos at let say 750 ms before the end of the song. If I use a buffer of 3000 ms then the position is fired at appx. 3700 ms beore the end of the song. Without using the Tempo channel all works flawless.

ps. Using Bass_FX.DLL 2.1.0.2 and Bass.DLL 2.1.0.5

gr. Harold

Chris

Hi
sorry I`m at this moment not at Home (repairing a PC from a Friend)
If I`m at home i will test that in a little demo
Greets Chris

Chris

#172
Hi
after testing here a little bit  try the follwing about the pos sync...

with the following i will became here absolute a perfect sync with tempo 

function BassGetLen : DWORD;
var
  SongLength: float;
  FloatLen: FLOAT;
begin
   SongLength := BASS_ChannelBytes2Seconds(chan, BASS_StreamGetLength(Chan));
   FloatLen := SongLength / (BASS_FX_TempoGetRateRatio(Chan));
   Result := round(1000 * FloatLen);
end;

SyncPosHandle := Bass_ChannelSetSync(Chan,BASS_SYNC_POS,
  BASS_ChannelSeconds2Bytes(Chan, (BassGetLen -
 (750 - BASS_GetConfig(BASS_CONFIG_BUFFER))) / 1000),@SyncPosProc,DWORD(self));

testfile1
testfile Len : 4:19.971
sync will occurs on 4:19.165

testfile2
testfile Len : 35:32.645
sync will occurs on 35:31.927

testfile3

testfile Len : 2:53.845
sync will occurs on 2:53.104

Remember tempo will resample so you must calculate the buffer additionally to your value where you want the sync

Greets Chris

HarryHar

Ok, looks good, i'll give it a try. But what if my syncpos is at 50 ms from the end (which happens a lot with mix CD's), and the buffersize is 250? Any idea what would happen? Or would it mean I can't have sync points beyond Filelength-configbuffer?

gr. Harold

nadia

Hi,  ;D

I found a strange behaviour; I load a sound that has a duration of 3 minutes and 31 seconds; if I call:

BASS_FX_TempoSet (hStream, 0.0f, -1, -100.0f)

the loaded song duration grows to 3 minutes and 33 seconds: why? 0.0 shouldn't cause a change...  ???

Regards  ;D

Nadia

Chris

Hi
how do you calculate The Stream len ??
Greest Chris

nadia

Quote from: ChrisHi
how do you calculate The Stream len ??
Greest Chris

Hi  ;D

looking further into the problem I can see that the problem is caused by the
BASS_FX_TempoGetRateRatio (hStream)
function that, instead of returning 1.00 after the call described above will return 0.99 (is this a bug  ???), causing the error.

Regards  ;D

Nadia

(: JOBnik! :)

Hi ;D

Quote from: nadiaI found a strange behaviour; I load a sound that has a duration of 3 minutes and 31 seconds; if I call:

BASS_FX_TempoSet (hStream, 0.0f, -1, -100.0f)

the loaded song duration grows to 3 minutes and 33 seconds: why? 0.0 shouldn't cause a change...  ???

It looks like you've somehow changed the Samplerate, please check it out...
I've tested this on C++ and VB and I always got 1.00 ;)

Have fun!

8) JOBnik! 8)

nadia

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

It looks like you've somehow changed the Samplerate, please check it out...
I've tested this on C++ and VB and I always got 1.00 ;)

Have fun!

8) JOBnik! 8)

Hi  ;D

you are right.... it was my fault  ::)

sorry  :-[

Regards  ;D

Nadia

HarryHar

Quote from: HarryHarOk, looks good, i'll give it a try. But what if my syncpos is at 50 ms from the end (which happens a lot with mix CD's), and the buffersize is 250? Any idea what would happen? Or would it mean I can't have sync points beyond Filelength-configbuffer?

gr. Harold

Chris,

I'm still waiting for an answer.

gr.  Harold