{"id":5015,"date":"2024-07-08T11:30:00","date_gmt":"2024-07-08T02:30:00","guid":{"rendered":"https:\/\/blog.criware.com\/?p=5015"},"modified":"2024-08-03T13:31:48","modified_gmt":"2024-08-03T04:31:48","slug":"adx-beginners-guide-12-interactive-music-with-aisac-and-selectors","status":"publish","type":"post","link":"https:\/\/blog.criware.com\/index.php\/2024\/07\/08\/adx-beginners-guide-12-interactive-music-with-aisac-and-selectors\/","title":{"rendered":"ADX Beginner\u2019s Guide #12 \u2013 Interactive Music with  AISAC and Selectors"},"content":{"rendered":"<p><a href=\"https:\/\/blog.criware.com\/index.php\/2024\/07\/04\/adx-beginners-guide-11-dynamic-mixing-with-react\/\">In episode 11<\/a> of this beginner&#8217;s guide, we explored dynamic mixing with REACT, which helps us balance the different audio components of a game.<\/p>\n<p>Of course, one type of audio component &#8211; on which we focused until now \u2013 are the sound effects (ambiences, character Foley etc\u2026). But in this post and in the next, we will examine another important component: music, and more specifically, interactive music.<\/p>\n<p>Indeed, ADX offers many features to implement interactive music systems: we will start by using AISAC or Selectors, to focus on Block Playback in the next post.<\/p>\n<h1 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Using AISAC<\/h1>\n<p>One of the easiest structures to grasp in interactive game music is the layering and stacking of musical elements to change the overall musical intensity. Each layer can represent different instruments that are gradually incorporated into the music, or a series of stems that become more elaborate as the game progresses.<\/p>\n<p style=\"text-align:center\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/01-Music-AISAC.png\" alt=\"01 Music AISAC\" width=\"500\" height=\"251\" class=\"alignnone size-full wp-image-5016\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/01-Music-AISAC.png 500w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/01-Music-AISAC-300x151.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/>\n<\/p>\n<p>Adding instruments gradually to the music is a good way to create a sense of progression. For example, it can add intensity as the player completes a level. It can also provide directional cues as the character approaches a place of interest.<\/p>\n<p>One of the easiest ways to do this in ADX is to set up a Cue, with each track corresponding to an instrument, and then use an AISAC to progressively blend them into the music. Later, in the game, you can link the percentage of completion of a level to the desired AISAC Control to change the music in real-time.<\/p>\n<p>To do that in AtomCraft:<\/p>\n<ul>\n<li>Prepare your music assets as to have one sound for each instrument. Of course, once layered, everything should be synchronized.<\/li>\n<li>Create a Polyphonic Cue with the required number of Tracks.<\/li>\n<li>Add an instrument on each Track, trying to sort them from softer to louder.<\/li>\n<li>Create an AISAC on each track with a Volume graph.<\/li>\n<li>Draw the curves so that the Tracks enter the music one at a time as the AISAC control value increases.<\/li>\n<\/ul>\n<p style=\"text-align:center\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/02-AISAC-Music.png\" alt=\"02 AISAC Music\" width=\"1312\" height=\"661\" class=\"alignnone size-full wp-image-5017\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/02-AISAC-Music.png 1312w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/02-AISAC-Music-300x151.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/02-AISAC-Music-768x387.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/02-AISAC-Music-1024x516.png 1024w\" sizes=\"auto, (max-width: 1312px) 100vw, 1312px\" \/>\n<\/p>\n<p>The instruments will progressively appear to create a complete ensemble as the player reaches the end of the level. Of course, for more complex pieces, you may also want to remove some instruments to make room for others. This technique works best when the progression is relatively slow so that the player doesn&#8217;t notice that the music is evolving.<\/p>\n<p>Here is how this type of structure using AISAC could sound:<\/p>\n<div style=\"max-width: 700px; margin: 0 auto; margin-bottom: 20px; border: 1px solid #aaa;\">\n<div style=\"width: 800px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-5015-1\" width=\"800\" height=\"423\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/Video_01_Music_AISAC.mp4?_=1\" \/><a href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/Video_01_Music_AISAC.mp4\">https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/Video_01_Music_AISAC.mp4<\/a><\/video><\/div>\n<\/div>\n<h1 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Using Track Transition by Selector<\/h1>\n<p>In an infiltration game, the character will go through different states during gameplay, such as stealth, alert, combat, etc. To musically differentiate each of these states, you can use a similar structure when implementing the music. In this case, though, the use of AISAC is not the best choice because you can usually jump from one state to another in any order (and the AISAC implementation we just saw is dependent on the order of the layers).<\/p>\n<p>Therefore, in this scenario, we will use a Cue of type <strong>Track Transition by Selector<\/strong>. This type of Cue allows us to have a different version of our music on each Track, each corresponding to a specific state. A <strong>Selector<\/strong> can then be used to switch between each state\/Track.<\/p>\n<p style=\"text-align:center\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/03-Music-Selector.png\" alt=\"03 Music Selector\" width=\"392\" height=\"240\" class=\"alignnone size-full wp-image-5018\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/03-Music-Selector.png 392w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/03-Music-Selector-300x184.png 300w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/>\n<\/p>\n<p>Unlike the AISAC method, a Track Transition by Selector Cue can be bound to tempo. This means that when transitioning from one state to another, you can force the transition to start on a precise beat. In addition, a crossfade can be set to smooth the transitions between Tracks.<\/p>\n<p>To implement this, we first need to create a Selector:<\/p>\n<ul>\n<li>In the Project Tree, create a <strong>Selector<\/strong>.<\/li>\n<li>Select it and create a <strong>Selector Label<\/strong> for each game state (exploration, stealth, fight, etc.).<\/li>\n<\/ul>\n<p style=\"text-align:center\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/04-Selector.png\" alt=\"04 Selector\" width=\"424\" height=\"334\" class=\"alignnone size-full wp-image-5019\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/04-Selector.png 424w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/04-Selector-300x236.png 300w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/>\n<\/p>\n<p>As for the assets, you should prepare a variation of the music for each state. Of course, the stealth variation should be softer than the fight variation etc. Once the assets are ready, you can create the Cue:<\/p>\n<ul>\n<li>Create a Cue of type <strong>Track Transition by Selector<\/strong>.<\/li>\n<li>Create enough Tracks to match the number of states.<\/li>\n<li>Then, on the Track header, set the Selector label for each state.<\/li>\n<li>Drag and drop the Material of each state onto the corresponding Track.<\/li>\n<li>Select the Cue and set the appropriate crossfade settings in the <strong>Track Transition<\/strong> section of the <strong>Inspector<\/strong>.<\/li>\n<\/ul>\n<p style=\"text-align:center\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/05-Track-Selector.png\" alt=\"05 Track Selector\" width=\"898\" height=\"512\" class=\"alignnone size-full wp-image-5020\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/05-Track-Selector.png 898w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/05-Track-Selector-300x171.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/05-Track-Selector-768x438.png 768w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\" \/><\/p>\n<p>Finally, we need to link the tempo to the Cue.<\/p>\n<ul>\n<li>On the timeline, just before the ruler, click on the clock button to <em>Edit the TimeBase<\/em> of the sequence.<\/li>\n<li>In the <strong>Sequence Setting<\/strong> tab, change the <em>Type<\/em> to <em>Bar\/Beat<\/em> and set the <em>BPM<\/em>. The timeline\u2019s grid should be updated  accordingly.<\/li>\n<li>Then, right-click in the timeline and create a <strong>BeatSync Parameter<\/strong>.<\/li>\n<li>Select the BeatSync on the timeline and, in the Inspector, set the BPM. Then change the <em>Beat Pattern<\/em> to your liking: this setting lets you choose on which beats the transition can be triggered. For example, if you only want the transition to happen on the next bar, you should only select the first beat.<\/li>\n<\/ul>\n<p style=\"text-align:center\">\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/06-BeatSync.png\" alt=\"06 BeatSync\" width=\"1148\" height=\"634\" class=\"alignnone size-full wp-image-5021\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/06-BeatSync.png 1148w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/06-BeatSync-300x166.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/06-BeatSync-768x424.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/06-BeatSync-1024x566.png 1024w\" sizes=\"auto, (max-width: 1148px) 100vw, 1148px\" \/>\n<\/p>\n<p>With everything set up, you should now be able to smoothly transition between each music state on the beat.<\/p>\n<div style=\"max-width: 700px; margin: 0 auto; margin-bottom: 20px; border: 1px solid #aaa;\">\n<div style=\"width: 800px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-5015-2\" width=\"800\" height=\"423\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/Video_02_Music_Selector.mp4?_=2\" \/><a href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/Video_02_Music_Selector.mp4\">https:\/\/blog.criware.com\/wp-content\/uploads\/2024\/03\/Video_02_Music_Selector.mp4<\/a><\/video><\/div>\n<\/div>\n<p>With the two structures described above, we can already implement some great interactive music. In the <a href=\"https:\/\/blog.criware.com\/index.php\/2024\/08\/03\/adx-beginners-guide-13-interactive-music-with-block-playback\/\">next episode<\/a>, we will discover yet another structure with Block Playback.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In episode 11 of this beginner&#8217;s guide, we explored dynamic mixing with REACT, which helps us balance the different audio<\/p>\n","protected":false},"author":2,"featured_media":5552,"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-5015","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\/5015","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=5015"}],"version-history":[{"count":11,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/5015\/revisions"}],"predecessor-version":[{"id":5557,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/5015\/revisions\/5557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media\/5552"}],"wp:attachment":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media?parent=5015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/categories?post=5015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/tags?post=5015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}