BASS.dll and BPMs

Blitz3D Forums/Blitz3D Userlibs/BASS.dll and BPMs

Flame(Posted 2009) [#1]
Hello! Flame here!

Been awhile since I last posted here, and I come back with a rather odd question/problem. Hopefully it's a simple one that can be easily fixed.

I am busy working on a game that uses BPMs of the background music to create enemies in a sort of shooter game. I knew right away I'd need to use BASS to get the job done, and after looking around, I found out my function I need is BASS_FX_BPM_DecodeGet. After finding the parameters needed, I came up with this in the main loop:
thesize# = BASS_ChannelBytes2Seconds#(music, BASS_ChannelGetLength(music))
duh = BASS_FX_BPM_DecodeGet(music, 0, thesize#, 0, 2, BASS_NULL)

The music handler is done by such:
music = BASS_StreamCreateFile(0,"media\free.mp3",0,0,BASS_STREAM_DECODE)
BASS_ChannelPlay(music,BASS_TRUE)

This is using a modified demo_stream.bb script from the a Bass.dll source that included many examples and userlibs (I think this is the 2.1 one or something), but upon running it, I get a MAV on BASS_FX_BPM_DecodeGet.
My question is: What am I doing wrong?
Source:



Abrexxes(Posted 2009) [#2]
If you have a MAV....nothing.....with the bass.dll. Bass can not produce a MAV in the BB compiler. ;)

But, if you have time, i take a look at the rest this weekend.

cu


Abrexxes(Posted 2009) [#3]
Hi, works fine here. simple & debug compile

Make shure that you use the right bass version. 2.3.0.3.
(look into your windows/system32 folder if there is an older one , if yes, deltete it/Make shure that you use DLLS/DECLS and INCLUDES of the lattest download (see my signature))

Btw..nice function ;)

bye

Edit: next update will have a BASS_InitCallVersionError function ^^


John Blackledge(Posted 2009) [#4]
I got a MAV by asking Blitz to link to the wrong bass.dll (see other thread). Also running compile actually rebooted my machine a couple of times!

Now I have all the latest dll's, includes etc, no prooblem.
Thanks Abrexxes.


Abrexxes(Posted 2009) [#5]
Hi, John

Yes, if you have somewhere the old CALLDLL libs you can have a MAV and crashes. But my version of bass can only return 0 and not cause a crash.
The only case is if you try to return values in a blitzbank. But that is always a problem of the bb code.

Nice to hear that your problems are solwed.

bye


John Blackledge(Posted 2009) [#6]
Yeah Abrexxes - solid as a rock now.
See the 'bass.dll + 3D?' thread for the results.


Flame(Posted 2009) [#7]
Yea, I am sure I used the latest one (had downloaded it from your link 4 days before attempting this). I just checked the versions and the version matches what was stated, but I didn't install the DLL into the system32 (because it seems to play without any problem, it's just this one function). After doing so, I still cannot get it to run at all. I have both bass.dll and bass_fx.dll in the userlibs, and even after compiling into exe and running it in a folder (with the dlls in the folder btw), it still fails with MAV. My system is Windows XP Home on a Dell Laptop Inspiron 1300 if that helps.

EDIT: Is it possibly because I'm using B3D?


Abrexxes(Posted 2009) [#8]
EDIT: Is it possibly because I'm using B3D?


1.98 or 1.99? No.

hmm....sorry.. no idea


spriteman(Posted 2010) [#9]
Well its been a while.

I have been using the Blitz Bass Studio - Bass.DLL and its plugin BASS_FX.DLL to program a little music interface and have got to the same point as Flame, a MAV when hitting the BASS_FX_BPM_DecodeGet.

track1=BASS_StreamCreateFile(0,sFile1$,0,0,BASS_SAMPLE_FLOAT+BASS_STREAM_PRESCAN+BASS_STREAM_DECODE)
track1=BASS_FX_BPM_DecodeGet(channel1,0,30,0,0,Null)

I have tried various things to no avail.

Just wondering if anyone is using the last version of Abrexxes Blitz Bass Studio - Version 1.7.1 (23.03.2009) with BPM detection working successfully. Thanks.


Abrexxes(Posted 2010) [#10]
I have had an idea to make a soft. I started with BBS for me. I have seen that i have a big problem with B3D to have prov. support on audio support. Thats i started BBS.

The fact is: all the functions in BBS works because i need them, there are others that i have only includet for the community, but never tested them..


About your problem:

At the moment i have no idea, but i will take a look. (a look= in the next 356735467876725 days ;)

To be serious, at the moment i can not give you support or a date.

cu

Last edited 2010