🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
8.5 KiB

  1. AmbDec Configuration Files
  2. ==========================
  3. AmbDec configuration files were developed by Fons Adriaensen as part of the
  4. AmbDec program <http://kokkinizita.linuxaudio.org/linuxaudio/index.html>.
  5. The file works by specifying a decoder matrix or matrices which transform
  6. ambisonic channels into speaker feeds. Single-band decoders specify a single
  7. matrix that transforms all frequencies, while dual-band decoders specifies two
  8. matrices where one transforms low frequency sounds and the other transforms
  9. high frequency sounds. See docs/ambisonics.txt for more general information
  10. about ambisonics.
  11. Starting with OpenAL Soft 1.18, version 3 of the file format is supported as a
  12. means of specifying custom surround sound speaker layouts. These configuration
  13. files are also used to enable the high-quality ambisonic decoder.
  14. File Format
  15. ===========
  16. As of this writing, there is no official documentation of the .ambdec file
  17. format. However, the format as OpenAL Soft sees it is as follows:
  18. The file is plain text. Comments start with a hash/pound character (#). There
  19. may be any amount of whitespace in between the option and parameter values.
  20. Strings are *not* enclosed in quotation marks.
  21. /description <desc:string>
  22. Specifies a text description of the configuration. Ignored by OpenAL Soft.
  23. /version <ver:int>
  24. Declares the format version used by the configuration file. OpenAL Soft
  25. currently only supports version 3.
  26. /dec/chan_mask <mask:hex>
  27. Specifies a hexadecimal mask value of ambisonic input channels used by this
  28. decoder. Counting up from the least significant bit, bit 0 maps to Ambisonic
  29. Channel Number (ACN) 0, bit 1 maps to ACN 1, etc. As an example, a value of 'b'
  30. enables bits 0, 1, and 3 (1011 in binary), which correspond to ACN 0, 1, and 3
  31. (first-order horizontal).
  32. /dec/freq_bands <count:int>
  33. Specifies the number of frequency bands used by the decoder. This must be 1 for
  34. single-band or 2 for dual-band.
  35. /dec/speakers <count:int>
  36. Specifies the number of output speakers to decode to.
  37. /dec/coeff_scale <type:string>
  38. Specifies the scaling used by the decoder coefficients. Currently recognized
  39. types are fuma, sn3d, and n3d, for Furse-Malham (FuMa), semi-normalized (SN3D),
  40. and fully normalized (N3D) scaling, respectively.
  41. /opt/input_scale <name:string>
  42. Specifies the scaling used by the ambisonic input data. As OpenAL Soft renders
  43. the data itself and knows the scaling, this is ignored.
  44. /opt/nfeff_comp <dir:string>
  45. Specifies whether near-field effect compensation is off (not applied at all),
  46. applied on input (faster, less accurate with varying speaker distances) or
  47. output (slower, more accurate with varying speaker distances). Ignored by
  48. OpenAL Soft.
  49. /opt/delay_comp <onoff:bool>
  50. Specifies whether delay compensation is applied for output. This is used to
  51. correct for time variations caused by different speaker distances. As OpenAL
  52. Soft has its own config option for this, this is ignored.
  53. /opt/level_comp <onoff:bool>
  54. Specifies whether gain compensation is applied for output. This is used to
  55. correct for volume variations caused by different speaker distances. As OpenAL
  56. Soft has its own config option for this, this is ignored.
  57. /opt/xover_freq <freq:float>
  58. Specifies the crossover frequency for dual-band decoders. Frequencies less than
  59. this are fed to the low-frequency matrix, and frequencies greater than this are
  60. fed to the high-frequency matrix. Unused for single-band decoders.
  61. /opt/xover_ratio <decibels:float>
  62. Specifies the volume ratio between the frequency bands. Values greater than 0
  63. decrease the low-frequency output by half the specified value and increase the
  64. high-frequency output by half the specified value, while values less than 0
  65. increase the low-frequency output and decrease the high-frequency output to
  66. similar effect. Unused for single-band decoders.
  67. /speakers/{
  68. Begins the output speaker definitions. A speaker is defined using the add_spkr
  69. command, and there must be a matching number of speaker definitions as the
  70. specified speaker count. The definitions are ended with a "/}".
  71. add_spkr <id:string> <dist:float> <azi:float> <elev:float> <connection:string>
  72. Defines an output speaker. The ID is a string identifier for the output speaker
  73. (see Speaker IDs below). The distance is in meters from the center-point of the
  74. physical speaker array. The azimuth is the horizontal angle of the speaker, in
  75. degrees, where 0 is directly front and positive values go left. The elevation
  76. is the vertical angle of the speaker, in degrees, where 0 is directly front and
  77. positive goes upward. The connection string is the JACK port name the speaker
  78. should connect to. Currently, OpenAL Soft uses the ID and distance, and ignores
  79. the rest.
  80. /lfmatrix/{
  81. Begins the low-frequency decoder matrix definition. The definition should
  82. include an order_gain command to specify the base gain for the ambisonic
  83. orders. Each matrix row is defined using the add_row command, and there must be
  84. a matching number of rows as the number of speakers. Additionally the row
  85. definitions are in the same order as the speaker definitions. The definitions
  86. are ended with a "/}". Only valid for dual-band decoders.
  87. /hfmatrix/{
  88. Begins the high-frequency decoder matrix definition. The definition should
  89. include an order_gain command to specify the base gain for the ambisonic
  90. orders. Each matrix row is defined using the add_row command, and there must be
  91. a matching number of rows as the number of speakers, Additionally the row
  92. definitions are in the same order as the speaker definitions. The definitions
  93. are ended with a "/}". Only valid for dual-band decoders.
  94. /matrix/{
  95. Begins the decoder matrix definition. The definition should include an
  96. order_gain command to specify the base gain for the ambisonic orders. Each
  97. matrix row is defined using the add_row command, and there must be a matching
  98. number of rows as the number of speakers. Additionally the row definitions are
  99. in the same order as the speaker definitions. The definitions are ended with a
  100. "/}". Only valid for single-band decoders.
  101. order_gain <gain:float> <gain:float> <gain:float> <gain:float>
  102. Specifies the base gain for the zeroth-, first-, second-, and third-order
  103. coefficients in the given matrix, automatically scaling the related
  104. coefficients. This should be specified at the beginning of the matrix
  105. definition.
  106. add_row <coefficient:float> ...
  107. Specifies a row of coefficients for the matrix. There should be one coefficient
  108. for each enabled bit in the channel mask, and corresponds to the matching ACN
  109. channel.
  110. /end
  111. Marks the end of the configuration file.
  112. Speaker IDs
  113. ===========
  114. The AmbDec program uses the speaker ID as a label to display in its config
  115. dialog, but does not otherwise use it for any particular purpose. However,
  116. since OpenAL Soft needs to match a speaker definition to an output channel, the
  117. speaker ID is used to identify what output channel it correspond to. Therefore,
  118. OpenAL Soft requires these channel labels to be recognized:
  119. LF = Front left
  120. RF = Front right
  121. LS = Side left
  122. RS = Side right
  123. LB = Back left
  124. RB = Back right
  125. CE = Front center
  126. CB = Back center
  127. Additionally, configuration files for surround51 will acknowledge back speakers
  128. for side channels, and surround51rear will acknowledge side speakers for back
  129. channels, to avoid issues with a configuration expecting 5.1 to use the side
  130. channels when the device is configured for back, or vice-versa.
  131. Furthermore, OpenAL Soft does not require a speaker definition for each output
  132. channel the configuration is used with. So for example a 5.1 configuration may
  133. omit a front center speaker definition, in which case the front center output
  134. channel will not contribute to the ambisonic decode (though OpenAL Soft will
  135. still use it in certain scenarios, such as the AL_EFFECT_DEDICATED_DIALOGUE
  136. effect).
  137. Creating Configuration Files
  138. ============================
  139. Configuration files can be created or modified by hand in a text editor. The
  140. AmbDec program also has a GUI for creating and editing them. However, these
  141. methods rely on you having the coefficients to fill in... they won't be
  142. generated for you.
  143. Another option is to use the Ambisonic Decoder Toolbox
  144. <https://bitbucket.org/ambidecodertoolbox/adt.git>. This is a collection of
  145. MATLAB and GNU Octave scripts that can generate AmbDec configuration files from
  146. an array of speaker definitions (labels and positions). If you're familiar with
  147. using MATLAB or GNU Octave, this may be a good option.
  148. There are plans for OpenAL Soft to include a utility to generate coefficients
  149. and make configuration files. However, calculating proper coefficients for
  150. anything other than regular or semi-regular speaker setups is somewhat of a
  151. black art, so may take some time.