1. Post #1
    Grocel's Avatar
    October 2008
    1,249 Posts
    The module gm_bass was originally made by AzuiSleet and got major edited by me with his permission.

    Gm_bass2 hooks into a third party sound engine called BASS by the un4seen organization and its plug-ins.
    Using this module will make you able to stream various formats of sound and play them as 3d world sound.

    Why did you edit it and what did you change?
    My changes are:
    - You can use gm_bass2 shared now! (This means it can also be used to get stream informations serverside while it is also used clientside.)
    - Added AAC, FLAC, MOD support.
    - Added support for the filesystem of GMod.
    - Made use of GMod's BASS.
    - Improved the GMod Window check, so you can also use it on a dedicated server.

    - Warning: It's not compatible with the old gm_bass any more! Read the SVN Change logs or this thread for more infos.
    - Renamed almost all functions, please read the documentation below.

    - Made BASS always silent serverside.
    - Updated the bass and plug-in libraries.
    - Changed error outputs on loading errors.
    - Changed sound fading.

    Added:
    - channel:IsValid(), channel:IsPaused() and channel:channel:IsStalled().
    - string = BASS.DecodeErrorCode(number), gives out the description of an error code.
    - table = BASS.Plugins, it's a table of the loaded plugins. The key is the name and the value is the version.

    - two optional boolean arguments to BASS.StreamFile(), the 1st one is for 3d playing (false/nil = on) and the 2nd is for loop playing (true = on).
    - a optional boolean argument to BASS.StreamFileURL(), it is for 3d playing (false/nil = on).
    - a optional bool argument to channel:Play(), true makes the channel restart.

    - all fft* function BASS supports
    - Changed how are the channel:fft*() functions are working, it takes a table that gets changed now, instead of creating a new one each time.

    - number = BASS.Version, that's number of the BASS version.
    - number = BASS.ModuleVersion, that's number of the BASS version.
    - number = channel:getfrequency(), that returns the sample rate in Hz.
    - number = channel:getsample(), that returns the sample size in Bit.
    - string = channel:gettype(), that returns the format as a string.
    - number = channel:getvolume(), that returns the volume. (clientside)

    - Added nil = channel:set3dfadedistance(number distance), sets the distance the sound begins to fade. (clientside)
    - Added nil = channel:set3dcone(number innerangle, number outerangle, number outvolume)
    - Sets the cone of the sound, in the inner angle the sound is played at max volume, out of the outerangle the sound is played at the given (outvolume) volume. (clientside)

    Removed:
    - BASS.SetPosition(), not needed anymore.
    - channel:setvolume() serverside.
    - channel:channel_set3dposition() serverside.
    - the 2nd argument of BASS.StreamFile(), it was a number that set the time offset. It never worked and could cause crashes.

    Documentation:
    gm_bass_documentation.html

    Downloads:
    Windows Binarys (Source included)

    Todo:
    1. Find someone who is able and willing to do Mac an Linux compiles. I can't do it my self, because I don't know, want or own Linux or MacOS.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Winner Winner x 10Lua King Lua King x 3Dumb Dumb x 1 (list)

  2. Post #2
    gamerpaddy's Avatar
    March 2009
    377 Posts
    What do you mean with
    "- You can use gm_bass_edit shared now!"

    People dont need to download bass.dll, to use it on specific servers?

    Hell.. thats what we need
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Dumb Dumb x 9Optimistic Optimistic x 1Lua Helper Lua Helper x 1Disagree Disagree x 1 (list)

  3. Post #3
    Gold Member
    Alex_grist's Avatar
    January 2007
    1,076 Posts
    I think it means it can be used on both client and server, so it is still needed on the client.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 3Lua Helper Lua Helper x 1 (list)

  4. Post #4
    Grocel's Avatar
    October 2008
    1,249 Posts
    What do you mean with
    "- You can use gm_bass_edit shared now!"

    People dont need to download bass.dll, to use it on specific servers?

    Hell.. thats what we need
    No, it just can be used on servers too. It's needed to get stream informations such like tages, sound level or spectrum. Streams are muted serverside so servers will not start to play music, if you open a stream with it.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Funny Funny x 2 (list)

  5. Post #5
    We Are No Idiots
    Aide's Avatar
    March 2010
    4,860 Posts
    Good thing this got updated I was planning on creating a plugin for exclserver for streaming music.

  6. Post #6
    Gold Member
    maurits150's Avatar
    February 2007
    1,818 Posts
    Can't garry just please spend 1000 euros out of his millions get this damn bass license and ship this with GMod.
    Reply With Quote Edit / Delete Reply Windows 7 Netherlands Show Events Agree Agree x 25Funny Funny x 5Winner Winner x 1 (list)

  7. Post #7
    Grocel's Avatar
    October 2008
    1,249 Posts
    Do any of you know, if you are able to put these third party dlls (bass.dll and tags.dll) into the gmod module?

  8. Post #8
    JustSoFaded's Avatar
    December 2011
    432 Posts
    Can you rephrase that question.

  9. Post #9
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,852 Posts
    He wants to put the additional required DLLs into the module itself.

  10. Post #10
    Gold Member
    Alex_grist's Avatar
    January 2007
    1,076 Posts
    Do any of you know, if you are able to put these third party dlls (bass.dll and tags.dll) into the gmod module?
    Yes you probably could compile bass.dll and tags.dll as a static library so they're included into the module itself.
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Informative Informative x 1Disagree Disagree x 1 (list)

  11. Post #11
    Grocel's Avatar
    October 2008
    1,249 Posts
    Are *.lib files static libraries?
    Also I don't have the source code of bass.dll and tags.dll, because they are closed source.
    Do I need the source code to compile it as a static library?

  12. Post #12
    Gold Member
    Alex_grist's Avatar
    January 2007
    1,076 Posts
    Are *.lib files static libraries?
    Also I don't have the source code of bass.dll and tags.dll, because they are closed source.
    Do I need the source code to compile it as a static library?
    Yes. You'd need to recompile them so yes you'd need the source code.
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Informative Informative x 1Agree Agree x 1 (list)

  13. Post #13
    Tessius's Avatar
    June 2011
    80 Posts
    Would there be anyone willing to help me compile a Linux Shared Object/Binary of gm_bass?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Friendly Friendly x 1 (list)

  14. Post #14
    Grocel's Avatar
    October 2008
    1,249 Posts
    Would there be anyone willing to help me compile a Linux Shared Object/Binary of gm_bass?
    Unfortunately I don't know how to compile for Linux/Mac, since I don't know/own/want Linux/Mac. It would be truly nice if someone could compile a Linux/Mac build for us.

  15. Post #15
    Tessius's Avatar
    June 2011
    80 Posts
    Which language did you compile the dll in?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 2Funny Funny x 1 (list)

  16. Post #16
    Dragon Dildoes
    Dennab
    April 2009
    4,432 Posts
    Which language did you compile the dll in?
    c++, obviously.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Agree Agree x 1Optimistic Optimistic x 1 (list)

  17. Post #17
    JustSoFaded's Avatar
    December 2011
    432 Posts
    Which language did you compile the dll in?
    Lua















    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 16Disagree Disagree x 1Winner Winner x 1 (list)

  18. Post #18
    Grocel's Avatar
    October 2008
    1,249 Posts
    I just updated the module, here are the changes:
    - Updated the bass and plugin libraries.
    - Added AAC, FLAC and MIDI plugins.

    - Added 2 optional boolean arguments to BASS.StreamFile(), the first one is for 3d playing (false/nil = on) and the second is for loop playing (true = on).
    - Added a optional boolean argument to BASS.StreamFileURL(), it is for 3d playing (false/nil = on).
    - Added a optional bool argument to channel:play(), true makes the channel restart.

    - Added table = channel:fft256(), it does the same as channel:fft2048(), but the table has 128 indexes.
    - Added table = channel:fft512(), it does the same as channel:fft2048(), but the table has 256 indexes.
    - Added table = channel:fft1024(), it does the same as channel:fft2048(), but the table has 512 indexes.
    - Also some code cleanup.


    I also have a question to you:
    Today, I have seen that the developers of GMod Tower somehow managed to load the gm_bass modules (bass.dll, tags.dll, bassmidi.dll, etc.) right from the addon's lua/includes/module folder just a few weeks ago.
    So I would like to know how they done this, because it would be also useful for me. Can someone explain this to me?
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Useful Useful x 1 (list)

  19. Post #19
    Scooby's Avatar
    March 2010
    41 Posts
    Yeah, in that post it makes it seem like that the binary modules load from the addon folder but I thought you couldn't do that..
    If there is a way to do that it would be less confusing for people installing addons with binary modules in them, but then again its a way to trick people into installing malicious files by hiding it in an addon :P

  20. Post #20
    Grocel's Avatar
    October 2008
    1,249 Posts
    Yeah, in that post it makes it seem like that the binary modules load from the addon folder but I thought you couldn't do that..
    If there is a way to do that it would be less confusing for people installing addons with binary modules in them, but then again its a way to trick people into installing malicious files by hiding it in an addon :P
    You can load GMod binary modules (gm_bass.dll) from the addons folder for a while. What I want to know is: How do I load the third party modules (bass.dll, tags.dll) which aren't GMod modules from elsewhere than the exe's folder.

  21. Post #21
    gamerpaddy's Avatar
    March 2009
    377 Posts
    we should make a Addon like Wiremod or a new PHX model pack, that every player need
    with (gm_)bass.dll inside (or installer for all that stuff..)

  22. Post #22
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    You can load GMod binary modules (gm_bass.dll) from the addons folder for a while. What I want to know is: How do I load the third party modules (bass.dll, tags.dll) which aren't GMod modules from elsewhere than the exe's folder.
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx maybe.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Dumb Dumb x 1Friendly Friendly x 1 (list)

  23. Post #23
    Dragon Dildoes
    Dennab
    April 2009
    4,432 Posts
    we should make a Addon like Wiremod or a new PHX model pack, that every player need
    with (gm_)bass.dll inside (or installer for all that stuff..)
    Can be abused to easily.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Funny Funny x 1 (list)

  24. Post #24
    Grocel's Avatar
    October 2008
    1,249 Posts
    It seems to work for exes only. It seemed to have no effect when I used it in the GMod module. But maybe this will takes me bit closer later.

  25. Post #25
    Map in a box's Avatar
    July 2009
    7,415 Posts
    We need a BASS module that gives you access to all the BASS functions in a table, not these wrappers which limit the functionality. :saddowns:
    Reply With Quote Edit / Delete Reply Windows XP Professional x64 United States Show Events Informative Informative x 1 (list)

  26. Post #26
    Dragon Dildoes
    Dennab
    April 2009
    4,432 Posts
    We need a BASS module that gives you access to all the BASS functions in a table, not these wrappers which limit the functionality. :saddowns:
    You can only use a wrapper method.

    Edited:

    You can only use a wrapper method.
    Except you can make an automated script that creates all needed object classes in lua, creates all the functions with fail-safe protections and so on.

  27. Post #27
    Map in a box's Avatar
    July 2009
    7,415 Posts
    Well you know what I mean, wrappers as in creating the sound for you and everything. I was thinking more of the lines of autogenerating a module file for compiling using the BASS headers.
    Reply With Quote Edit / Delete Reply Windows XP United States Show Events Optimistic Optimistic x 1 (list)

  28. Post #28
    Dragon Dildoes
    Dennab
    April 2009
    4,432 Posts
    Have fun doing that.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Agree Agree x 1 (list)

  29. Post #29
    Grocel's Avatar
    October 2008
    1,249 Posts
    -snip, outdated-
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Friendly Friendly x 1 (list)

  30. Post #30
    Ruzza's Avatar
    December 2011
    1,137 Posts
    Fixed crash on load in GMod 13.
    Windows Binary (for GMod 13)

    If you want to use this module in GMod 12 then have this version:
    Windows Binary (for GMod 12)

    Thanks to AzuiSleet:
    I wish we could make players download this module and use it with gmod, if it was to popup a menu saying "Would you like to download gmcl_bass.dll" with Yes/No buttons. That would be insanely fucking awesome! But good job.
    Reply With Quote Edit / Delete Reply Windows 7 Australia Show Events Optimistic Optimistic x 4Agree Agree x 1 (list)

  31. Post #31
    Map in a box's Avatar
    July 2009
    7,415 Posts
    Garry just needs to fork 1000 euros up. It's not like he doesn't have it and more
    Reply With Quote Edit / Delete Reply Windows XP United States Show Events Funny Funny x 4Optimistic Optimistic x 1Agree Agree x 1 (list)

  32. Post #32
    Gold Member
    maurits150's Avatar
    February 2007
    1,818 Posts
    Reply With Quote Edit / Delete Reply Windows 7 Netherlands Show Events Disagree Disagree x 1Friendly Friendly x 1 (list)

  33. Post #33
    Map in a box's Avatar
    July 2009
    7,415 Posts
    It wouldn't be the first thing useful that won't be added :V
    Reply With Quote Edit / Delete Reply Windows XP Professional x64 United States Show Events Agree Agree x 5 (list)

  34. Post #34
    Grocel's Avatar
    October 2008
    1,249 Posts
    I would prefer when the stuff of Bass (streaming and fft2048) could be done with source's sound engine. I don't like the idea to have two sound engines in one game when one is enough.

    Once I tested this: I streamed something to an mp3 file. Then I tried to play that file in source. It said that this file wasn't found (the file was there and valid to other players). As soon I stopped writing to that file, it worked fine.

    This proves that it seems to work with stuff from streams, but only whens ended. The next step would be to give the sound engine from the game the ability to play from urls and to return the spectrum and level of the sound to lua. I don't know how it works, but I think it's doable.

    According to this: http://facepunch.com/threads/1182079...1#post36044315
    You are already able to play streams as 3D sound using lua, html, javascript and flash. The sound comes then from an invisible html panel, I guess. But spectrum returning wasn't done/shown jet.

  35. Post #35
    Map in a box's Avatar
    July 2009
    7,415 Posts
    I believe source uses DirectSound, so if you could hook into that. But BASS has so many useful functions and they are easy to use. :saddowns:
    Reply With Quote Edit / Delete Reply Windows XP United States Show Events Agree Agree x 2 (list)

  36. Post #36
    Ruzza's Avatar
    December 2011
    1,137 Posts
    What if we had a fund raiser and we donated exactly 1000 euro's and then Garry will buy this for GMOD?? I would donate.
    Reply With Quote Edit / Delete Reply Windows 7 Australia Show Events Dumb Dumb x 4Optimistic Optimistic x 1Late Late x 1 (list)

  37. Post #37
    Dragon Dildoes
    Dennab
    April 2009
    4,432 Posts
    What if we had a fund raiser and we donated exactly 1000 euro's and then Garry will buy this for GMOD?? I would donate.
    You'd pay for gmod updates?

    Don't give garry ideas.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Funny Funny x 5Agree Agree x 2Disagree Disagree x 1 (list)

  38. Post #38
    Ruzza's Avatar
    December 2011
    1,137 Posts
    You'd pay for gmod updates?

    Don't give garry ideas.
    I would pay Garry to buy the licence, nothing else, I've already paid him $100+ in buying GMOD and account name changes etc.
    Reply With Quote Edit / Delete Reply Windows 7 Australia Show Events Funny Funny x 3Friendly Friendly x 1 (list)

  39. Post #39
    Map in a box's Avatar
    July 2009
    7,415 Posts
    I thought you could play modules with this
    Reply With Quote Edit / Delete Reply Windows XP Professional x64 United States Show Events Informative Informative x 1 (list)

  40. Post #40
    Grocel's Avatar
    October 2008
    1,249 Posts
    I thought you could play modules with this
    What? You thought you could play DLL modules with it? Or did you mean a sound format?
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Funny Funny x 1 (list)