How to Mix Sound & Background Music in Godot | Godot Sound Series

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in this Godot tutorial I'll teach you how to add background music to your game and we won't be adding a simple background track no will be fading in and out different tracks based on the state that the game is currently in whether the player is exploring or maybe being in combat let's get started now before we can add any music to our go dub game before it's gonna need some audio tracks right here I got two different tracks in two different formats wave and OGG and the difference between these formats is crucial for your goal of game wav format is basically a uncompressed audio file that your CPU can load almost effortlessly therefore it is very quick and it's ideal for a special effects which need to load fast and which might require a lot of them playing at the same time when a lot of combat or if something else is going on on-screen OGG format on the other hand is a compressed file so the CPU takes more time to load that up as it needs to unpack it first and that's great for background music because the background music of course is not changed and loading and unloading that often usually you play a track for a couple of minutes now you might wonder why them and just use wave all the time if it's so good and so fast and takes no CPU power well let's inspect these two files which are exactly the same music file of exactly the same length this is 40 megabytes and we're only talking two and a half minutes of music here now if we inspect the OGG file will see that this file is only three Magne bytes that's 13 times smaller so that's a huge difference and that will make a huge difference once you start exporting your game to for example an executable or an apk for Android you'll make sure that the download order told the size of your game is smaller now if two files you're not really gonna notice that but once you got 50 music tracks in there trust me that is quickly gonna add up to gigabytes so you want to use OGG files for your background music so we're gonna take these two OGG files and we're gonna put them in our game folder so this is my gotu project I'm gonna put them in assets and it's now if you download all your music you might only down the wave format but if you just Google for a wave to OTD converter on Google you'll very quickly find a converter online it will help you out for free to turn your WAV files into oh gee jeez I've actually done that with these speed 2 tracks myself now you also see that this has the looped name Mouse course is just a file name or what it means or why I've indicated that is that the end of the music track transitions very smoothly back to the beginning so that's of course perfect for background music that you want to play on and on without the player really noticing any change in the background music so once you want to implement background music into your game you want to look for loop video game music now as you can see I got a lot of music right here and I've got a lot of different things in here with piano and romantic feeling and new Newman it's 8-bit music it's rocket space it'sit's mystical it's scary all this music right here it's 8 gigabytes of music this is all available right now on a humble bundle deal if you're watching this before the 27th of May 2020 so if you want to get a massive discount on some great music from a single composer so everything matches very nicely make sure you check out a link down in the description below in the end of this video I'll get into little bit more details about the license and that kind of stuff so you make sure that you know what you're signing up for now let's add some music to our gold key now back in goad up I've opened up the sound folder in the file manager and here we got both of our fouls the first thing you want to do when you add any files to your gold project is you want to inspect them see if the settings are the way you want them to be so selecting one of these files and going over to the import tab right here we see that loop is on now by default I believe loop is on for OGG files but loop this by default off for the waveform app so if you want to loop wav formats make sure you turn that loop on that's always a good idea to check both of your files or multiple if you have multiple files loaded to make sure that all these settings all right else you'll be searching for bugs in code which are not even in the code itself it just didn't imported correctly if you change anything here make sure you hit that rien port buttons make sure those settings are actually saved now with that done we have to take a look at where do we want to add these sounds where do we want to play them and this might seem like a little of a mundane question was actually super important I've got the game loaded right here going to our scene and going to our remote scene we can see the notes that are currently loaded so currently we got the route of the game because our data imports are singleton at loads of all our data files from the Jason's we have added to the game and then we have our map scene that's this scene right here that you probably are familiar with if you watched any of my tutorials in the past so right now we could add maybe these sounds to the map scene the problem is if we were trying to transition away from the map scene or maybe if the game starts and we would have a main menu scene and then when the player that reflects a new game or load game we unload the game menu and we load the map scene that means that every time we destroy one of those nodes also the audio file our players on the audio stream players that we add to it are also destroyed that means if you want to transition nicely over from a game menu sound or main menu sound over to the map sound when the player has loaded the game you cannot transition or make that transition because the notes are being destroyed so ideally you want to add your foul music or your music files and your music players higher than the main menu higher than the map scene higher than any map that's loaded pretty much all the way up there so we have to account for that now there is a plug-in that do want to mention because I know some of you are gonna mention it in the comments there is a plug-in pergola called some manager I believe 2.0 is out now and 2.1 is about to come out the at the moment I'm recording this it sort of is a huge single turn that plays music at the same time so this is like a it's like a single turn on steroids and also load script on steroids will we also be adding our sound through single turn or we'll be coding it in a singleton but it's not absolutely necessary to have that plug-in to create nice transitioning sounds you can also just change the hierarchy of the game and that's what we're doing now because I want to make use of standard goal up in this tutorial and not force you to install any plugins so we need to have a level in between here and we either add our audio files and we need to add a single type that so let's started off by creating that extra hierarchy level in our our note structure of the game basically this is going to be the highest hierarchy so I don't even want to put in a scene I just want to put it straight into the project itself so I'm gonna go for a new scene I'll call that the game root how at a new note and that will simply be a normal note we don't need this to be anything else normally what I handle in the game rules everything ready to scene transitioning and sound that's sort of like what I do with this with this note we can start it off by adding our audio stream players to it and let's rename these immediately so this will be the background and I'm just gonna call this normal but we might want to call this differently in your specific situation and I'll add a second one and we'll rename this to background combat now I'm adding two because I want to mix between two sounds so I want to transition or fail one out and then I want to fake the other one in but this doesn't have a hard cut so usually I chose end transition overlapping with each other so that once the decibels of one are almost faded out the decibels of the other are already coming up that way you don't really have any sort of empty moments in your in your background music now for the background normal we're going to go to our assets and we'll add our secrets of the kingdom audio file to the stream by simply dragging it to it will do exactly 40 combat but then we'll take protection of the kingdom as that's more our combat how upbeat soundtrack we currently don't have to set anything that settings right here but we will need to set some settings once we start fading in and out mixer but we'll get back to this note at that point now finally I'll rename this node to game routes so is easy to recognize in the node tree I'll save that and of course we'll also need to make sure that once the game rule is not loaded that the map scene is loaded normally like I said you would do this through a game menu or a main menu and then with a new button or a low button and all the kind of stuff these are tutorials for the future not going to do it right now we'll just add the instance scene of map scene immediately to the game route so that that map scene is still loading whenever we play the game now all we got to do now is change the full scene that's loaded when we play the game from the map scene to the game route so we're going to go into the project into the project settings and under the application here the run tap we right now here have our map scene as in the main scene to load when the game is started up we're gonna change that and we'll navigate to our game route and we'll change that to game now with that done all we have to do now is add a singleton that where we can handle our actual code for the music so by doing we're gonna do that by going to our scenes I will simply add a new script to this change the name of the script to sound and not right now we have a sound script we are going to go to project project settings and under the auto load tap I'll now find that sound right here and I'll open this and I'll add this with the add button to the sound singleton it was already in there from a previous attempt so I guess I didn't delete it yet but that's how you would add that scene or that scene as a whole to load singleton so right now if we were to play the game I'm gonna go back to this remote tracker to see what is loaded will now see that we have our sound singleton load right now we have our game route which will have any sort of instance scene on top of it main menu a map scene anything else a city scene you name it anything in between call your main seeds and you see that our background normal in combat all the extreme players all right there and whenever we change this map scene I imagine this will be there the wastelands and you transition through a teleporter to the grass fields or whatever you could change these map scenes out but you would never lose your background combat a normal audio stream players and therefore you can continue the background music even though the scenes are being changed so that's the kind of behavior we're looking for and this is how you can set that up now that we've got this let's start with some really easy stuff let's just make sure our background normal track starts playing whenever we play the game all right I'm here on the sound single-turn where are we going to be programming the fading in and out and changing of music I've already added a couple of lines we'll go over them together and we'll add some extra lines and we'll do a first test the first thing we do when the game has finished loading we unready the we define two variables we are going to be defining that note references to d2 audio stream players that we've put in our game route so we're gonna get the parent of the singleton that is the main route of the game itself then we're gonna get the node game route and then background normal and background combat then we need the game state my coded game state you could call it music state or give it any name that you want that makes sense to you this is going to be what state the music should be in and that's of course important because we need to know what needs to happen but we also need to know when doesn't need to happen or more importantly when does it need to change when do we need to change the music and of course that means that whenever this variable changes from I know normal to combat or explore to combat as I'm going to be calling it we want that to be recognized in the code and then we want something to happen we won't music to change the perfect way to do that is to use setters and getters or in this case a setter so when we define the variable game state we use the command set get then we can define the function that is going to be setting the value and a function that is required to get the value now we don't need the getter in this case so we'll only define the setter function so the set game state is going to be a function that of course needs a variable as input so the new value needs to have input else we can't change anything right first thing we do is we change the game state into the new value so that's how we change it but the fact that it has changed also means that we can then run a function change to music now under changed the music what we'll do is we'll add a match command to it and that match command is gonna be matching the game state the state that was just changed right there before we ask this change music command to learn to run we're gonna match it to three different kinds of states that will be defining that it can be it the first one is new game and then we have explore and combat of course during the game you want explore and combat to constantly switch depending on whether the player is in combat yes or no but when the game of loads there's nothing to fade out because there's nothing to fade out it makes sense that on a new game we only start playing music and we don't stop playing any other tracks now to have the game load the new game music state or game state and they're ready function I call that function set game state and I give it the new game variable so then game state's gonna be new game change music's played it will match game state which much just changed a new game it will find new game will have a match and it will start getting that music normal and we'll use the function set playing on that audio stream player to true and then the track starts playing now of course we also need to define okay the the track is playing we are you have our normal playing so whenever we get into combat we need to change that so then we set the normal track to set playing false and we turn the combat track back on with true now of course this doesn't have anything in and out yet that's gonna be in an exporter of this tutorial but the first thing we have to do is recognize these states if these states are going well then we're ready to start doing some fancy stuff with the music so the question is how do we recognize that the player is in combat do we do that when he finds a projectile well in that case if there's if the player is just firing into to nothingness maybe just testing out a new spell you suddenly have combat music playing that's not what we want what we can't be pretty sure of is that whenever they get the player starts hitting an enemy the enemy starts firing back or whenever the player is in range of an enemy the enemy will start attacking and that's when combat starts so we can go over to the script of George George's are trustworthy enemy in this tutorial series or the many tutorial series that we've based on this project and he's been dying all the time so yeah we have to thank him for that George has a match statement right here this is his state machine yes four states he can be in his rest position rest state is a tech state it can be searching for the player and he can return to its spawn point after which you will go and rest again so whenever George starts attacking that's basically when he when he sees the player or when the player starts attacking him then we can say ok sound that's the signal to me cool and then we can set the game state now I can't call that function right here but I can't copy it away from here just to make sure we're not making any mistakes and we can set the game state on the sound Singleton and we'll add the combat call to it now the George skeleton or his body William that's taking the same script are gonna call the sound singleton I'm gonna change the game state fro to set game function that will call the change music function any common musical play but I would love for you to hear what would happen if I play now but and I will destroy your your eardrums the problem is that this function lives in the process so that function is going to be cold if George is in his attack state like sixty times a second or something like that now we've got two enemies so that's gonna be called 120 times a second so it means that the track starts playing a hundred and twenty song times a second over again so you're just gonna get this well i'm leavin' gonna try and attempt to reproduce that sound but that's not what we want we won't change music only to play if the game state is different than the previous game state so what we'll do is one function if not the game state is equal to the new value in that case we want this old to run and else you can just pass you have to do anything so what we do now is only in the new value that's being pushed into this function is different if is not the same so it's different than the game state then we want the game state change then we're gonna print that game state so we can verify in the output of the editor whether things are going well and only then we want to change the music so this way we have a method that we can call George and change some music right now I'm gonna put on my headphones now normally they'll do that in YouTube tutorial day that sound tutorial you guys have some headphones right so as you can hear we now have our background sound playing and I'm gonna be walking over to our skeletons and our combat sound starts playing now when I kill these colors we have the problem that our combat sound is gonna be continued playing reason being is that we never set that game state from the combat state back to the explore state where the combat music will be stopped playing and the normal music is start up again so we need a way to recognize whether the player is out of combat and that's a little bit more tricky than that made sound at first so let's get over that together let's code in and once we've got that when we're changing your music at the right moment then we can start working on our fades in and fades out right I'm here on the state machine of the enemy the same state machine we've just used to set the game state for the sound player to combat we're gonna use the same state machine to determine wonder we're out of combat but we cannot use that with a script on this particular enemy because it only requires one enemy for the player to be still in combat and we don't want another enemy to signal hey I am out of combat because we don't care whether the enemy is out of combat we only care whether the player is out of combat and it only requires one skeleton or one enemy to keep the player in combat so what we have to do is we have to check whether a selection of enemy is incumbent with the player we can verify that by saying if the enemy is harder in a tech state or search state then we know the enemy is still in combat or the players in combat too because who else is the skeleton going to be in combat with to do that we probably do not want to go and check every single enemy on the map I got a very small test map here for a tutorial series on on YouTube but you might have a very big map it could potentially have hundreds or even thousands of enemies if that's the case you don't want to check every single enemy you want to select a sample of enemies and check only that sample because else you're just wasting processor power on your device the way we do that is we're gonna go over to the player scene and on the player scene we'll add an area to deep that area to D we'll rename to combat checker and we'll add another child to it and that is going to be coalition shape for the coalition shape I'm gonna go with a circular shape and by clicking on it I can set the radius and I'm gonna set that to about 1500 we'll save it and now on the map scene you can see this is gonna be me circle so it's we're gonna find every single enemy that is in that circle and they're gonna check that array of enemies whether their state is either attack or search if one of those two is true then we know that we're still in combat we do that on the player script but before we can actually write the code you first have to set the area to the combat checker to only check for enemies if we're just gonna check everything is gonna return tables and chairs and wools and chests and the player itself and projectiles and then we're just populate this array just too far and you'll also run into errors because a projectile doesn't have the state that we're looking to be looking for so we have already in previous tutorial series have set the layer number three the collision Lane and I'm afraid to be only for the enemies that's only where the enemies are and nothing else so we can say that the on the coalition that actually we don't have to set the layer we only have to set the mask so the area 2d is gonna be looking into layer number three doesn't have to live on leave lave free number lair number three itself it only needs to be looking into it so now under this script we can paste the function that I've prepared for this so the function is going to be in combat check we're going to be calling this function from the sound singleton we're gonna set the in combat variable to false by the false by default we're gonna be assuming that we're out of combat then we're gonna retrieve the array of enemies that are overlapping with our area to D we use that to do that we're gonna get the note the combat checker and we're gonna use the function get overlapping bodies that's gonna return all the note references in an array the fact that it's an array means that we can now look over that array of enemies and for every enemy in enemies we're gonna check if the enemy state is equal to attack or if the enemy state is equal to search if there is true on even one skeleton one enemy then we know that in combat is true and the fact that we only need one enemy to be true to be in combat we don't have to check any of the other enemies anymore imagine that this array is filled with a thousand enemies an enemy number two has attack there has a state in attack then we don't need to check the other 998 skeletons anymore because we only need one skeleton to say we're still in combat so as soon as it finds one skeleton one enemy that has enemy state attack or search we're going to combat a true and we're gonna break out of this for loop thereby we're skipping over all the other ones we don't need to check them anymore we are in combat and we can save those resources for other calculations then we're gonna return in combat to the singletons sound that's going to be calling this function now that we have a way to check whether we're in common or not we can go back to the sound player and set it up over there to do that I'm gonna go over to the sound or the singleton script and whenever the player is in combat or the game state is combat that combat music is playing we want to be running check that that's going to be a function that will be defining underneath here what we do is we make a check and that check is not there going to be true or false we get that by calling the player and calling the in combat check function that we just created a second ago the player right here is a new line of code I've added which is a reference to the player scene so that's the note reference that we'll be calling so I'm calling the function on the player script and if check this is basically if you you don't have to say if check is true you can say if check when the boolean is true if check is a boolean and it's true this will be yes and if not check means a check is false so if check if we're true then we're gonna use the code for one second and then we're gonna call check on but again so it calls back on itself after one second so basically we're gonna be calling the player function to in combat check every second we're not going to do this based on Delta on every frame because that's exaggerated we don't want the sound to be exactly right on the milli second when thus curtains are killed then if the play the sound is turning down fading out that's a one-second that's perfectly fine for for some background music we don't need that to be more granular we don't need to waste more processor power on that if however check is false so that means we're no longer in combat then we're gonna yield for one second we knew that again because we don't want as soon as the enemy has died that the music just stops playing you know we wanted to slowly fade out and it fade out and start one second later so in the worst case scenario you've just killed the scout and after this function call and we'll start the fade out in 1.9 seconds in the worst case scenario or after one second in the quickest scenario if you want to change it if you feel like spending more resources on getting this more granular just change these these create timers and these and these views also create using use right here takes a little bit more process of power than having a timer on the notes that's just gonna be looking over and calling a function every one second that is a little bit more effective with the resources I didn't want to do this because this tutorial is already going quite long but if you want to optimize for performance that's a good alternative if however to continue if not check so if the in combat is false after waiting for one second we set the game state to explore that means that we call this function we set the game state we change the music and now match is going to find explore we're gonna turn up the combat music and we're gonna start the normal music now we can test this out I'm gonna put on my headphones again we got the music playing will quickly run over to these skeletons they're finding us now well hide so that they can search for us they'll stop searching for us they'll return to positions and our combat music is now gone now it looks it doesn't match right pick up but the fade-ins and fade-outs that will work it will return back to normal we'll check to see if we kill them and be Kilda skeletons you'll see let's we return back to our normal calm music now we can work on the fates in fades out that's pretty sure part I think and then we're done for today to fade in and out the sound of the music we're gonna be making use of tweens so I've added two tweens to the game root scene right here I've added them under the audio stream players I'm call them normal and calm between just like their parents are recognizable with normal in combat on the top of the sound Singleton I've added them as a variables and then note references so that we can access them easily now before we're actually gonna build some complicated tweens will first set up the rest of the project so that we'd start working immediately and we don't have to go left and ride all the time first thing you want to change that we don't want to set playing to false on this script anymore because we don't want the sound to stop abruptly we want the sound to stop when the tween is finished with fading the sound out so instead of quote the script or the match command calling the set playing to false functions we these functions to be pulled whenever the tween signals that is done tweeting out we do that by going to our normal tweet you're actually first our game root will add a script to it and then we go to our tweens and we'll say that between complete it will connect and we'll connect to the game root and we'll do exactly the same for the combat tween and on these two functions once you have them I'll paste over them the functions or the code that we need what we're gonna do is we're gonna check if the volume decibels is equal to minus 40 on the normal train for the normal tween completed signal and the background tween for the background color tween for the comment between completed signal this sound minus 40 is the decibel value that will be fading out to of course we're also gonna be fading in sound and that fading in sound is also going to have a tween completed signal but we don't want the sound to stop of course when the sound has been faded in because that's when the sound should be playing and not stopping so we check whether the tween has twins towards minus 40 decibel then we know it's a tween fade out and then we know that we can set playing to false now there's also means that this permit is minus 40 that we want these backgrounds combat a normal these audio stream players that we want them to start at minus 40 decibel as you can see when I go to these audio stream players deploy in decibel normally sets to zero zero is basically normal amount of sound it looks a little bit like unintuitive to me like the zero decibel sounds like very little right silence but this is actually sort of like normal sound you can go up to I believe plus 24 but if you want to fade out you can go all the way to - 80 - 80 is like absolutely that zero but you can't really hear anything from minus 40 decibels anyway and because we're tweening if we're tweening also from minus 40 to minus 80 there's a big gap or space there that you can't hear any but it does take time so we have more control over the fade in and fade out if we only tween 2-14 and the stream stops playing anyway the moment it reaches minus 40 so it's off anyway so we don't have to worry about that a little bit of sound that would be left at minus 40 instead of minus 80 so now that we have set both of these stream layers to start at minus 40 by default we now have our volumes checking if we tweening back to minus 40 and then we turning them up so with this done we can go back to the sound player and we can remove these two lines from the script now that we got that we can start building some of these tweens and then we'll be done with this tutorial so for these tweens it might look very impressive all these lines of code was actually quite easy and there's a lot of repetition in here let's go over together and then probably I'll be giving some tips left to right on what you might want to change because some things aren't done for the YouTube tutorial and you know it's also a lot of personal choice and in here so let's go over together what we do we start with go to the new game state that's going to be set on there ready so the new games match is found first thing we do is we start playing that background music and that's of course now going to start playing at minus 40 decibel so it's almost unhearable then we're gonna interpolate the property by calling the music normal tween we interpolate the background music normal note the property that we are going to be interpolating on that note is the volume DB we're going to be interpolating that from the background normal volume DB current level so it's minus 40 that we have set it to by default and we're going to be tweeting it to minus 10 I'm not tweeting it all the way up to 0 because this is background music in fact there's -10 it's probably still a little bit too loud for your game I'm tweeting it to minus 10 so that you can hear it well on this YouTube tutorial but maybe a value of minus 14 minus 13 is probably better fitting for background music also dependent on the sound intensity of the track itself we're going to be doing that in three seconds and I'm gonna be making use with transport ease out now what's that there's a cheat sheet I've talked about it before the transport ease out is this one so it's gonna ramp up quickly with the volume so it quickly brings it into a volume that we can hear with our human ears and it's gonna slowly ramp up the last part when it's fading in so that's the specific effect that I thought would sound good okay then we're gonna start that tween and we have sound we have background music now then of course at some point we get into combat now what you see for both explore and combat is that we're stopping all the current tweens what could happen is that no the player is running away from away from some enemies so it's in it's in combat it hides behind a corner enemies can't find him and just when the enemies start walking away the combat sound is fading away the background calm sound is fading in it picks around the corner and the skeletons immediately go in there attacks that again what you want to have happened is that not all the tweens that are still playing at that moment that they continue playing you just want to stop all of them the reason being is else you're gonna get some weird art effects sound art effects and you might even then end up with the wrong track playing at that specific time so that's kind of important just stop all current winds that are ongoing if the player is manages somehow to have the code switch between different music tracks in a very short timeframe then what we do we first have to fete the coal music out engage of combat so we're gonna take the normal tween we interpolate the property of background music normal we take the volume DB we can take the normal volume to be the current reference so if in that case a special case that the player is able to switch the background music in several cases if the previous tween has only tween it up to let's say minus 20 from minus 4 to minus 20 and then the player initiated combat again somehow you don't want it to start at a hard-coded -10 like I would have done there or maybe - fortunate you would have chosen because then you suddenly get a spike in your volume of your background and then a fade-out that sounds very weird so you always want to reference the current volume they'll decibels and you see that that I do that everywhere for every single tween it's kind of important to get a good feel of the background music and we tween it down to minus 40 remember that minus 40 is important because on any game route script when the tween is completed is checks if the void maybe is minus 40 to recognize when it needs to turn off the sound so you want to tween down specifically to minus 40 now we're gonna do this in a half a second in this case because when the player gets in combat we want the Komet music that coming quite quickly because it would look weird if the combat music is finally there when these skeletons or the enemies are already dead so is these to go with quite quickly and we can use a transport that parabolic function then we start a tween up we set the background combat music to playing and we pretty much do exactly the same for the combat music we go from minus 40 that it's set to by default and we bring it to minus five you see I use a little bit higher volume for the combat sounds as that's more intensive and you can give that a little bit of extra intensiveness by making a little bit louder but again this minus point is chosen for this youtube tutorial minus 10 minus 9 might be a better value for a real game also dependent on your volume intensity of the recording of your soundtrack here I use it translinear and I do it on purpose because as you can see I have no delay here so the volume of the comic music is gonna be fading in at the same time that the music of the normal track the calm track is fading out so you have to let us see this let me do this correctly yeah this one so you have to combat volume fading in linear and you have the call music fading out transport early so you do have a dip in the sound intensity but they will be overlapping for a part as well and that's mixing of music fading on in over the other and that's the reason why we use to combat stream players at the same time or the don't have one note here and simply switch out the audio track because with one audio track it's hard to mix anything so when we got that done we of course after doing the check combat and at some point the game states explore again then we run the explore function pretty much exactly the same we're gonna be fading out the combat music we're gonna do that in four seconds so it's gonna be you know comet is done and slowly we fade out that music so you see a half a second versus four seconds quite a big difference and we bring back that normal music anyway for this one we're gonna be waiting for one second before it starts this is a linear function is a transport function but you can see also here we have an overlap between the two and we do create a musical dip but that musical dip is a little bit smaller than the musical dip that happens here and we want that because we want the player to be alarmed that comment is happening is play your feedback music is player feedback don't never ever forget that so with a bigger dip in the total music intensity that player is more aware of a change happening in the environment here the music the total music decibels is it's less has a smaller dip but that's okay because you know it's combat is winding down and we slowly go back into a normal game state and also in difference here we fade back to minus ten decibels right here where we're fading to minus five decibels so it also means that we can we come from further away let's put it like that now I'll play the game and you can hear it but just before we do that I want to emphasize that this is first of all personal second of all it depends on your music track second of all thirdly I'm already free you might also have all kinds of different situations where you might even want to put different wings when you go from a game menu like a main menu to the loading the scene them that might even look very differently when play uses a teleporter it goes from one explore site to another explore site that might look differently of course also with all these screens and timers this one time second use right here is of course also part of the of the whole music fading in and out in the mixing so there's a lot of personal preference in this code but I think by fiddling around the values yourself fiddling around with a type of transport and translinear and other type of transitions that you can have you can get exactly the right feel and you know this is sort of like a script you can use to get started now without further ado let's play the sound let's play it again let me put on my headphones alright let's let's redo it I have my headphones on then isn't work so you can hear music is slowly fading in let's find ourselves a skeleton what is enough for now I'm gonna be hiding behind this wall and we're gonna be checking out whether that music is able to handle peeking behind the wall when he walks back so comic music is going away but if I show myself it very quickly comes back in so to call music was about to come in but then I'm peeking behind the wall and suddenly like we're getting the Komet music back now we kill him of course I'm music fades out coal music comes back very slowly there we are the comic music is really coming is strong to indicate as a change in the environment the environments aggressive and fades out slowly so that's it that's how mixing works like I said I will talk a little bit about that the game music bundle 8 gigabytes of game music with the same quality mic like this one with a lot of loops in there so it's great for background music for any kind of game you might new inking so stick around to hear a little bit about the license how that works and then our I'll leave you to it now for the license it comes with a pretty sweet license if I may say so myself the license grants the buyer Normand exclusive obviously and non-transferable obviously a lifetime worldwide rights to use the music assets in multimedia projects for all my videos why he use it in this tutorial as well websites animations games and films so that's pretty good that means that however long and wherever you might move in the future you can use this music in any of your projects that are both personal and commercial so you don't have to worry about royalties or copyright strikes or anything like that in the future if you've got this license you're good to go with this music assets now of course you can't claim the music as yourself obviously you can't register and sell the music on any store platform which is kind of obvious you can't read distribute or sublicense the music other than it's part of a relevant project so this basically means that if your buddy says like hey this is cool sound of music track and you send it over to me that's a big no-no you can't do that well I think that's kind of logic and you you I'll be surprised to find a license with that would not be the case and also means you can't risk distributor or sub license the music unless it's part of a relevant project so if it's a game you make and you implement this music track in your game and you make for example a subscription-based MMORPG or something like that then the asset has become part of a relevant project and then of course you are allowed to sublicense redistribute as a subscription fee or anything like that so that's a pretty good license lifetime worldwide for commercial projects you're good to go now what can you expect what you can expect a lot not going to listen to every single track here with you but this goes like the songs I just played their part of the fantasy adventure game music pack as you can see because some heavy themes here we have protection of the kingdom you can see you got a looped version and a normal version you see you got a lot of loops in here you also got pretty quiet themes we use the secrets of the kingdom so you can see you also have like free other tracks you could put a randomizer in your code you could randomize and randomly pick one of these tracks add them to that audio stream player you can even have various audio tracks play in the background well it's more in here or this is the fantasy adventure pack for example you also got the cosmos music pack one I like I think it is space discoveries that I really like it really puts you in it sort of like the cosmos sort of atmosphere where are in space some sort of a space game or in a spaceship or something like that that doesn't sound spacing to you right on what does but I mean this this music goes all the way back even into the 8-bit era so if you're playing on something like I know some retro ain't big a two-bit game even playing on your version Mario you know there's nice an awesome game music and again this is good music and also those cosmic music they also cut the loops with it as you can see if I extend this a little bit all these cosmos loops tracks also loopable and that's pretty much the case for a lot of this stuff here you got even for the epic battle trailers they can play one but you got even dilute and you've got no drums so if you want the track without drums he included those as well there we got a quick look at one of these as well obviously an Apple sort of scene so you can also use this for combat see just like to use combat protection of the Kingdom track just a moment ago so like I said maybe I'm rambling too too much too far if you like this music check the link down in the description below for this humble bundle deal you can get all of this musically for as low as like I think I've been in the EU I think I paid 23 euro or something like that for the entire pack so check the link down below lifetime worldwide use commercial projects eight gigabytes I think it's a steal that was it for today guys hope you liked it if you did smash that like button hit subscribe don't forget that little bell I can to make sure that you don't miss out on a next tutorial now I do want to continue this audio series probably going to do some special effects tutorial as well how you can implement that I'm also looking at shader tutorials and lighting lightening tutorials so we got a lot of new stuff coming up on the channel soon if you want to hang out chat I may watch my own game development they do on my personal project saw whisper i livestream my own game development every Tuesday and Thursday we usually get a couple of dozen go to gain those in the chats if you want to meet some other game does have a group to hang out with you can join me on Twitch every Tuesday and Thursday evening link and schedule down descriptions below there's also a link to the discord server down below got about a hundred game devs on there right now helping each other out whenever they run into a buck or an error or something like an artifact that they can't fix themselves so I hope to see you in any of these platforms so or another tutorial in the future and until then keep on gaming keep on coding see you later guys
Info
Channel: Game Development Center
Views: 4,210
Rating: undefined out of 5
Keywords: Godot Sound, Godot music, Godot background music, Godot play music, Godot mix music, Godot mix sound, Godot sound mixer, Godot mix background music, Godot fade music, Godot tween music, Godot combat music, Godot, Godot Tutorial, Godot beginner tutorial, Godot 2d tutorial
Id: 6VZnabKdlQ8
Channel Id: undefined
Length: 46min 26sec (2786 seconds)
Published: Sat May 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.