Author Topic: Equalizer Settings  (Read 770 times)

Zzyzx

  • Posts: 60
Equalizer Settings
« on: 30 Mar '18 - 22:13 »
Are there any docs for how the equalizer settings (specifically the level for each band) are saved in xmplay.ini?

I assume they are all encoded in the DSP section? I would guess they are some format of number (floating point?), hex encoded?

Any pointers on how exactly the equalizer settings are encoded into that giant hex string appreciated! A pointer to a code snippet would work, too.

FWIW, my objective is to be able to easily set the band levels to a specific dB value without needing to mess around with the sliders (which usually limit the resolution to something like 0.3dB).

Many thanks,
Paul

Ian @ un4seen

  • Administrator
  • Posts: 21326
Re: Equalizer Settings
« Reply #1 on: 4 Apr '18 - 17:07 »
The equalizer settings are indeed stored in the XMPLAY.INI "DSP" entry. The problem is that also includes the settings of the reverb and any active DSP plugins. Still, if you just want to set the EQ gains and don't care about any other DSP settings, then it may be simple enough. Try setting the "DSP" entry to "0001280001000000" followed by the 9 band gains, which are 32-bit floating-point numbers in hex form (so 8 bytes per band). If you're interested in details: "0001" is the EQ id, "2800" (40) is the size of the settings, "01000000" (1) is the on/off switch.

Zzyzx

  • Posts: 60
Re: Equalizer Settings
« Reply #2 on: 5 Apr '18 - 01:56 »
Thanks for the pointers!

I do have other DSP settings (amp, auto-amp, replay-gain, log volume) that I want to keep, not just the EQ settings.

My DSP string is: FF0001002800010000008EE398409A999940398E4340FDFF7FBF673E69BF3333B3BF9CDF0240CDCCAC40F549FF40000200100000000000000000000000000000008041

If I try to line things up with what you provided, there is an additional FF00 on the front, I have 0100 instead of 0001, and the 2800 and 01000000 match.

If I understand correctly, wouldn't a 32 bit float be 4 bytes, not 8? Which would be 8 hex characters (4 pairs)? If so, 9 bands would be a block of 72 characters, I think?

Do the EQ settings come next after the 01000000 (the next 72 characters), or are they further out (I have another 114 characters, 134 total) in my DSP string.

If you have any further info on how everything is packed into that string, or at least where the 72 characters of EQ settings are at, that would be great. Again, I can read C/C++, Java, whatever, so a code snippet that packs the string would be fine, I can figure it out.

Many Thanks!

The equalizer settings are indeed stored in the XMPLAY.INI "DSP" entry. The problem is that also includes the settings of the reverb and any active DSP plugins. Still, if you just want to set the EQ gains and don't care about any other DSP settings, then it may be simple enough. Try setting the "DSP" entry to "0001280001000000" followed by the 9 band gains, which are 32-bit floating-point numbers in hex form (so 8 bytes per band). If you're interested in details: "0001" is the EQ id, "2800" (40) is the size of the settings, "01000000" (1) is the on/off switch.

Ian @ un4seen

  • Administrator
  • Posts: 21326
Re: Equalizer Settings
« Reply #3 on: 5 Apr '18 - 17:43 »
The "FF" at the start of the "DSP" entry indicates a later form of DSP settings. In that case, there is an extra 2 bytes/characters after the "0001", which you can just set to "00". Regarding my "8 bytes per band" comment, I meant 8 characters.

If you put "Equalizer (built-in)" at the top of the list in the DSP plugins options page then the EQ settings will be first in the "DSP" entry, which would make it simpler for you to just replace the band gains in that part of the string and leave the rest as it is.