{"id":3723,"date":"2022-06-13T09:47:40","date_gmt":"2022-06-13T00:47:40","guid":{"rendered":"https:\/\/blog.criware.com\/?p=3723"},"modified":"2024-05-21T10:02:16","modified_gmt":"2024-05-21T01:02:16","slug":"advanced-distance-attenuation","status":"publish","type":"post","link":"https:\/\/blog.criware.com\/index.php\/2022\/06\/13\/advanced-distance-attenuation\/","title":{"rendered":"Advanced Distance Attenuation"},"content":{"rendered":"<p>Distance attenuation of 3D sound sources plays has a big part in creating convincing soundscapes. While ADX can automatically manage attenuation of its Cues when they are set to 3D, using AISACs allows for the customization of the way the sounds will behave in the game.<\/p>\n<div style=\"width: 800px; display: block;margin: 40px auto;\" class=\"wp-video\">\n<div style=\"width: 800px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3723-1\" width=\"800\" height=\"450\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Video-Distance-Attenuation.mp4?_=1\" \/><a href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Video-Distance-Attenuation.mp4\">https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Video-Distance-Attenuation.mp4<\/a><\/video><\/div>\n<\/div>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Switching Sounds<\/h2>\n<p>One of the benefits of using an AISAC instead of the built-in attenuation is the ability to switch sounds based on the distance. This technique is especially useful for loud sounds (explosions, gunshots, vehicles\u2026) as the acoustic properties can be modified over the long distance they travel. Switching sound makes it easier to achieve realistic results than simply adjusting volumes and lowpass filter cutoffs, for instance.<\/p>\n<p>To demonstrate how it works, let\u2019s create a gunshot Cue containing four samples, corresponding to the sounds perceived at increasing distance.<\/p>\n<p>To implement this in Atom Craft:<\/p>\n<ul>\n<li>Import your four gunshot sounds in the <strong>Material folder<\/strong><\/li>\n<li>Create a new <strong>Polyphonic Cue<\/strong><\/li>\n<li>Create four tracks and drag &amp; drop one gunshot sound per track<\/li>\n<\/ul>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3725\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/01-GunshotCue.png\" alt=\"01 GunshotCue\" width=\"902\" height=\"549\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/01-GunshotCue.png 902w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/01-GunshotCue-300x183.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/01-GunshotCue-768x467.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/>\n<\/p>\n<p>We now have to enable 3D positioning for our Cue and assign an <strong>AISAC<\/strong> to control its attenuation curve:<\/p>\n<ul>\n<li>First, in the <strong>Project Tree<\/strong> create an <strong>AISAC-Control<\/strong> called Distance_Gun<\/li>\n<li>Then, in the gunshot Cue\u2019s <strong>Inspector<\/strong> tab, select 3D Positioning for the<em> Pan Type.<\/em><\/li>\n<li>In the <em>3D Positioning<\/em>, select the Distance_Gun AISAC for <em>Distance AISAC Control<\/em><\/li>\n<li>Finally, set the<em> Min and Max Distance of 3D Positioning Attenuation<\/em> to 25 and 500 respectively<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3726\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/02-3D-positioning-settings.png\" alt=\"02 3D positioning settings\" width=\"1369\" height=\"579\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/02-3D-positioning-settings.png 1369w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/02-3D-positioning-settings-300x127.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/02-3D-positioning-settings-768x325.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/02-3D-positioning-settings-1024x433.png 1024w\" sizes=\"auto, (max-width: 1369px) 100vw, 1369px\" \/><\/p>\n<p>To play the right sound for a specific distance, <em>Volume<\/em> curves need to be created for <strong>each Track<\/strong> that will be controlled by the Distance_Gun AISAC.<\/p>\n<ul>\n<li>For the track of the closest sound, create a fade-out curve that starts from 0 and decreases until 0.25<\/li>\n<li>For the medium-distance sound, create a bell curve from 0 to 0.5<\/li>\n<li>For the distant sound, create a bell curve from 0.25 to 0.75<\/li>\n<li>For the farthest sound, create a fade-in curve that starts from 0.5 and goes all the way to 1<\/li>\n<li>Change the curve type to <em>Fast change<\/em> for the fade-ins and <em>Slow change<\/em> for the fade-outs to create nice crossfades between each sound<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p style=\"text-align:center;\">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3727\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/03-Tracks-AISAC.png\" alt=\"03 Tracks AISAC\" width=\"1084\" height=\"446\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/03-Tracks-AISAC.png 1084w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/03-Tracks-AISAC-300x123.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/03-Tracks-AISAC-768x316.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/03-Tracks-AISAC-1024x421.png 1024w\" sizes=\"auto, (max-width: 1084px) 100vw, 1084px\" \/>\n<\/p>\n<p>By adjusting the value of the AISAC, the sound will now change, simulating the distance.<\/p>\n<p>It is also recommended to set the <em>Voice behavior<\/em> to <em>Voice Stop<\/em> or <em>Vitual Voice <\/em>so that when the volume of a sound reaches 0, the corresponding Voice is released, saving some resources.<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Going Further<\/h2>\n<p>To achieve even better results, let\u2019s control the sound at the Cue level. This will help glue the four tracks together, and make the sound feel more natural.<\/p>\n<ul>\n<li>At the Cue level, create two graphs controlled by the Distance_Gun AISAC: one for the <em>Volume<\/em> and one for the <em>Biquad \u2013 Cutoff<\/em><\/li>\n<li>Make the <em>Volume<\/em> fade-out with a <em>Slow change<\/em> curve<\/li>\n<li>The <em>Biquad \u2013 Cutoff<\/em> will also fade-out, but not completely to avoid the sound from becoming totally muted<\/li>\n<\/ul>\n<p>The roll-off is sounding much better now but it still possible to add more depth. Previously, we created a DSP Bus with a reverb as an auxiliary effect bus. Gunshot sounds have been routed to a dedicated Gun DSP bus with a send to the auxiliary reverb. It makes it possible to control the amount of reverb with the distance AISAC.<\/p>\n<ul>\n<li>In the <strong>Project Tree<\/strong>, add the <em>Reverb<\/em> bus to the <strong>BusMap For AISAC and Automation<\/strong> list<\/li>\n<li>At the Cue level, create a new graph for <em>BusSend2 (Reverb)<\/em><\/li>\n<li>The curve should be a line from 0.10 to around 0.70 when the AISAC value goes from 0 to 1<\/li>\n<li>In addition, add a last graph for the <em>Pre-delay Time, <\/em>a line from 0 to 760 ms, that will simulate the delay induced by the propagation of the sound<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3728\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/04-Cue-AISAC.png\" alt=\"04 Cue AISAC\" width=\"1329\" height=\"861\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/04-Cue-AISAC.png 1329w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/04-Cue-AISAC-300x194.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/04-Cue-AISAC-768x498.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/04-Cue-AISAC-1024x663.png 1024w\" sizes=\"auto, (max-width: 1329px) 100vw, 1329px\" \/><\/p>\n<p>As you can see, implementing distance attenuation with an AISAC can help you achieve more realistic and pleasing results. It is possible to dig even further by having dedicated AISACs for both the azimuth and the elevation. As this adds complexity, it is a good practice to create all these AISACs under the <strong>WorkUnit\/References\/AISAC<\/strong> folder, so that they can be reused on all relevant Cues.<\/p>\n<div style=\"max-width: 800px; margin: 0 auto; margin-bottom: 20px; text-align: center;\"><a style=\"display: block; border: 1px solid #ccc; padding: 20px; max-width: 100%; margin: 0 auto;\" href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/AtomCraft_Project_Advanced_Distance_attenuation.zip\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1813\" style=\"display: block; margin: 0 auto;\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2018\/06\/zip.png\" alt=\"zip\" width=\"80\" height=\"78\">AtomCraft_Project_Advanced_Distance_attenuation.zip<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Distance attenuation of 3D sound sources plays has a big part in creating convincing soundscapes. While ADX can automatically manage<\/p>\n","protected":false},"author":2,"featured_media":5492,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[5,7],"tags":[],"class_list":["post-3723","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adx","category-tutorials"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/3723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/comments?post=3723"}],"version-history":[{"count":9,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/3723\/revisions"}],"predecessor-version":[{"id":3738,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/3723\/revisions\/3738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media\/5492"}],"wp:attachment":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media?parent=3723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/categories?post=3723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/tags?post=3723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}