• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Asset - Scripts Firehammer Audio - Quality sound without the hassle(now free but NOT discontinued)

kburkhart84

Firehammer Games
Welcome to Firehammer Audio. This system can make a developer's life much easier as far as sound control. It has various systems to do things you would normally have to write code for, all while using native vanilla GML for maximum compatibility. This first release has all the below features, and is ready to go for your next project, or even your current one if you are willing to do the conversion.
  • Music system​
    • Plays and tracks music
    • Crossfades between music tracks
    • Swapfades between like(but different music tracks)
    • Can automatically remember what point of the track the music is on when you pause or switch tracks, and will automatically start the music there(unless you tell it not to).
    • Can also remember which music was the last one you were playing and can begin playing that one again without you specifying it
  • Sound system
    • Automation of volume and pitch variance when you play a sound
    • Automation of choosing different actual sound effects for a single sound(in combination with pitch and volume variance), including 3 different behaviors for choosing which sound to play
    • Easy usage of the mentioned sound systems for 3d sounds
    • Automatic instance tracking for both the listener and 3d sound emitters(both position and velocity)
    • Can make sounds fade out over time instead of stopping mid-loop, useful to avoid clipping noise that happen with instant stops not at full-zero of the sound wave
  • Volume system
    • Expansive volume control, starting with global Master Volume, down to Music Volume, and then Sound Category Volume
    • Automatically adjusts music and sounds that are playing(as long as they are looping) when you adjust volumes.
    • Automatic saving of all volume settings into a file, which is then loaded the next time the game is ran, if you choose to leave the setting on.
  • Category system
    • Which groups like sounds that can be controlled as a group, including setting volume and pausing all looping sounds within a category(and resuming them).
  • Basic settings are accessible via single script with #macros.
  • Extensive Debug Mode(enabled by default) which gives nice messages if you make a mistake calling the system's functions so you know exactly what happened. This can be turned off and the GML compiler will compile out all of those safety checks for performance.
  • Easy identification of which arguments to a function are optional, using an underscore before the names.
  • ZERO syntax errors as shipped. I applied workarounds/tricks to reference optional arguments to functions so that you never get unused argument errors, and I make sure to reference all functions and macros that aren't already referenced from within the system so you don't get syntax errors for unused functions/macros, even if you delete the examples.
  • Uses a double underscore prefix to all internal functions and objects so that only what you need to use shows up in the code editor's auto-complete window.
  • Uses "fhAudio" as a prefix for all functions that you will ever need to call so they can easily be found and filtered in the auto-complete window
  • Three examples that show the basics of what the system handles for you


Thanks in advance to everybody for taking a look. Here is to getting better audio in all your projects!!!

You can also get on my discord (https://discord.gg/6VrZkP2) if you would like to more directly discuss anything with this system(or my input system).
 
Last edited:

kburkhart84

Firehammer Games
I have decided to get out of the middleware game and start doing more of what I love, actually making games. I haven't been able to stay motivated on middleware because it has gotten boring to be honest. To this end, I have made this system completely free, both on itch and the yoyo marketplace. I thank everybody who has supported me. I would consider offering refunds to people who recently purchased, but there actually haven't been any recent purchases, and the last ones I gave for free in the recent game jam.

I hereby give permission to use these assets freely, commercially, including repackaging and reselling with updates. I would appreciate it be known that I did the original work, but I'm not opposed if someone creates and sells the system as their own. In other words, it is open source, CC0 license, public domain, whatever you feel like :)

Of course, I'll still be hanging out here. This community has been great over the years and I'm not leaving it even if I eventually stop using Gamemaker completely. It's been fun, and this is certainly not goodbye.
 
Last edited:

kburkhart84

Firehammer Games
So, I've been hanging around much longer using Gamemaker much longer than I thought. So, I WILL be eventually updating this sound system. I will NOT be changing the license of course, it will still be free for all to use as they wish.

I have a couple features planned for it, though they won't be happening right away.

1. I'm going to add loop points. This will apply to music tracks, and you will be able to define the point where the intro ends and the song itself ends. The system will automatically return to the start of the song(which is the end of the intro) when it is time to loop. Then, when you play something else and come back to play this one, you will be able to start at the intro, the beginning of the song, or wherever it had left off(like it does now). The catch to this is that Gamemaker doesn't natively support this, so it is going to require a bit of a hack. It will work fine and sound like it should, but it will require you to add a few seconds of the beginning of the song to the end of it. The reason is that audio plays in another thread, so I can't make the loop happen directly, so instead what will happen is once the song is at the end in that little "buffer" the system will directly move the correct position back at the beginning. The result should be seamless looping without the defined intro section.

2. I'm considering adding a GUI thing for configuring sounds, where you could test how they work, and save them for easy access in game. This would work easier than having to use functions to define sounds before you use them, but I'd likely keep the coded way in there as well since some people may prefer that.

If there is any other features you guys can think of that makes sense for the system, feel free to let me know and I'll consider it.
 

Evanski

Raccoon Lord
Forum Staff
Moderator
Highly recommend giving this a shot
Made most of my issues with audio in games vanish
It takes care of all the hard work for you, all you need to do is set it up and give it the sound files
 

kburkhart84

Firehammer Games
Version 1.1 of Firehammer Audio is now live on both itch.io and the marketplace

There is a breaking change between 1.0 and 1.1. Instead of creating the sound effects and storing the return from that function, you now send fhAudioSoundCreate() a string that will then be used to reference that sound effect. This allows you to better control where and how you reference the sounds. I personally recommend making a list of #macros for the strings and using that as it let's the IDE autocomplete work perfectly, and would continue working even when the new "feather" feature that is in beta comes out.

Besides the above change, I also added two features.

One is a music loop points feature, which allows your music to have an intro and then have the main loop in the same music track. You tell the system at exactly what points in time the main loop starts and ends, and from then on it will automatically handle that for you. The caveat is that GMS2 doesn't currently support loop points out of the box. Since audio happens on a separate thread, I had to make a workaround which means you need to add a couple seconds from the beginning of the loop to the end of the music track. This adds a little buffer in case the sound can't go back in time right away. It is working perfectly as you will see in the example. This is the same exact technique that Pixelated Pope explains in this youtube video, so you can certainly reference that to see a better explanation.

The other added feature is a thing that will automatically play the music you set up beforehand as you change rooms. If you set it up while initializing the game, you no longer have to switch music as you switch rooms. It will also cross-fade the tracks based on the setting, and you can force it to start at the beginning of the track each time or let it remember where it was(which is the default behavior for music in general). This feature DOES work well with the loop point feature as well.

So go grab the update. Feel free to give me some feedback on what else you think the system needs and if you find any bugs.
 
Last edited:

kburkhart84

Firehammer Games
So they recently announced that much better audio is coming, including many of the features that Firehammer Audio is handling, and even FMOD support. I have a feeling they are going to completely make obsolete Firehammer Audio. I have no regrets though, as this is always the risk you run when making code assets that fill in missing engine features. Firehammer Input may be in the same boat, but they haven't elaborated on the features of theirs for me to be sure, but for audio, they gave enough of a rundown that I get that feeling.

I feel that the system is in a good place right now. I don't know of any bugs and it has the features I really wanted. So I've decided to not add any features or anything until I see for sure what the new audio features of GM are. Then, I can see if something is still going to be missing or if they completely make Firehammer Audio obsolete. That's when I'll decide what to do next with the system. If somebody finds a bad bug I can certainly fix it, but I don't plan on doing anything else with it for a while(except use it in my current project that is :) ).
 
I hope they release something similar to my user controls so I don't have to keep working on it. lol.

Well, that's bitter-sweet that your design is essentially being implemented by Yoyo anyway. Hopefully they'll take stock of Firehammer's capabilities!
 

kburkhart84

Firehammer Games
I hope they release something similar to my user controls so I don't have to keep working on it. lol.

Well, that's bitter-sweet that your design is essentially being implemented by Yoyo anyway. Hopefully they'll take stock of Firehammer's capabilities!
It looks like their GUI system is going to have some things like yours but I doubt it is going to cover everything yours does. Yours seems more geared to GUI applications, while I think theirs is going to be more game oriented(which makes sense).

And yeah, I figured the day would come when the do some kind of input system. I've had mine for several years though in some form or other so it isn't like it is a recent time investment like your GUI system.
 

kburkhart84

Firehammer Games
I have now released version 1.3 of Firehammer Audio. It is available on the itch.io link in the first post. I'm also not sure how this post never got version 1.2s update notes so I'll put those below as well.

1.3 Third Update
· Support for Gamemaker Audio Effects
o Both music and each audio category come with an audio emitter which is useable for adding a bus for audio effects
o Unlike Gamemaker's internal system you won't have to create your own emitters anymore justto use audio effects that don't affect all sounds at once
o Added functions to get the reference to the audio emitter for music, 2d sound(each category), and 3d audio emitters. These references are then used for Gamemaker's audio effects functions for adding audio buses to emitters.


1.2 Second Update
· Fixes for Feather
o Added proper function definitions for all user functions
o Added ignore directives where they made sense(mostly for ignoring name rule issues, camelCase vs snake_case, and the like)
o The system has ZERO feather messages out of the box, no errors, warnings, or even suggestions
o I have removed the whole IDE optimization topic and associated code as with Feather and ignore directives it is no longer needed.
· Renamed Sound definitions to "fhfx" so it is clear what is a definition of a sound vs an actual sound
o Renamed "track" to sound accordingly since I no longer use "sound" to refer to the pre configured fhfx
· Turned the example suite into a single room(much nicer on the IDE's room order dialog)
· Switched to Gamemaker's loop point functionality instead of my hacky workaround for the same
o This uses seconds instead of milliseconds now to align with Gamemaker's functions
o This also means you no longer have to author your music in any special way(with the old workaround you had to add a sliver of the loop beginning to the end of the track).
· Added a #macro which when enabled makes emitters destroy themselves automatically if they are following an instance and that instance is destroyed
· Various internal optimizations and bug fixes
 
Is it possible to chain sounds together so that they play one after another? So if I, for example, provide a list of sounds it will play through them in order one after the other?
[edit] I posted here first before I remembered your discord server so I've asked there as well as it's probably a better place for it.
 

kburkhart84

Firehammer Games
Is it possible to chain sounds together so that they play one after another? So if I, for example, provide a list of sounds it will play through them in order one after the other?
[edit] I posted here first before I remembered your discord server so I've asked there as well as it's probably a better place for it.
I replied on the Discord as well but I'll put it here as well for others. At this time the feature is on the TODO list but not yet implemented.

For anybody who sees this, I'm sure the answer is both, but I have two ideas on the chaining audio. One is to define a FHFX that is literally defined as the chain of audio, as in it is just one effect according to the user and the system handles chaining. The other is to define a chain as separate from the FHFX audios, as being a sequence of those, which means it could have the variations as part of it(making it more complicated). So you have two sounds that are a different variety of footstep, which normally make up an FHFX(that randomly plays one of the two), and then another one for a foot scrape or something with two sounds, then it would technically create 4 random sequences in a single chain.

The first idea is nice because you just define the single FHFX and play it like the rest, but the second is nice because of the extra variety, etc...but it requires setting up the FHFXs first, and then adding another "thing" that is the chain of FHFXs.
 
Top