{"id":4631,"date":"2019-06-17T00:31:41","date_gmt":"2019-06-16T22:31:41","guid":{"rendered":"https:\/\/demdlx704as001.ad.harman.com\/?p=4631"},"modified":"2024-05-10T13:39:12","modified_gmt":"2024-05-10T11:39:12","slug":"audio-object-sub-blocks","status":"publish","type":"post","link":"https:\/\/audioworx.transfunnel.co\/old\/?p=4631","title":{"rendered":"Audio Object Sub Blocks"},"content":{"rendered":"<p>The Sub-blocks represents logical divisions of a block\u2019s (or audio object&#8217;s) memory. They are partitions of the audio object\u2019s memory.<\/p>\n<p>There are many reasons to use sub-blocks in an object.<\/p>\n<ul>\n<li>Tuning data preservation is facilitated by the use of sub-blocks.<\/li>\n<li>The data can be organized into more logical chunks.<\/li>\n<li>The data will also be easier to debug.<\/li>\n<li>In some cases, tuning preset files can store much less data. This is due to the fact that sub-blocks of the memory can be individually stored in the preset files as opposed to the entire object&#8217;s memory.<\/li>\n<\/ul>\n<p>Sub-blocks belonging to the same object do not necessarily need to have the same sub-block size.<\/p>\n<p>The two API calls associated with setting up sub-blocks in an object are:<\/p>\n<pre class=\"text\"><span style=\"font-size: 12pt;\">xInt8* getSubBlockPtr(xUInt16 subBlock)\r\nxSInt32 getSubBlockSize(xUInt16 subBlock)<\/span><\/pre>\n<ul>\n<li><strong><em>getSubBlockPtr()<\/em><\/strong> is called by the framework to retrieve pointer to start of the subblock.<\/li>\n<li><strong><em>getSubBlockSize()<\/em><\/strong> is called by framework to get size of the subblock in bytes<\/li>\n<\/ul>\n<p>Here we will create an example of a simple object.\u00a0 This object has one parameter (m_Gain).\u00a0 It&#8217;s a float so its size is four bytes.\u00a0 Since it is our only parameter we will only have one subblock it&#8217;s subblock will be zero (we start at zero).<\/p>\n<p>In this code we only return a valid pointer if our subblock is as expected.\u00a0 If subblock is zero then we return a pointer to our parameter memory &#8211; which in this case is the address of our member float.\u00a0 Memory referenced doesn&#8217;t have to be a member variable of course, often it is a reference directly to a requested memory record.\u00a0 Sometimes objects will allocate one record but map several subblocks to the memory, spacing them out appropriately.\u00a0 You are free to do what you want as long as you don&#8217;t reference global memory as your object has to support multiple instances.<\/p>\n<p><span style=\"font-size: 12pt;\"><img decoding=\"async\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2023\/11\/getSubBlockPtrEx.png\" \/><\/span><\/p>\n<p>Likewise for this method the return for an error case is the default (0).\u00a0 If the framework sees a 0 size record or nullptr returned from the subblock method it will return an error over xTP and not attempt to write out of bounds.\u00a0 It will also return an error if address + size in the tuneXTP method exceeds the bounds dictated here. (Eg: subblock size is 16, but I want to write 8 bytes starting at address 12, this would be denied).<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2023\/11\/getSubBlockSizeEx.png\" \/><\/p>\n<p>Whether your data is defined in DDF as &#8216;Tuning&#8217; or &#8216;State&#8217; it still will have a subblock.\u00a0 The following fields in GTT&#8217;s SV Viewer.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2023\/11\/DDFSVView-1.png\" \/><\/p>\n<p>In the above picture we can see how this information translates to the DDF side.<\/p>\n<p>SubBlockID is the same subblock as above.\u00a0 Offset is your address within the subblock, size is the size of the variable.\u00a0 You can also see above the category here is &#8216;Tuning&#8217;.\u00a0 A subblock is either &#8216;Tuning&#8217; or &#8216;State&#8217; and\u00a0 it cannot be split between them.<\/p>\n<p>If an audio object not require any sub-blocks (no tuning or state parameters), these methods don&#8217;t need to be overridden.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Sub-blocks represents logical divisions of a block\u2019s (or audio object&#8217;s) memory. They are partitions of the audio object\u2019s memory. There are many reasons to use sub-blocks in an object. Tuning data preservation is facilitated by the use of sub-blocks. The data can be organized into more logical chunks. The data will also be easier [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","footnotes":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[]},"categories":[353],"tags":[],"coauthors":[165],"_links":{"self":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4631"}],"collection":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4631"}],"version-history":[{"count":23,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4631\/revisions"}],"predecessor-version":[{"id":28011,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4631\/revisions\/28011"}],"wp:attachment":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4631"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcoauthors&post=4631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}