{"id":610,"date":"2018-01-10T02:21:13","date_gmt":"2018-01-10T02:21:13","guid":{"rendered":"http:\/\/procedural-audio.com\/blog\/?p=610"},"modified":"2022-01-06T10:56:53","modified_gmt":"2022-01-06T10:56:53","slug":"procedural-audio-lods","status":"publish","type":"post","link":"http:\/\/procedural-audio.com\/blog\/2018\/01\/10\/procedural-audio-lods\/","title":{"rendered":"Procedural Audio LODs"},"content":{"rendered":"<p style=\"text-align: justify;\">A useful technique when designing a procedural audio patch is to divide it based on <strong>different levels of details<\/strong> (LODs) of the sound we want to simulate.<\/p>\n<p style=\"text-align: justify;\">To illustrate our point, let&#8217;s create a very simple rain patch. If we had to design such a patch, we may be tempted to trigger many Bubble generators in GameSynth, with different settings. We could end up with a patch similar to the one in the picture below:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-612\" src=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch-1.jpg\" alt=\"LOD-patch 1\" width=\"1000\" height=\"310\" srcset=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch-1.jpg 1000w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch-1-150x47.jpg 150w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch-1-300x93.jpg 300w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch-1-768x238.jpg 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<p style=\"text-align: justify;\">Although this is certainly doable, it requires a lot of manual parameter adjustments, it is not very readable or manageable, and more importantly it would be quite costly CPU-wise.<\/p>\n<p style=\"text-align: justify;\">Instead, let\u2019s look at the rain preset that comes with GameSynth:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-613\" style=\"max-width: 400px;\" src=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch2.jpg\" alt=\"LOD-patch2\" width=\"605\" height=\"614\" srcset=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch2.jpg 605w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch2-150x152.jpg 150w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch2-300x304.jpg 300w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/p>\n<p>You can listen to it here:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/w.soundcloud.com\/player\/?url=https%3A\/\/api.soundcloud.com\/tracks\/379080662&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true\" width=\"100%\" height=\"166\" frameborder=\"no\" scrolling=\"no\"><\/iframe><\/p>\n<p style=\"text-align: justify;\">The patch has been divided into 3 processing branches &#8211; each corresponding to a different level of detail \u2013 that are connected to a Mixer module.<\/p>\n<ul>\n<li style=\"text-align: justify;\">First, a simple and very cost-efficient <strong>Noise<\/strong> module is used to simulate the distant rain. This <strong>Noise<\/strong> module is built around a white noise generator followed by a bandpass filter. Here, the upper cutoff frequency of that filter is slowly modulated by a <strong>LFO<\/strong> to make the sound a bit less repetitive and simulate waves of more intense rain.<\/li>\n<\/ul>\n<p><iframe loading=\"lazy\" src=\"https:\/\/w.soundcloud.com\/player\/?url=https%3A\/\/api.soundcloud.com\/tracks\/379081316&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true\" width=\"100%\" height=\"166\" frameborder=\"no\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"text-align: justify;\">At a second level, a <strong>Granular Noise<\/strong> module &#8211; also very CPU-friendly in GameSynth &#8211; goes through a <strong>Biquad Filter<\/strong> configured as a lowpass to simulate the rain hitting a surface nearby.<\/li>\n<\/ul>\n<p><iframe loading=\"lazy\" src=\"https:\/\/w.soundcloud.com\/player\/?url=https%3A\/\/api.soundcloud.com\/tracks\/379081088&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true\" width=\"100%\" height=\"166\" frameborder=\"no\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"text-align: justify;\">Finally, at the third level, we generate single water drops that are close to the listener by using a\u00a0<strong>Bubble<\/strong>\u00a0module. The bubbles are triggered randomly by a <strong>Distribution<\/strong> module.<\/li>\n<\/ul>\n<p><iframe loading=\"lazy\" src=\"https:\/\/w.soundcloud.com\/player\/?url=https%3A\/\/api.soundcloud.com\/tracks\/379080875&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true\" width=\"100%\" height=\"166\" frameborder=\"no\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">The three patch sections are mixed together and passed through a small algorithmic <strong>Reverb<\/strong> module. It is a lot cheaper CPU-wise than a convolution reverb and sufficient for our case. \u00a0Actually, if you are using GameSynth in conjunction with a game audio middleware, the reverberation would usually be applied outside of the patch.<\/p>\n<p style=\"text-align: justify;\"><strong>The result is a patch that sounds great, is easy to read and edit, and uses very little CPU.<\/strong> Compared to sample playback, the advantages are obvious: <strong>the sound of the rain never repeats itself, we could update all the parameters from the game<\/strong> (e.g. levels of each section, frequency of the water drops, tone of the ambient rain), and <strong>the data only takes 380 bytes<\/strong> of memory! Yes, that\u2019s right: three \u2013 eight \u2013 zero.<\/p>\n<p style=\"text-align: justify;\">This technique &#8211; which consists in decomposing sounds in different elements based on their level of detail and using different synthesis techniques to simulate these elements &#8211; can be successfully applied to\u00a0the generation of many other sound effects.<\/p>\n<p style=\"text-align: justify;\">For example, the Camp Fire preset of GameSynth uses a very similar patch structure.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-620\" style=\"max-width: 400px;\" src=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch3.jpg\" alt=\"LOD-patch3\" width=\"784\" height=\"689\" srcset=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch3.jpg 784w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch3-150x132.jpg 150w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch3-300x264.jpg 300w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/01\/LOD-patch3-768x675.jpg 768w\" sizes=\"(max-width: 784px) 100vw, 784px\" \/><\/p>\n<p>You can hear the result here:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/w.soundcloud.com\/player\/?url=https%3A\/\/api.soundcloud.com\/tracks\/379093178&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true\" width=\"100%\" height=\"166\" frameborder=\"no\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">We will introduce more procedural audio techniques using GameSynth in the upcoming blogs, so happy patching and visit us again soon!<\/p>\n<p><a class=\"gs-learn-more\" href=\"http:\/\/procedural-audio.com\/web\/en\/products-gamesynth.html\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2020\/06\/2020_06_Introducing-Modular-Weapons-Modules-banner-1.png\" alt=\"GameSynth\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A useful technique when designing a procedural audio patch is to divide it based on different levels of details (LODs) of the sound we<\/p>\n","protected":false},"author":1,"featured_media":624,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,15,12],"tags":[],"_links":{"self":[{"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/posts\/610"}],"collection":[{"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/comments?post=610"}],"version-history":[{"count":21,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/posts\/610\/revisions"}],"predecessor-version":[{"id":4974,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/posts\/610\/revisions\/4974"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/media\/624"}],"wp:attachment":[{"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/media?parent=610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/categories?post=610"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/tags?post=610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}