Bass Library Documentation

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Bass Library Documentation

Post by gecko » 08 Feb 2021, 20:19

Hi all,

I have recently downloaded bass.dll for a project and then discovered there was an AHK library for it. I am looking for documention on what it can do and how to use it, but I can't find any, nor have I found a definitive download for it bass.ahk itself. I have found a couple versions, but I'm rather confused - not hard to do, I'm definitely new at this.

My objective with this project is to loop playback of a wav file and be able to change volume, pitch, and rate in real time based on inputs from other parts of the script.

Any help is much appreciated. Thanks.


gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 09 Feb 2021, 10:00

Thanks, that at least helps with my confusion about what version I should have. Still need to get some documentation. I've seen it mentioned, but I've never found a link to anything.

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Bass Library Documentation

Post by malcev » 09 Feb 2021, 16:53

You have to google their forum.
http://www.un4seen.com/forum/?topic=16913.0

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Bass Library Documentation

Post by BoBo » 09 Feb 2021, 17:43

Got it (after searching the link that has been kindly provided by @malcev :thumbup:) https://www.un4seen.com/doc/

gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 10 Feb 2021, 23:24

Thanks a lot. I appreciate it. Is there anything that talks about the AHK library for it? Haven't seen anything here or at un4seen.

gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 10 Feb 2021, 23:52

Alternatively, are there examples of of code using dll calls (instead of using the bass ahk library) to set attributes of a file as it plays?

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Bass Library Documentation

Post by BoBo » 11 Feb 2021, 00:05

AFAICS, it‘s not that hard to find examples about that: Google > site:autohotkey.com bass.dll
Ie. https://autohotkey.com/board/topic/90556-solved-how-to-play-mp3-using-bassdll/

gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 11 Feb 2021, 00:16

I have those, but to be honest I'm having a hard time interpreting that and applying it to something like setting BASS_ATTRIB_MUSIC_SPEED. So I was hoping to find something that showed more than just getting it to play a sound, but I've not had much luck.

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Bass Library Documentation

Post by malcev » 11 Feb 2021, 04:36

If You want to get help with errors in Your code, then post it.
If You want to get ready code then hire freelancer.

gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 12 Feb 2021, 00:09

Neither of those is what I'm going for, the former because what I have right now is so wrong there is hardly any point, and the latter because I am asking for help figuring it out, not asking someone to do it for me. If there was an example parsed out showing a line and what various parts do, as is normal in most documentation I have seen, I could probably take it from there. I have looked for quite some time, just haven't found anything applicable to what I am trying to do.

But anyways, here is my horribly wrong line:

Code: Select all

BASS_ATTRIB_MUSIC_SPEED_SET	:=DllCall(A_ScriptDir . "\bass.dll\BASS_ChannelSetAttribute", UInt, hMedia, BASS_ATTRIB_MUSIC_SPEED float, 5.0)
It is supposed to modify the playback speed of a wav file that is already playing, assumedly from 255 (normal speed?) down to something much slower.
Last edited by gecko on 12 Feb 2021, 00:58, edited 1 time in total.

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Bass Library Documentation

Post by malcev » 12 Feb 2021, 00:40

1) You have to understand how to call dll calls. (RTFM)
2) Try just play mp3 with dllcall to bass.dll.

gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 12 Feb 2021, 00:55

1. Check. Some stuff I am doing just fine with, but in this case I seem to have to specify which attribute in the dll function I am trying to modify, and that part isn't going well. And no, I don't understand everything I have read there - trying to bash my head against it until I do. But fact is my knowledge is obviously pretty basic.

2. Check. I've had that much working the whole time.

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Bass Library Documentation

Post by malcev » 12 Feb 2021, 00:57

I dont see any code that plays wav with bass.dll from You.

gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 12 Feb 2021, 01:08

I didn't think that part was relevant, since I'm not having problems there, but here it is, plus the section I am trying to make work:

Code: Select all

BASS_DLLCALL := DllCall("LoadLibrary","str",A_ScriptDir "\bass.dll") ; load Bass.dll
BASS_Init := DllCall(A_ScriptDir . "\bass.dll\BASS_Init",Int,-1,UInt,44100,Int,0,UInt,0,UInt,0)
BASS_start := DllCall(A_ScriptDir . "\bass.dll\BASS_Start", int)
hMedia:= DllCall(A_ScriptDir "\bass.dll\BASS_StreamCreateFile", Int, 0, Astr, "Engine.wav", Uint, 0, Uint, 0, Uint, 0, Uint, 44100)
BASS_ChannelPlay := DllCall(A_ScriptDir . "\bass.dll\BASS_ChannelPlay", UInt,hMedia, Int,1)

a::
BASS_ATTRIB_MUSIC_SPEED_SET :=DllCall(A_ScriptDir . "\bass.dll\BASS_ChannelSetAttribute", UInt, hMedia, BASS_ATTRIB_MUSIC_SPEED float, 5.0)
Return

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Bass Library Documentation

Post by malcev » 12 Feb 2021, 01:15

1)

Code: Select all

BASS_Init := DllCall(A_ScriptDir . "\bass.dll\BASS_Init",Int,-1,UInt,44100,Int,0,UInt,0,UInt,0)
not right. should be

Code: Select all

BASS_Init := DllCall(A_ScriptDir . "\bass.dll\BASS_Init",Int,-1,UInt,44100,Int,0,"ptr",0,"ptr",0)
2)
You dont need this

Code: Select all

BASS_start := DllCall(A_ScriptDir . "\bass.dll\BASS_Start", int)
3)
Not right, read manual how right to call it.

Code: Select all

hMedia:= DllCall(A_ScriptDir "\bass.dll\BASS_StreamCreateFile", Int, 0, Astr, "Engine.wav", Uint, 0, Uint, 0, Uint, 0, Uint, 44100)

gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 12 Feb 2021, 01:30

1 and 3. They seem to work just fine, so I'm not sure what is wrong about them?

2. True enough, thanks.

At any rate, could you explain where you are going with this, because to my limited understanding this has nothing to do with my actual problem?

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Bass Library Documentation

Post by malcev » 12 Feb 2021, 01:38

Your actual problem is that You dont know how correctly call dll.
If You understand how to correct call them, then You will not get problem in future.
You have to look to what each dllcall returns and check this response is OK or not.
Also after each dllcal You have to look at errorlevel to see it is ok or not.

gecko
Posts: 37
Joined: 13 Nov 2017, 23:19

Re: Bass Library Documentation

Post by gecko » 12 Feb 2021, 01:43

Thanks, I see what you mean, kind of. Thanks for your time, I hope I have not wasted too much of it.

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Bass Library Documentation

Post by malcev » 12 Feb 2021, 02:03

It is OK.
When You understand how correctly call dll, then You have to read manual of dll that You called and make some conclusions.
http://www.un4seen.com/doc/#bass/BASS_ATTRIB_MUSIC_SPEED.html
Remarks
This attribute is a direct mapping of the MOD's speed, so the value can be changed via effects in the MOD itself.
Then You have to go to my link from 4th post, read it and make conclusion that You have to use one more dll to get what You want.

Post Reply

Return to “Ask for Help (v1)”