<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>luminance &#187; audio</title>
	<atom:link href="http://www.luminance.org/tag/audio/feed" rel="self" type="application/rss+xml" />
	<link>http://www.luminance.org/blog</link>
	<description>Programming and Game Development - Kevin Gadd&#039;s Blog</description>
	<lastBuildDate>Sun, 02 Oct 2011 00:15:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Home stretch</title>
		<link>http://www.luminance.org/blog/gruedorf/2009/07/30/home-stretch</link>
		<comments>http://www.luminance.org/blog/gruedorf/2009/07/30/home-stretch#comments</comments>
		<pubDate>Fri, 31 Jul 2009 06:21:50 +0000</pubDate>
		<dc:creator>Kael</dc:creator>
				<category><![CDATA[Gruedorf]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[xna]]></category>

		<guid isPermaLink="false">http://www.luminance.org/?p=645</guid>
		<description><![CDATA[In the next two weeks I have deadlines for two different contests coming up, so things are getting pretty hectic. Lots of things changed in the ~100 or so commits since the last blog post, so I&#8217;ll pick a few to describe. Combo System &#38; Attack Chains Instance Limiting Overhaul Active Controller Detection Combo System [...]]]></description>
			<content:encoded><![CDATA[<p>In the next two weeks I have deadlines for two different contests coming up, so things are getting pretty hectic. Lots of things changed in the ~100 or so commits since the last blog post, so I&#8217;ll pick a few to describe.</p>
<ul>
<li><a href="http://www.luminance.org/gruedorf/2009/07/30/home-stretch#section1">Combo System &amp; Attack Chains</a></li>
<li><a href="http://www.luminance.org/gruedorf/2009/07/30/home-stretch#section2">Instance Limiting Overhaul</a></li>
<li><a href="http://www.luminance.org/gruedorf/2009/07/30/home-stretch#section3">Active Controller Detection</a></li>
</ul>
<div class="video"><object width="720" height="430" style="width:720px;"><param name="movie" value="http://www.youtube-nocookie.com/v/8UJ6-5EHRsw&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/8UJ6-5EHRsw&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="720" height="430" style="width:720px;"></embed></object></div>
<p><span id="more-645"></span></p>
<p><a name="section1"></a><br />
<h2>Combo System &amp; Attack Chains</h2>
<p>Previously, combat basically consisted of hitting the punch button over and over to kill monsters. This sucked.</p>
<p>I took a few major steps to address this:</p>
<p>First, I added a second attack type bound to the button I was previously going to use for the grappling hook. This attack is slower and hits heavier, with a wider attack arc, and gives you a nice alternative to the fast, lighter-hitting punch attack.</p>
<p>After the addition of the second attack type, I built on that to add &#8216;combo&#8217; variations of each attack (punch combo, slash combo). The player can combo these attacks onto a previous attack by properly timing another button press near the end of the previous attack animation. Missing the timing (either by pressing too early or too late) &#8216;botches&#8217; the combo and causes the delay before they can perform another attack to be longer than it would be otherwise. The size of the time window in which you can successfully combo an attack decreases every time you combo, so over time it gets harder. This means that simply attacking once will be slow and inefficient, but you are also prevented from comboing attacks indefinitely, which strikes a good balance. The fact that a failed combo has a longer delay than a normal attack means that a player won&#8217;t be punished for choosing to simply combo once or twice and then attack again, since the effectiveness ends up being nearly the same.</p>
<p>Finally, I added a &#8216;attack chain&#8217; system that tracks the number of hits you land on a foe in rapid succession. This allows me to delay the &#8216;flinching&#8217; animation normally played when a creature recieves damage, so that the creature stays within reach of your attacks, allowing you to combo. Each successive hit extends the chain for a short period of time, allowing you to continue landing blows, and when the chain &#8216;breaks&#8217;, all the hits you landed deal their damage to the creature at once, knocking it back and possibly killing it. Chains can span across multiple creatures as well, allowing you to keep multiple enemies &#8216;locked&#8217; by your chain at once. Right now it&#8217;s a bit overpowered, but I think some careful tuning will maintain most of the positive aspects without making the game too easy.</p>
<p><a name="section2"></a><br />
<h2>Instance Limiting Overhaul</h2>
<p>Recently, while working on audio improvements, Troupe ran across a bug in XACT. PC builds of the game ran perfectly without any significant CPU usage problems, and the audio sounded great &#8211; but on the 360, as soon as enough channels of audio started playing, the game&#8217;s framerate tanked to around 15FPS and stayed there indefinitely. This was despite the fact that the game already issues most of its audio calls on a background thread to work around the prohibitively high cost of XACT&#8217;s API calls.</p>
<p>The problem turned out to be that despite the fact I was using XACT&#8217;s built in instance limiting support to control the number of instances playing at once, XACT was struggling to handle the number of cues I was asking it to start at once. Essentially, I was starting all the ambient loop cues for my level at once &#8211; around 30 &#8211; and expecting it to pick the 8 loudest ones to play at any given time based on the instance limit. On PC this worked perfectly without any performance issues, but for whatever reason, not so on the 360.</p>
<p>As a result I basically tore out all the existing code that relied on XACT instance limiting, and reimplemented limiting inside my engine. Luckily this only required changes to about 500 lines of code, but it was still rather frustrating to have to reimplement it when it worked perfectly on PC. On the bright side, now I have more control over how instance limiting behaves, so I at least got something out of it.</p>
<p><a name="section3"></a><br />
<h2>Active Controller Detection</h2>
<p>While doing some testing on my 360 I realized that my approach to handling the 360 controller was incorrect. While I assumed that the player might want to play with any of their four connected controllers, I neglected to notice that most of the XNA Guide APIs (storage device selection, etc) are designed to only respond to input from a single controller. This meant that I needed to detect which controller the player was currently using and make sure to only show XNA dialog boxes using that controller, and that I also needed to detect if that controller became unplugged so that I wouldn&#8217;t attempt to show a dialog box the player was unable to close.</p>
<p>I ended up spending a while changing my input framework so that it would automatically detect disconnected controllers, and inform the game code when a controller had been reconnected. I also did some work to automatically track the active controller, while still handling keyboard input correctly on the PC.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luminance.org/blog/gruedorf/2009/07/30/home-stretch/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Event-driven audio</title>
		<link>http://www.luminance.org/blog/gruedorf/2009/07/24/event-driven-audio</link>
		<comments>http://www.luminance.org/blog/gruedorf/2009/07/24/event-driven-audio#comments</comments>
		<pubDate>Fri, 24 Jul 2009 19:49:39 +0000</pubDate>
		<dc:creator>Kael</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Gruedorf]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[content pipeline]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[xact]]></category>
		<category><![CDATA[xna]]></category>

		<guid isPermaLink="false">http://www.luminance.org/?p=625</guid>
		<description><![CDATA[One of the older items on my to-do list was to give my sound designer a way to change the game&#8217;s audio without having to recompile the game in Visual Studio and start it up. Based on some of the improvements I made recently, I was finally able to knock that item off my to-do [...]]]></description>
			<content:encoded><![CDATA[<p>One of the older items on my to-do list was to give my sound designer a way to change the game&#8217;s audio without having to recompile the game in Visual Studio and start it up. Based on some of the improvements I made recently, I was finally able to knock that item off my to-do list.</p>
<p>Below, you can see a short annotated video walkthrough where I demonstrate the technique and show how it integrates with XACT.</p>
<div class="video"><object width="720" height="480" data="http://www.youtube-nocookie.com/v/faHdvcz45lU&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;hd=1;hq=1" type="application/x-shockwave-flash" style="width: 720px"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube-nocookie.com/v/faHdvcz45lU&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;hd=1;hq=1" /><param name="allowfullscreen" value="true" /></object></div>
<hr />
<p>There are a few key pieces necessary for this to work.</p>
<p><span id="more-625"></span></p>
<p>First, I need a way to get updated audio into the game. It turns out this is pretty simple &#8211; if you change the settings in your XACT project, you can get it to build output files into a folder of your choice. At that point, all you need to do is change your game&#8217;s XACT code to be able to load from that location.</p>
<p>Second, I need a way to pull information out of the XACT datafiles that I can use to attach cues to events. Since the XACT API provided by the XNA Framework is basically useless for this purpose, I ended up solving this problem by loading up the raw datafiles and pulling the names of my cues out of the datafiles. Yes, it&#8217;s disgusting. But it works! Luckily, the cue names are right at the end of the data files, and they&#8217;re null-terminated, so it&#8217;s not difficult to read them. It&#8217;s beyond my understanding why the framework developers opted not to provide the information.</p>
<p>Third, I needed a way to broadcast events from objects in my game world. The solution I ended up building for this was essentially an improved version of the event framework that I previously used for handling input events, like button presses. The framework allows me to &#8216;subscribe&#8217; to various types of events, either for a specific object, or for all objects that can broadcast that event. The ability to subscribe to all objects inexpensively gives me a straightforward way to say things like &#8216;whenever any creature gets hit by a rocket, play an explosion sound&#8217;, which is important.</p>
<p>Fourth, I needed a way to expose event information in an understandable manner, so that it would be easy to figure out what events are occurring in-game and how to attach sounds to them. I solved this by creating a simple &#8216;event overlay&#8217; that shows a list of the most recently fired events, and highlights objects when they broadcast events. This allows you to simply play the game with the overlay open and look for things that are missing sound effects &#8211; once you find something, just look at the log to find out the name of the event.</p>
<hr />
<p>If you&#8217;re interested, you can check out the source code and automated tests for the event system <a href="http://code.google.com/p/fracture/source/browse/trunk/Squared/Util/EventBus.cs">here, on Google Code</a>. In the future I will be releasing the rest of my audio framework as open-source for people to use. Please don&#8217;t hesitate to leave a comment if you have any questions; I&#8217;d be glad to help explain more about how this technique works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luminance.org/blog/gruedorf/2009/07/24/event-driven-audio/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Dynamic Music with XACT</title>
		<link>http://www.luminance.org/blog/code/2009/07/23/simple-dynamic-music-with-xact</link>
		<comments>http://www.luminance.org/blog/code/2009/07/23/simple-dynamic-music-with-xact#comments</comments>
		<pubDate>Thu, 23 Jul 2009 08:16:26 +0000</pubDate>
		<dc:creator>Kael</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[xact]]></category>
		<category><![CDATA[xna]]></category>

		<guid isPermaLink="false">http://www.luminance.org/?p=604</guid>
		<description><![CDATA[Good music adds a lot to a game, but only if it fits the action occurring on screen. Badly chosen music that doesn&#8217;t match the feel of your game, or is inappropriate for the tone of the gameplay, won&#8217;t do you much good. Dynamic music is one way to help make sure your music is [...]]]></description>
			<content:encoded><![CDATA[<p>Good music adds a lot to a game, but only if it fits the action occurring on screen. Badly chosen music that doesn&#8217;t match the feel of your game, or is inappropriate for the tone of the gameplay, won&#8217;t do you much good. Dynamic music is one way to help make sure your music is always a good fit for the action occurring on-screen &#8211; it lets you adapt the music the player is hearing based on what&#8217;s happening.</p>
<p>There are various approaches for building dynamic music &#8211; some games go so far as to create hundreds of short music &#8216;snippets&#8217; and string them together to create longer, more dynamic songs that never sound the same to the player once. Unfortunately, this is pretty complicated to do, especially if you&#8217;re just working with XNA and XACT. Luckily, there are some simpler techniques you can use to build dynamic music.</p>
<p>Below, you can see a short video clip showing one of my experiments with dynamic music. I&#8217;ll explain how it works in this post, so you can apply the technique to your games. In this video clip, I have two music tracks playing, and control the volume of one of them depending on whether or not the player character is within the blue rectangle. You can hear the track fading in and out as he moves.</p>
<p></p>
<div class="video"><object width="640" height="385" data="http://www.youtube-nocookie.com/v/7RUG7tDMUL8&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;hd=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube-nocookie.com/v/7RUG7tDMUL8&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;hd=1" /><param name="allowfullscreen" value="true" /></object></div>
<p><center><i>(The track used in this example is &#8216;<a href="http://ftp.df.lth.se/pub/scene.org/music/groups/mephtik/mephtik_2/skyline-corn_fields.it">Corn Fields</a>&#8216; by <a href="http://www.traxinspace.com/profile/skyline">Skyline</a>.)</i></center></p>
<p></p>
<p>The  approach I&#8217;m using works like this: You take a song that you intend to use in your game, and in an audio tool, split it out into multiple wave files, one for each &#8216;track&#8217; that you want to have control over. Depending on the complexity of your song, you might just want to split it out into a pair of tracks, and fade one of them in when you want the music to get more intense. If your music is more sophisticated and your gameplay has lots of variation, you may want lots of tracks that you can control individually based on what&#8217;s happening &#8211; fade in some anxious-sounding strings when powerful monsters are on screen, and temporarily fade in some ominous-sounding bass notes when the player is injured, for example.</p>
<p><span id="more-604"></span></p>
<hr />
<p>In this article I&#8217;m going to be using two simple tracks I exported from a song using ModPlug tracker. This is about as simple as you can get, since I just wanted to grab a song I had lying around that I knew I could use without violating any copyright laws. To create the tracks, I went into MPT and loaded up the song. Then, I went into the pattern editor and muted part of the channels, and exported the song to a WAV. After that, I unmuted those channels and muted the remaining channels, and exported them to a second WAV file. This gives me two WAV files of equal length, each of which composes a portion of the song.</p>
<p>Now, to actually wire it up, you have to go into XACT and load up your audio project. You&#8217;re going to want to find the wave bank you keep your music in, and open it up. Once it&#8217;s open, select the tracks for your song and drag-drop them into the wave bank. Afterwards, you should have one entry in the wave bank for each track, as you see below.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_01.png"><img class="aligncenter size-full wp-image-605" title="xactmusic_01" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_01.png" alt="xactmusic_01" width="750" height="213" /></a></p>
<p>Next, open up the sound bank that contains your music cues. This probably has the same name as your wave bank for music, but if it doesn&#8217;t, no big deal.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_02.png"><img class="aligncenter size-full wp-image-606" title="xactmusic_02" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_02.png" alt="xactmusic_02" width="727" height="494" /></a></p>
<p>Now, drag one of your tracks out of your music wave bank, and drop it into the bottom portion of your sound bank, where the cues are listed. This will create a cue and associated sound for that track.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_03.png"><img class="aligncenter size-full wp-image-607" title="xactmusic_03" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_03.png" alt="xactmusic_03" width="544" height="561" /></a></p>
<p>The cue and sound are automatically named after the track, which probably isn&#8217;t ideal, so you can rename both of them to something easier to remember &#8211; this will make it easier to work with them in your game code. After you&#8217;ve done that, select the sound for your music up in the top section of the sound bank. You should see your track on the right side of the window, listed as &#8216;Track 1&#8242;.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_04.png"><img class="aligncenter size-full wp-image-608" title="xactmusic_04" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_04.png" alt="xactmusic_04" width="539" height="353" /></a></p>
<p>Next, you want to drag your remaining tracks out of your wave bank, and drop them directly onto the empty space below your track, in the top right portion of the sound bank window. This will create additional tracks for them, as a part of the sound.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_05.png"><img class="aligncenter size-full wp-image-609" title="xactmusic_05" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_05.png" alt="xactmusic_05" width="601" height="387" /></a></p>
<p>You&#8217;re all done here, so go ahead and close your wave and sound banks. Next, you need to create a variable to control the volume of your tracks. Go to the treeview on the left side of the XACT window, and right click the &#8216;Global&#8217; section under &#8216;Variables&#8217;. Select &#8216;New Global Variable&#8217;.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_06.png"><img class="aligncenter size-full wp-image-610" title="xactmusic_06" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_06.png" alt="xactmusic_06" width="250" height="172" /></a></p>
<p>In the window that opens, choose a name for your variable &#8211; I chose &#8216;MusicTrackVolume&#8217; &#8211; and then change its &#8216;Control&#8217; to &#8216;Monitored&#8217;. Go ahead and close the variable settings window after this.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_07.png"><img class="aligncenter size-medium wp-image-611" title="xactmusic_07" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_07-300x141.png" alt="xactmusic_07" width="300" height="141" /></a></p>
<p>Next, right click the &#8216;RPC Presets&#8217; section in the left side of the window, and select &#8216;New RPC Preset&#8217;.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_08.png"><img class="aligncenter size-full wp-image-612" title="xactmusic_08" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_08.png" alt="xactmusic_08" width="221" height="200" /></a></p>
<p>A rather intimidating window will open up. The first few things you want to do in this window are:</p>
<ul>
<li>Select your variable in the &#8216;Variable&#8217; dropdown at the top.</li>
<li>Then, in the same row, change the &#8216;Object&#8217; dropdown to point at the track for which you wish to control volume.</li>
<li>Finally, change the &#8216;Parameter&#8217; dropdown to &#8216;Volume&#8217;.</li>
</ul>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_09.png"><img class="aligncenter size-full wp-image-613" title="xactmusic_09" src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_09.png" alt="xactmusic_09" width="779" height="150" /></a></p>
<p>Once this is done, you need to set up the volume ramp, so that XACT knows how to adjust the volume of your track based on the value of the variable. To keep things simple, go ahead and set two points for the ramp:</p>
<ul>
<li><strong>MusicTrackVolume</strong> = <tt>0.00</tt>, <strong>Volume</strong> = <tt>-96.00</tt> (dB)</li>
<li><strong>MusicTrackVolume</strong> = <tt>1.00</tt>, <strong>Volume</strong> = <tt>0.00</tt> (dB)</li>
</ul>
<p>This specifies that when your variable is set to 0.0, the volume will be set to -96.0 dB, basically silent, and when it is set to 1.0, the volume will be set to 0 dB &#8211; full volume.</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_10.png"><img src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_10.png" alt="xactmusic_10" title="xactmusic_10" width="770" height="348" class="aligncenter size-full wp-image-614" /></a></p>
<p>Once this is done, you can close the RPC Preset window, and rename your new preset to something easier to identify, like &#8216;Music Volume Preset&#8217;. After that, open your sound bank back up. Drag your RPC preset out of the left side of the XACT window, and drop it directly onto the entry for your music in the top left portion of the sound bank window (the sounds portion, not the cues portion). </p>
<p>After you do this, your sound should be highlighted, and the bottom left portion of the XACT window (the properties viewer) should show your preset under &#8216;Attached Objects&#8217;. We&#8217;re done in XACT now, so you can save everything and close it if you like.</p>
<hr />
<p>Once you have everything set up in XACT, you can use your cue as you normally would in-game. By default, you will only hear one of your tracks, because your variable&#8217;s value defaults to zero.</p>
<p>To make it so the player can hear the track, all you have to do is provide a value for your variable. You do this by using the SetGlobalVariable method of the XACT AudioEngine class, like so:</p>
<pre>AudioEngine.SetGlobalVariable("MusicIntensity", 0.8f);</pre>
<p>Given this, it&#8217;s straightforward to set up your game code so that XACT variables change in response to in-game events. Note that variables change immediately after you set them, so your volume changes will be abrupt and somewhat disconcerting. The best way to solve this is to interpolate your variable changes, something like this:</p>
<pre>float fadeElapsedTime = (gameTime.TotalGameTime.TotalSeconds - FadeStartedWhen);
float musicIntensity = MathHelper.Clamp(fadeElapsedTime / FadeDuration, 0.0f, 1.0f);
AudioEngine.SetGlobalVariable("MusicIntensity", musicIntensity);</pre>
<p>Doing that every frame will give you smooth transitions between values, so that the player hears tracks fade in and out instead of immediately stopping and starting.</p>
<p>It&#8217;s also important to note that since the relationship between volume and decibels (dB) is logarithmic, your tracks will sound like they are fading in very quickly. The best way to solve this is by creating a more advanced curve for your RPC Preset, so that the fading sounds smoother. Here&#8217;s the one I used in my example video clip above:</p>
<p><a href="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_12.png"><img src="http://www.luminance.org/wp-content/uploads/2009/07/xactmusic_12.png" alt="xactmusic_12" title="xactmusic_12" width="696" height="343" class="aligncenter size-full wp-image-620" /></a></p>
<p>As you can see, I partially counteract the logarithmic nature of the dB scale by making the volume ramp up rapidly from <tt>-96</tt>dB to <tt>-32</tt>dB in the first quarter of the scale, and then ramp up more slowly from there to <tt>0</tt>dB. For your needs, a more complex curve might be appropriate.</p>
<p>I hope this post has given you some ideas about how to integrate dynamic music into your own XNA games. Please don&#8217;t hesitate to comment if you have any questions!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luminance.org/blog/code/2009/07/23/simple-dynamic-music-with-xact/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

