INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: NEW: DSP Presets  (Read 1593 times)

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
NEW: DSP Presets
« on: December 19, 2020, 04:35:50 am »

2. NEW: DSP Presets can be saved and loaded from files.
thanks for adding this

I notice the file location on load/save defaults to C:, would be handy to either remember the last location or be able to set a default location.

is the format described somewhere?

a few Qs based on the example below

* what are the values in parentheses? e.g. (1:1)(2:53) at the start as well as each XMLPH element being wrapped in some numbered value
* enabled has values 0, 1 for the most part which presumably means off & on but then there are some other random values like 7143425, 32513, 24073728 so no idea what this means, some bug?
* is there a named list of the types available? presumably this is some enum of filter types
* you seem to store a value for slope for a peaking filter (e.g. the Q=8.18 filter in the example below). S has no meaning in this context so what is it? if I generate a filter in this format, is it required? actually this always seems to be set to 12 in such cases so presumably it is ignored
* the channel index appears to start at 2 (where 2 = L) but then with an 8 channel output format U1 and U2 are idx 11 & 12, how are these values calculated?


Code: [Select]
(1:1)(2:53)(95:<XMLPH version="1.1">
<Item Name="Enabled">32513</Item>
<Item Name="Type">20</Item>
</XMLPH>)(291:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">8.1820000000000004</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-7.7999999999999998</Item>
<Item Name="Frequency">40.0499999999999972</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(155:<XMLPH version="1.1">
<Item Name="Enabled">32513</Item>
<Item Name="Type">4</Item>
<Item Name="Gain">-1</Item>
<Item Name="Channels">4</Item>
</XMLPH>)(95:<XMLPH version="1.1">
<Item Name="Enabled">32513</Item>
<Item Name="Type">20</Item>
</XMLPH>)(261:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">4.5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-0.5</Item>
<Item Name="Frequency">99.7999999999999972</Item>
<Item Name="Channels">2</Item>
</XMLPH>)(260:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">3</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-5.5999999999999996</Item>
<Item Name="Frequency">117.5</Item>
<Item Name="Channels">2</Item>
</XMLPH>)(258:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-2.2000000000000002</Item>
<Item Name="Frequency">146</Item>
<Item Name="Channels">2</Item>
</XMLPH>)(97:<XMLPH version="1.1">
<Item Name="Enabled">7143425</Item>
<Item Name="Type">20</Item>
</XMLPH>)(245:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">6</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-0.4</Item>
<Item Name="Frequency">118.5</Item>
<Item Name="Channels">3</Item>
</XMLPH>)(260:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">6</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-3.1000000000000001</Item>
<Item Name="Frequency">130.5</Item>
<Item Name="Channels">3</Item>
</XMLPH>)(258:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">6</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-3.7000000000000002</Item>
<Item Name="Frequency">143</Item>
<Item Name="Channels">3</Item>
</XMLPH>)(91:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">20</Item>
</XMLPH>)(260:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-1.6000000000000001</Item>
<Item Name="Frequency">109.5</Item>
<Item Name="Channels">4</Item>
</XMLPH>)(260:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5.5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-3.2000000000000002</Item>
<Item Name="Frequency">143</Item>
<Item Name="Channels">4</Item>
</XMLPH>)(97:<XMLPH version="1.1">
<Item Name="Enabled">7143425</Item>
<Item Name="Type">20</Item>
</XMLPH>)(243:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">8</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-1.7</Item>
<Item Name="Frequency">141</Item>
<Item Name="Channels">8</Item>
</XMLPH>)(98:<XMLPH version="1.1">
<Item Name="Enabled">16776961</Item>
<Item Name="Type">20</Item>
</XMLPH>)(243:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">7</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-2</Item>
<Item Name="Frequency">127.5</Item>
<Item Name="Channels">9</Item>
</XMLPH>)(260:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">7</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-2.1000000000000001</Item>
<Item Name="Frequency">138.5</Item>
<Item Name="Channels">9</Item>
</XMLPH>)(91:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">20</Item>
</XMLPH>)(262:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-1.3999999999999999</Item>
<Item Name="Frequency">717</Item>
<Item Name="Channels">2;3;4</Item>
</XMLPH>)(254:<XMLPH version="1.1">
<Item Name="Enabled">24073728</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">0.5</Item>
<Item Name="Frequency">4341</Item>
<Item Name="Channels">2;3;4</Item>
</XMLPH>)(264:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">4.9100000000000002</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">1.7</Item>
<Item Name="Frequency">1539</Item>
<Item Name="Channels">2;3;4</Item>
</XMLPH>)(279:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">3.1600000000000001</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">7.2999999999999998</Item>
<Item Name="Frequency">7706</Item>
<Item Name="Channels">2;3;4</Item>
</XMLPH>)(269:<XMLPH version="1.1">
<Item Name="Enabled">7471104</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-6.5999999999999996</Item>
<Item Name="Frequency">7810</Item>
<Item Name="Channels">2;3;4</Item>
</XMLPH>)(251:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">0.5</Item>
<Item Name="Type">11</Item>
<Item Name="Gain">-0.5</Item>
<Item Name="Frequency">9000</Item>
<Item Name="Channels">2;3;4</Item>
</XMLPH>)(258:<XMLPH version="1.1">
<Item Name="Enabled">7274496</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">0.5</Item>
<Item Name="Type">11</Item>
<Item Name="Gain">-0.75</Item>
<Item Name="Frequency">2500</Item>
<Item Name="Channels">2;3;4</Item>
</XMLPH>)(95:<XMLPH version="1.1">
<Item Name="Enabled">32513</Item>
<Item Name="Type">20</Item>
</XMLPH>)(161:<XMLPH version="1.1">
<Item Name="Enabled">7602176</Item>
<Item Name="Type">4</Item>
<Item Name="Gain">-1.3</Item>
<Item Name="Channels">5;6</Item>
</XMLPH>)(270:<XMLPH version="1.1">
<Item Name="Enabled">6619136</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">0.2</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-1.78</Item>
<Item Name="Frequency">12.6999999999999993</Item>
<Item Name="Channels">5;6</Item>
</XMLPH>)(276:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-5.1699999999999999</Item>
<Item Name="Frequency">41.2999999999999972</Item>
<Item Name="Channels">5;6</Item>
</XMLPH>)(276:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-2.5099999999999998</Item>
<Item Name="Frequency">42.6000000000000014</Item>
<Item Name="Channels">5;6</Item>
</XMLPH>)(91:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">20</Item>
</XMLPH>)(252:<XMLPH version="1.1">
<Item Name="Enabled">7602176</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">2.31</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-15</Item>
<Item Name="Frequency">31.5</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(259:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-15</Item>
<Item Name="Frequency">104.0999999999999943</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(274:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-9.6899999999999995</Item>
<Item Name="Frequency">39.7000000000000028</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(285:<XMLPH version="1.1">
<Item Name="Enabled">-16777216</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">0.16</Item>
<Item Name="Type">10</Item>
<Item Name="Gain">6.3600000000000003</Item>
<Item Name="Frequency">73.8791999999999973</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(283:<XMLPH version="1.1">
<Item Name="Enabled">-16777216</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-14.9399999999999996</Item>
<Item Name="Frequency">61.7999999999999972</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(158:<XMLPH version="1.1">
<Item Name="Enabled">32512</Item>
<Item Name="Type">4</Item>
<Item Name="Gain">-3.83</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(154:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Delay">6.96</Item>
<Item Name="Type">7</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(260:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-6.21</Item>
<Item Name="Frequency">69.7999999999999972</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(281:<XMLPH version="1.1">
<Item Name="Enabled">6029312</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-14.9600000000000008</Item>
<Item Name="Frequency">61.6000000000000014</Item>
<Item Name="Channels">6</Item>
</XMLPH>)(91:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">20</Item>
</XMLPH>)(277:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">0.74</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-2.3900000000000001</Item>
<Item Name="Frequency">56.2000000000000028</Item>
<Item Name="Channels">5</Item>
</XMLPH>)(262:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">1.72</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-2.9500000000000002</Item>
<Item Name="Frequency">32.5</Item>
<Item Name="Channels">5</Item>
</XMLPH>)(258:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-12.5700000000000003</Item>
<Item Name="Frequency">46</Item>
<Item Name="Channels">5</Item>
</XMLPH>)(241:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-15</Item>
<Item Name="Frequency">84</Item>
<Item Name="Channels">5</Item>
</XMLPH>)(291:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">1.3300000000000001</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-5.1200000000000001</Item>
<Item Name="Frequency">73.0999999999999943</Item>
<Item Name="Channels">5</Item>
</XMLPH>)(260:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">5</Item>
<Item Name="Type">3</Item>
<Item Name="Gain">-8.92</Item>
<Item Name="Frequency">46.7000000000000028</Item>
<Item Name="Channels">5</Item>
</XMLPH>)(265:<XMLPH version="1.1">
<Item Name="Enabled">0</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">0.39</Item>
<Item Name="Type">10</Item>
<Item Name="Gain">2.9100000000000002</Item>
<Item Name="Frequency">53.0884</Item>
<Item Name="Channels">5</Item>
</XMLPH>)(91:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">20</Item>
</XMLPH>)(170:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Delay">5.7599999999999998</Item>
<Item Name="Type">7</Item>
<Item Name="Channels">5;6</Item>
</XMLPH>)(150:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">5</Item>
<Item Name="Gain">0</Item>
<Item Name="Channels">5</Item>
</XMLPH>)
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72379
  • Where did I put my teeth?
Re: NEW: DSP Presets
« Reply #1 on: December 19, 2020, 07:39:50 am »

You won't receive a reply soon.   Matt is off for a few days.  Then JRiver will be off for a week, beginning December 25.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #2 on: December 19, 2020, 02:15:01 pm »

I attempted to reverse engineer the bits I will use

format seems to be like, i.e. the 2nd value in parentheses is the no of child elements (filters) specified

Code: [Select]
<Key Name="Parametric Equalizer">
    <Data>
        <Name>Filters</Name>
        <Value>(1:1)(1:COUNT)(245:

        )</Value>
    </Data>
    <Data>
        <Name>Enabled</Name>
        <Value>1</Value>
    </Data>
</Key>

bits of interest to me, each filter is an XMLPH element with the following child Item elements

Enabled = 1
Type
    20 = Divider
Text

Enabled = 1
Slope = 12
Q
Type
    PEQ = 3
    LS = 10
    HS = 11
Gain
Frequency
Channels

Enabled
Type
    4 = Gain
Gain
Channels

where Channels is a ; separated list using the following values

Mains = 2 - 9
U1/2 = 11 - 12
9 - 32 = 13 - 36

2 things seem a mystery

* why the enabled value is often some large value?
* what is the numeric prefix for each XMLPH item? i.e. (154: in this example

Code: [Select]
(154:&lt;XMLPH version="1.1"&gt;
&lt;Item Name="Enabled"&gt;1&lt;/Item&gt;
&lt;Item Name="Delay"&gt;10&lt;/Item&gt;
&lt;Item Name="Type"&gt;7&lt;/Item&gt;
&lt;Item Name="Channels"&gt;2;3&lt;/Item&gt;
&lt;/XMLPH&gt;)

have no clue what this value is (it does not have an obvious relationship to the type or the order of the filters) but it's critical to be able to generate content in this format because if the value is wrong then it truncates the loaded file at the point it encounters an incorrect value

the same is true for the large values for enabled, get this wrong and it won't load. I guess this has to be some hex/binary value internally that has some meaning
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #3 on: December 19, 2020, 02:16:43 pm »

if the value is wrong then it fails to load the file
note that this happens silently, if I save a file and edit that number for the 3rd filter then it will load the 1st 2 filters only without any reported error. I suggest some validation here and consider supporting an undo operation.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #4 on: December 20, 2020, 03:24:41 am »

* what is the numeric prefix for each XMLPH item? i.e. (154: in this example
looks to be the no of characters in the block + 1 so I suppose that is how your decoder works (i.e. read through the content, when you encounter a left parentheses then read the number to know how many bytes to pass into an xml decoder)

* why the enabled value is often some large value?
appears that I can use 1 here to enable and it works fine as long as I adjust the segment length value accordingly


Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10924
Re: NEW: DSP Presets
« Reply #5 on: December 20, 2020, 03:59:02 am »

Maybe Matt can make this a full XML representation instead of our internal serialization format once he is back next year, if people want to support this with their tooling that would probably be much more useful.
Logged
~ nevcairiel
~ Author of LAV Filters

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #6 on: December 20, 2020, 11:49:18 am »

I've added support for JRiver as a merge target for BEQDesigner in https://github.com/3ll3d00d/beqdesigner/releases/tag/0.9.7-beta.3

it works in the same way as the minidsp support as per https://beqdesigner.readthedocs.io/en/latest/ui/merge_minidsp_xml/ , i.e.

* save your DSP config to a file
* open the merge screen
* choose jriver peq1 or 2 as the DSP device
* select your SW output channels
* click the save button

it will now generate a few thousand DSP files (depending on which repos you have selected in the app) which contain your DSP Studio config + the BEQ filters appended to the end

NB: tested on linux only atm, still need to double check there is no OS sensitivity in the way these files are handled
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #7 on: December 20, 2020, 11:50:04 am »

NB: tested on linux only atm, still need to double check there is no OS sensitivity in the way these files are handled
for anyone generating their own, the file(s) must be written with DOS line endings & I still don't entirely see how that number (that says how long the block is) is calculated as the value appears to include the length of the value itself (hence a circular dependency there). I guess it would break if it tipped it over 1000 but I guess it is never that long? Anyway I seem to be able to generate it reliably for now so will leave it at that
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #8 on: December 20, 2020, 12:03:14 pm »

related small improvements that would be v handy

* unloading per track DSP when a track ends
* allow per track DSP to be specified as an external file
* add an MCWS command for loading a specified DSP config file (perhaps supplied as a POST'ed body?)
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: NEW: DSP Presets
« Reply #9 on: December 20, 2020, 08:44:24 pm »

Maybe Matt can make this a full XML representation instead of our internal serialization format once he is back next year, if people want to support this with their tooling that would probably be much more useful.

We're just walking what is in options and storing it in XML.  What did you have in mind?
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: NEW: DSP Presets
« Reply #10 on: December 20, 2020, 08:45:58 pm »

* enabled has values 0, 1 for the most part which presumably means off & on but then there are some other random values like 7143425, 32513, 24073728 so no idea what this means, some bug?

Fixed next build.  Thanks.
Logged
Matt Ashland, JRiver Media Center

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10924
Re: NEW: DSP Presets
« Reply #11 on: December 21, 2020, 02:42:26 am »

We're just walking what is in options and storing it in XML.  What did you have in mind?

The individual items are XML, but the wrapping around them is using our internal serialization format. Making it 100% XML would be easier to understand for users.
Logged
~ nevcairiel
~ Author of LAV Filters

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #12 on: December 21, 2020, 04:14:45 am »

We're just walking what is in options and storing it in XML.  What did you have in mind?
A standard format would be easier to deal with. XML is fine if that is what you use everywhere else. Arguably JSON is easier to handle overall for clients these days but I don't really mind either way.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: NEW: DSP Presets
« Reply #13 on: December 21, 2020, 06:26:23 am »

The individual items are XML, but the wrapping around them is using our internal serialization format. Making it 100% XML would be easier to understand for users.

Well if you look at:
Computer\HKEY_CURRENT_USER\SOFTWARE\JRiver\Media Center 27\Zones\10001\Parametric Equalizer

It has a "Filters" key which is saved as XMLPH:
(1:1)(1:6)(212:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">6</Item>
<Item Name="Source">2</Item>
<Item Name="Gain">-6</Item>
<Item Name="Destination">8</Item>
<Item Name="Mode">1</Item>
</XMLPH>)(132:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">20</Item>
<Item Name="Text">--------------</Item>
</XMLPH>)(212:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">6</Item>
<Item Name="Source">4</Item>
<Item Name="Gain">-3</Item>
<Item Name="Destination">8</Item>
<Item Name="Mode">0</Item>
</XMLPH>)(212:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">6</Item>
<Item Name="Source">3</Item>
<Item Name="Gain">-6</Item>
<Item Name="Destination">9</Item>
<Item Name="Mode">1</Item>
</XMLPH>)(212:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Type">6</Item>
<Item Name="Source">4</Item>
<Item Name="Gain">-3</Item>
<Item Name="Destination">9</Item>
<Item Name="Mode">0</Item>
</XMLPH>)(244:<XMLPH version="1.1">
<Item Name="Enabled">1</Item>
<Item Name="Slope">12</Item>
<Item Name="Q">1</Item>
<Item Name="Type">11</Item>
<Item Name="Gain">8</Item>
<Item Name="Frequency">1500</Item>
<Item Name="Channels">8;9</Item>
</XMLPH>)

It's not clear there would be an easy way to morph that into its own XML?

Is that what you're talking about?  And how might we tackle that?  Thanks.
Logged
Matt Ashland, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #14 on: December 21, 2020, 06:55:38 am »

I mean just an single XML document that has nested elements as opposed to fragments of XML embedded in some internal format

For example (1:1)(1:6)(212: is completely redundant in XML terms, just have a list of child elements.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #15 on: December 30, 2020, 05:24:41 am »

I happened to notice that "Output Format" is actually saved in a section named "Audio Settings" which also has a bunch of other stuff in it that isn't set via DSP Studio.

One interesting snippet in here is

Code: [Select]
            <Data>
                <Name>Output Channels</Name>
                <Value>6</Value>
            </Data>
            <Data>
                <Name>Output Padding Channels</Name>
                <Value>2</Value>
            </Data>

the above being 5.1 in a 7.1 container

one requested feature has been to allow for larger values for "output padding channels" (mainly to handle active speaker setups with PC based crossovers), is it as simple as making that value directly configurable? if so, would be a great one to add.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #16 on: January 13, 2021, 05:28:21 am »

Fwiw the author of mso (multi sub optimiser - https://www.andyc.diy-audio-engineering.org/mso/html/index.html)  expressed some interest in being able to export filters in a jriver compatible format. Current format makes that hard as discussed above though.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: NEW: DSP Presets
« Reply #17 on: January 13, 2021, 09:33:35 am »

Fwiw the author of mso (multi sub optimiser - https://www.andyc.diy-audio-engineering.org/mso/html/index.html)  expressed some interest in being able to export filters in a jriver compatible format. Current format makes that hard as discussed above though.

What changes would make it easier?
Logged
Matt Ashland, JRiver Media Center

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #18 on: January 14, 2021, 03:41:18 am »

A standard XML format would be the minimum I think, ie just a single valid XML document as I described earlier.

A simplification for integration like this is allowing for appending a set of filters rather than loading an entire config files. This would be alongside the add/remove buttons in the peq window. It would be better if this accepted a simple format as well as your XML but that would be a nice to have rather than mandatory.

There are other usability improvements that the peq window would really benefit greatly from but those two points are what you need to let filter design tools work with MC nicely.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #19 on: February 22, 2021, 06:09:07 pm »

I've noticed that my existing method for calculating the length of a fragment does not work for mix or delay fields but have no clue why

for a PEQ, you create

Code: [Select]
(241:<XMLPH version="1.1"&gt;
<Item Name="Enabled"&gt;1</Item&gt;
<Item Name="Slope"&gt;12</Item&gt;
<Item Name="Q"&gt;1</Item&gt;
<Item Name="Type"&gt;3</Item&gt;
<Item Name="Gain"&gt;1</Item&gt;
<Item Name="Frequency"&gt;1000</Item&gt;
<Item Name="Channels"&gt;2</Item&gt;
</XMLPH&gt;)

and I create exactly the same

241 in this case being

* 226 chars of actual text (once you unescape &lt; and &gt;)
* 6 chars for the surrounding (241:)
* 8 new lines

+ 1 extra which seemed to be required

whereas a mix (add L to R) is saved by MC as

Code: [Select]
(211:&lt;XMLPH version="1.1"&gt;
&lt;Item Name="Enabled"&gt;1&lt;/Item&gt;
&lt;Item Name="Type"&gt;6&lt;/Item&gt;
&lt;Item Name="Source"&gt;2&lt;/Item&gt;
&lt;Item Name="Gain"&gt;0&lt;/Item&gt;
&lt;Item Name="Destination"&gt;3&lt;/Item&gt;
&lt;Item Name="Mode"&gt;0&lt;/Item&gt;
&lt;/XMLPH&gt;)

i.e. 198 chars of actual content + 6 for (211:) + 7 new lines = 211

so now the "+1 that seemed to be required" has disappeared for a Mix

for delay, you create

Code: [Select]
(151:&lt;XMLPH version="1.1"&gt;
&lt;Item Name="Enabled"&gt;1&lt;/Item&gt;
&lt;Item Name="Delay"&gt;0&lt;/Item&gt;
&lt;Item Name="Type"&gt;7&lt;/Item&gt;
&lt;Item Name="Channels"&gt;2&lt;/Item&gt;
&lt;/XMLPH&gt;)

i.e. 142 chars of actual content + 6 for (151:) + 5 new lines = 153

so now your stated length is actually 2 less than appears to be in the content

it would be v useful to either a) know what exactly how to calculate this number without applying magic offsets, or b) be able to just generate plain xml

Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #20 on: February 23, 2021, 03:18:56 pm »

so basically the length prefix for each filter type requires a different offset from the actual content length in order to get MC to load it, i.e. I can read in a dsp file exported by MC, turn it into a list of key-value pairs and then write it back into a new dsp file generating the xml fragment on the fly. The resulting files are identical and are loaded correctly by MC but only if I adjust the length field for each filter type by a different value as per the below

written as

filter type (filter type id): adjustment required vs raw text length

Code: [Select]
Peak (3): 2
HighShelf (11): 2
LowShelf (10): 2
Gain (4): -1
BitdepthSimulator (13): -1
Delay (7): -1
Limiter (9): 3
LinkwitzTransform (8): 3
LinkwitzRiley (16): -2
MidSideDecoding (19): -2
MidSideEncoding (18): -2
Mix (6): 1
Mute (5): -1
Order (12): -2
LowPass (1): 2
HighPass (2): 2
Polarity (15): -2
SubwooferLimiter (14): -1

none of them match the text content :)

I cannot see a pattern to this either so it's a bit of a mystery, will stick with magic numbers for now but would be nice to know why it differs.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2567
Re: NEW: DSP Presets
« Reply #21 on: February 23, 2021, 04:57:30 pm »

You're over thinking it.
The count value is just the length of the text between the colon and the last close-parenthesis (the XML), with newlines counting double (CR+LF).
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4196
Re: NEW: DSP Presets
« Reply #22 on: February 24, 2021, 01:16:24 am »

You're right, it really is that simple  :) I could have sworn that is how I first calculated the value but it didn't work, must have had some other bug at the time that threw me off.
Logged
Pages: [1]   Go Up