Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / BASS Spectrum

Author
Message
Mcq
16
Years of Service
User Offline
Joined: 28th Dec 2007
Location:
Posted: 15th Jul 2008 19:07
How can i make a "simple" spectrum ana. with BASS.DLL ?

i found this :


BASS_MusicPlay(tune)
; --- Create a bank to use as a buffer from bass.dll
Buffer = CreateBank(2048)

Repeat
Cls
; --- Fetch the sound info from bass.dll and bung it in the buffer
Result = BASS_ChannelGetData(tune,Buffer,BASS_DATA_FFT512) ; result=-1 if it fails i think
; --- Setup 128 bars, got this from one of the examples
For I = 0 To 128
Value# = PeekFloat#(Buffer,I * 4) ; Get the value (it will be floating point)
; --- Set up colours and position bars (value# will be small so times it to make it bigger)
Color 255,0,0 : Rect 60+(I * 4),(height-1) - (Value# * 1000),3,Value# * 1000
Color 0,255,255 : Rect 60+(I * 4),(height-1) - Value# * 1000,3,2
Next
Flip
Until MouseHit(1) Or KeyHit(1) ; Quit condition
; --- Stop music and freeup all resources used by the dll
BASS_Stop : BASS_StreamFree(tune)
BASS_MusicFree(tune) : BASS_Free()
End

its a source code from BBasic..

im to foolish for it ... shame one me...

thx
Mcq
16
Years of Service
User Offline
Joined: 28th Dec 2007
Location:
Posted: 16th Jul 2008 16:17 Edited at: 17th Jul 2008 06:29
NEXT PROBLEM with BASS.DLL

how to init the "new" bass dll ?? 97336kbytes (newest version) 2.xxx

i made this :

#CONSTANT BASS_DLL 1


call dll BASS_DLL,"BASS_Init",0 ,44100 ,0
call dll BASS_DLL,"BASS_SetVolume",100
call dll BASS_DLL,"BASS_MusicLoad",0 ,"aryx.s3m",0 ,0,(1 or 512)
call dll BASS_DLL,"BASS_Start"
call dll BASS_DLL,"BASS_ChannelPlay",0,-1,0


FUNCTION bass_DLLinit

if file exist("bass.dll")
load dll "bass.dll",BASS_DLL
endif

ENDFUNCTION


no sound output.. what wrong ?

mcq



UPDATE ! After i read the Manual i found some bugs:

so here is the "new" init :

load dll "bass.dll",1

call dll 1,"BASS_Free"
call dll 1,"BASS_Init",-1 ,44100 ,BASS_DEVICE_CPSPEAKERS,0,0
call dll 1,"BASS_MusicLoad",0 ,mod$,0 ,0,BASS_SAMPLE_LOOP||BASS_MUSIC_RAMP,0

`main program loop
call dll 1,"BASS_ChannelPlay",HMUSIC,0

but no music output... noone can help ???
Mcq
16
Years of Service
User Offline
Joined: 28th Dec 2007
Location:
Posted: 18th Jul 2008 20:03
OKay WORXS NOW !! puuhhh shame on me... a little mistake i made...

thx @all
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th Aug 2008 13:11
how did you manage to make this to work at the end?

i am trying to get it working too!!
Mcq
16
Years of Service
User Offline
Joined: 28th Dec 2007
Location:
Posted: 5th Aug 2008 21:07
my mistake was here :

call dll 1,"BASS_Free"
call dll 1,"BASS_Init",-1 ,44100 ,BASS_DEVICE_CPSPEAKERS,0,0
call dll 1,"BASS_MusicLoad",0 ,mod$,0 ,0,BASS_SAMPLE_LOOP...here !!BASS_MUSIC_RAMP,0


so its works

call dll 1,"BASS_Free"
call dll 1,"BASS_Init",-1 ,44100 ,BASS_DEVICE_CPSPEAKERS,0,0
call dll 1,"BASS_MusicLoad",0 ,mod$,0 ,0,BASS_SAMPLE_LOOP,BASS_MUSIC_RAMP,0


mfg mcq

Login to post a reply

Server time is: 2024-11-25 19:43:15
Your offset time is: 2024-11-25 19:43:15