Dark Bit Factory & Gravity

PROGRAMMING => General coding questions => Topic started by: Mcquade on July 17, 2008

Title: Dark Basic an Bass.dll
Post by: Mcquade on July 17, 2008
i have a problem with the new bass.dll
ive read the manual and made this code:



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 i cant hear anything.. whats wrong ? hope someone can help me


thx mcq

Title: Re: Dark Basic an Bass.dll
Post by: Jim on July 17, 2008
Hi McQuade!  You're not having much luck are you?!  The sad thing is I don't think anyone here is using DarkBasic and so helping you is going to be tricky.  Do you program in any other languages?  Lots of people here use Blitz or FreeBasic, and some use PureBasic.

Jim
Title: Re: Dark Basic an Bass.dll
Post by: Mcquade on July 17, 2008
oh shit.... with the bassmod dll its works... but with the "normal" bass no sound... i can cry....

i tryed it now for about 2 days out...

cheers mcq


no sorry i dont use any other basic language...

okay now i fixed it to hear music :bfuck1:  :carrot: :inspired: :inspired: :inspired:

but now i have a another problem how to make a good visualisation from bass.dll (channelgetdata) anyone a idea???


many thx
Title: Re: Dark Basic an Bass.dll
Post by: Clyde on July 19, 2008
Welldone dude, how did you fix it?

Cheers and all the very best,
Clyde.
Title: Re: Dark Basic an Bass.dll
Post by: rain_storm on July 20, 2008
but now i have a another problem how to make a good visualisation from bass.dll (channelgetdata) anyone a idea???

Are you trying to sync a graphics effect to the music? If so it is not so difficult to do some basic syncing. if you can get the frequency that is being played you can use this as a seed to change colour and what not. I know its very simplistic but it is effective if you figure out what variables in the GFX part are best to modify. Also if you know what value to expect at a certain time you can use the note/frequency as a signal to start doing a different effect.
What does channelgetdata return?
Title: Re: Dark Basic an Bass.dll
Post by: Rbz on July 20, 2008
If you want to use fmod.dll, you can find an example that I did some time ago, here:
http://dbfinteractive.com/forum/index.php?topic=946.msg13925#msg13925

Title: Re: Dark Basic an Bass.dll
Post by: Mcquade on July 21, 2008
Thx Dudes  :|| :clap:


my mistake in my codes was this one :


load dll "bass.dll", 1         

REM ***********************************************************************************************************
gosub INIT_SOUND
gosub init_GFX
REM ***********************************************************************************************************

REM ***********************************************************************************************************
Rem ***** Main Source File *****
repeat


rem gosub greenbar
gosub boxing
   if spacekey()=1 then call dll 1,"BASS_Stop"
   if returnkey() = 1 then call dll 1,"BASS_Start"
sync
until escapekey() = 1
call dll 1,"BASS_STOP"
call dll 1,"BASS_FREE"
flush video memory
end
REM ***********************************************************************************************************


REM ***********************************************************************************************************
INIT_SOUND:
init = call Dll (1,"BASS_Init", -1 ,44100 ,BASS_DEVICE_CPSPEAKERS,0,0)
If Init = 0
Print "Initalisierung des digitalen Soundsystem fehlgeschlagen!"
Sleep 1000 : Delete Dll 1 : End
EndIf
Start = Call Dll(1,"BASS_Start")
If Start = 0
Print "Starten des digitalen Output fehlgeschlagen!"
Sleep 1000 : Delete Dll 1 : End
EndIf

hmod = call dll (1, "BASS_MusicLoad", 0, "208.xm", 0, 0, BASS_SAMPLE_LOOP,BASS_MUSIC_RAMP,BASS_MUSIC_FT2MOD,0)     HERE WAS THE FU.. MISTAKE...
If hmod = 0
Print "Mod konnte nich geladen werden !"
Sleep 1000 : Delete Dll 1 : End
EndIf
call dll 1, "BASS_ChannelPlay", hmod, 0
return
REM ***********************************************************************************************************

INIT_GFX:
load image "GFX\Copper_10.png",1
load image "GFX\Copper_11.png",2
load image "GFX\Copper_12.png",3

return

REM ***********************************************************************************************************
greenbar:

box 1,1,99,50,rgb(0,200,0),rgb(0,50,0),rgb(0,200,0),rgb(0,50,0)
box 1,50,99,99,rgb(0,50,0),rgb(0,200,0),rgb(0,50,0),rgb(0,200,0)
return
REM ***********************************************************************************************************


REM ***********************************************************************************************************
boxing:

paste image 1,0,200,0

Call Dll 1,"BASS_ChannelGetData",hmod,Bank,BASS_DATA_FFT2048

return

Thx for the link i will check it out now.

cheers Mcq

Title: Re: Dark Basic an Bass.dll
Post by: Shockwave on July 21, 2008
Glad you're sorted :)

Have some good karma for reporting back and letting us know it's fixed :)