Author Topic: BASS_FX 2.4.11.1  (Read 615107 times)

(: JOBnik! :)

  • Posts: 1065
Re: BASS_FX_FREESOURCE questions
« Reply #150 on: 24 Mar '05 - 10:00 »
Hi ;D

1- does the BASS_FX_TempoGetSource returns a valid handle if the BASS_FX_TempoCreate was called using the BASS_FX_FREESOURCE flag? From the documentation I cannot find this information.

That  flag has nothing to do with the returned value, all it does is to check if the user wants BASS_FX to free the source handle as well when calling BASS_StreamFree function or not, i.e. not freeing the source handle, that has created using BASS_StreamCreateFile(..,BASS_STREAM_DECODE) function, so without that flag you'll have to do it by yourself ;)

i.e:
1. Creating a Tempo stream without BASS_FX_FREESOURCE will only free the handle created with BASS_FX_TempoCreate function.

2. Creating a Tempo stream using BASS_FX_FREESOURCE will free the handles created with BASS_StreamCreateFile and BASS_FX_TempoCreate as well ;)

2- if I call the BASS_FX_TempoGetSource without specifying BASS_FX_FREESOURCE flag, how will the original channel be deallocated?

Are you sure you wrote a right function? I think you meant to write about BASS_FX_TempoCreate? if so, check the explanations above ;)

BASS_FX_TempoGetSource returns the handle of the e.g: BASS_StreamCreateFile function.

@Chris, which effect are you using? :)

Have fun!

8) JOBnik! 8)
« Last Edit: 24 Mar '05 - 10:22 by (: JOBnik! :) »

nadia

  • Posts: 302
Re: BASS_FX 2.1.0.1
« Reply #151 on: 24 Mar '05 - 10:23 »
Hi JOBnik,  ;D

thanks for your answer: I was believing that calling BASS_FX_TempoCreate with BASS_FX_FREESOURCE flag would have caused an immediate free of the original stream decoding channel created using  BASS_StreamCreateFile: instead this flag simply tells to the future call to BASS_StreamFree function to free the original decoding channel and also the resampled channel? Have I understood correctly?  ;)

Kind Regards  ;D

Nadia

Chris

  • Posts: 1810
Re: BASS_FX 2.1.0.1
« Reply #152 on: 24 Mar '05 - 10:30 »
 Hi JOBnik
BASS_FX_DSPFX_DAMP,

The curious is that the Crash will not come on the same File sometimes it will crash sometimes not...
After the Crash the Sound will hang in a Endless Loop (Playing the Last Buffers in a Endless Loop)
Greets Chris

I forget
i have no change made on the  Standard Parameters

« Last Edit: 24 Mar '05 - 13:11 by Chris »

MB_SOFT

  • Posts: 260
Re: BASS_FX 2.1.0.1
« Reply #153 on: 24 Mar '05 - 12:57 »
Hi JOBnik,
hope you're fine now!!
I'm sorry to bother you with the same problem: i have some file sthat play totally silently when using BASS_FX_DSPFX_DAMP with 16 bit buffers.
Here is an exemple:
http://www.mbsoft.biz/download/radiojingle.mp3
If you try this file in a 16 bit buffer with the following parameters:
.fTarget = 0.96
.fQuiet = 0.01
.fRate = 0.05
.fGain = 1.0
.fDelay = 0.2
you'll hear only silence....
Note that just changing .fdelay to 0.3 it play fine....

Hope you have some time to check calculations in the DAMP source code...
Anyway thank you for your this great fx dll

Angel

  • Posts: 41
Re: BASS_FX 2.1.0.1
« Reply #154 on: 25 Mar '05 - 22:14 »
in order to get the BPM of a file via bass_fx, does the stream has to be a decoding stream? or will a regular stream work aswell?

big_gun

  • Posts: 352
Re: BASS_FX 2.1.0.1
« Reply #155 on: 26 Mar '05 - 07:59 »
Typically a decoding stream works. Don't worry, you can open the same file, once normal, and once for decoding at the same time...

Rick

big_gun

  • Posts: 352
Re: BASS_FX 2.1.0.1
« Reply #156 on: 26 Mar '05 - 07:59 »
Oh, By The Way:

Bass for VB.NET and C# has been updated to reflect the changes in version 2.1.0.1 of Bass_FX.

Download it here http://www.un4seen.com/bass.html#addons

Angel

  • Posts: 41
Re: BASS_FX 2.1.0.1
« Reply #157 on: 26 Mar '05 - 11:42 »
Typically a decoding stream works. Don't worry, you can open the same file, once normal, and once for decoding at the same time...

Rick

well,i don't want to use a decoding stream next to my normal stream if it isnt really needed, the old bpmf.dll had an example which i used, unfortunatly,using that causes a slight 'hang' in the system while the BPM is being calculated. Another decoding stream next to my normal stream means more resources (altho it wouldnt be much).Reading the bassfx help file,i come to the conclusion that i can get the bpm from a non decoding stream with 'BASS_FX_BPM_CallbackSet', but i migh be mistaken,the helpfile isnt really as clear as the bass helpfile is

(: JOBnik! :)

  • Posts: 1065
Re: BASS_FX 2.1.0.1
« Reply #158 on: 29 Mar '05 - 16:51 »
Hi ;D

thanks for your answer: I was believing that calling BASS_FX_TempoCreate with BASS_FX_FREESOURCE flag would have caused an immediate free of the original stream decoding channel created using  BASS_StreamCreateFile: instead this flag simply tells to the future call to BASS_StreamFree function to free the original decoding channel and also the resampled channel? Have I understood correctly?  ;)

Well... think of it the other way around ;) if this flag would free the source handle, then you would hear silence, you know... ;)

You've understood correctly! ;)

BASS_FX_DSPFX_DAMP,

The curious is that the Crash will not come on the same File sometimes it will crash sometimes not...
After the Crash the Sound will hang in a Endless Loop (Playing the Last Buffers in a Endless Loop)

Are you using some other effects as well, Tempo, Reverse or BPM? Because DynamicAMP has nothing to do with BASS_ChannelGetData(..) function. Please send me the dr. watson's debug file or the full debug info, and if you can please send a file that may reproduce the crash :)

hope you're fine now!!

Thanks :) getting better :)

I'm sorry to bother you with the same problem: i have some file sthat play totally silently when using BASS_FX_DSPFX_DAMP with 16 bit buffers.
Here is an exemple:
http://www.mbsoft.biz/download/radiojingle.mp3
If you try this file in a 16 bit buffer with the following parameters:
.fTarget = 0.96
.fQuiet = 0.01
.fRate = 0.05
.fGain = 1.0
.fDelay = 0.2
you'll hear only silence....
Note that just changing .fdelay to 0.3 it play fine....

Hope you have some time to check calculations in the DAMP source code...

As I've already said :) the file is playing fine here and the file before that. It plays fine with 16 and 32 bits.

I've made a loop that starts the sound from 6% and it raised to what I've choosed and no silence at all :)

My system is: Intel P4 3.0GHz, RealTek 7.1 (onboard) sound card, DirectX 9.0c, WinXP PRO SP2 with latests sound drivers... which system do you have?

Anyway thank you for your this great fx dll

You're welcome and thank you and all who're using BASS_FX :)

well,i don't want to use a decoding stream next to my normal stream if it isnt really needed, the old bpmf.dll had an example which i used, unfortunatly,using that causes a slight 'hang' in the system while the BPM is being calculated. Another decoding stream next to my normal stream means more resources (altho it wouldnt be much).Reading the bassfx help file,i come to the conclusion that i can get the bpm from a non decoding stream with 'BASS_FX_BPM_CallbackSet', but i migh be mistaken,the helpfile isnt really as clear as the bass helpfile is

1st of all you don't have to use the decoding channel for detecting the BPM, as you've found out you can use BASS_FX_BPM_CallbackSet(..) function. The decoding BPM check is good if you want to check the BPM of a file from that exact point to another with almost no time :) the other options Callback will only calculate the BPM from the last choosen seconds, e.g. you want to know a BPM every 10 (or else) seconds (you'll get a BPM after the seconds number you've choosed).
I'll see what kind of improvements can I add to the helpfile ;)

Oh, By The Way:

Bass for VB.NET and C# has been updated to reflect the changes in version 2.1.0.1 of Bass_FX.

Download it here http://www.un4seen.com/bass.html#addons

There're still some errors in APIs there ;) I'll send you the list of correction to do ;)

Thank you :)

Have fun!

8) JOBnik! 8)

MB_SOFT

  • Posts: 260
Re: BASS_FX 2.1.0.1
« Reply #159 on: 29 Mar '05 - 18:31 »
As I've already said  the file is playing fine here and the file before that. It plays fine with 16 and 32 bits.
I've made a loop that starts the sound from 6% and it raised to what I've choosed and no silence at all


Thank you for your reply and tests.
I'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.
Here there is another "silent" file:
http://www.mbsoft.biz/download/introspot.mp3
I remarked that the problem occur with files having some gap on top.
Do you have any test application to run on my computer to check the problem?

Here the calls sequence on my application:
BASS_StreamCreateFile
BASS_StreamGetLength
BASS_ChannelBytes2Seconds
BASS_FX_DSP_Set
BASS_ChannelPlay

System:
Windows: XP Service Pack 2 2600
Pc Freq: 1534 Mhz - AuthenticAMD - 1 Cpu(s) - 0
Free Ram: 348 MB
DirectX version is: 9
Bass.dll version: 2. 1
BassFx.dll version: 2. 1
BASS_GetDeviceDescription: Periferica wave SB Live!
Latency is: 1 with a min buffer: 50
device driver: C:\WINDOWS\system32\drivers\emu10k1m.sys - 5.12.1.3300
Bass DLL buffer: 500
Bass DLL period is: 100
« Last Edit: 29 Mar '05 - 18:47 by MB_SOFT »

Irrational86

  • Posts: 960
Re: BASS_FX 2.1.0.1
« Reply #160 on: 30 Mar '05 - 02:26 »
I'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

  • Posts: 260
Re: BASS_FX 2.1.0.1
« Reply #161 on: 30 Mar '05 - 10:08 »
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! :)

  • Posts: 1065
Re: BASS_FX 2.1.0.2
« Reply #162 on: 7 May '05 - 16:32 »
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! :)

  • Posts: 1065
Re: BASS_FX 2.1.0.2
« Reply #163 on: 15 Jun '05 - 18:38 »
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)
« Last Edit: 16 Jun '05 - 10:37 by (: JOBnik! :) »

HarryHar

  • Posts: 147
Re: BASS_FX 2.1.0.2
« Reply #164 on: 19 Jun '05 - 23:00 »
When I use a BASS_FX_TempoCreate stream, I can't seem to be able to do this

Code: [Select]
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

  • Posts: 1810
Re: BASS_FX 2.1.0.2
« Reply #165 on: 20 Jun '05 - 00:00 »
Hi
Integer( Self )
Thats wrong must be
DWORD(self)
 
Quote
If 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

  • Posts: 147
Re: BASS_FX 2.1.0.2
« Reply #166 on: 20 Jun '05 - 13:01 »
Hello chris,

Here's the code you requested.

Code: [Select]
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 :

Code: [Select]
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

  • Posts: 1810
Re: BASS_FX 2.1.0.2
« Reply #167 on: 20 Jun '05 - 14:21 »
Hi

try this please
Code: [Select]
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


« Last Edit: 20 Jun '05 - 14:23 by Chris »

HarryHar

  • Posts: 147
Re: BASS_FX 2.1.0.2
« Reply #168 on: 20 Jun '05 - 14:32 »
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

  • Posts: 1810
Re: BASS_FX 2.1.0.2
« Reply #169 on: 20 Jun '05 - 15:01 »
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

  • Posts: 147
Re: BASS_FX 2.1.0.2
« Reply #170 on: 20 Jun '05 - 15:30 »
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

  • Posts: 1810
Re: BASS_FX 2.1.0.2
« Reply #171 on: 20 Jun '05 - 17:35 »
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

  • Posts: 1810
Re: BASS_FX 2.1.0.2
« Reply #172 on: 21 Jun '05 - 03:08 »
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 

Code: [Select]
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;

Code: [Select]
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

« Last Edit: 21 Jun '05 - 03:31 by Chris »

HarryHar

  • Posts: 147
Re: BASS_FX 2.1.0.2
« Reply #173 on: 21 Jun '05 - 07:33 »
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

  • Posts: 302
Re: BASS_FX 2.1.0.2
« Reply #174 on: 7 Jul '05 - 18:27 »
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