Fader dB files

When a fader is moved in a daw, the dB value is displayed in the daw, but a raw midi value is sent to external devices. Translating that raw midi value back to a dB value is no easy task for the plugin since volume faders use a logarithmic scale, and each daw has a unique scale implemented.

The only reasonable way (that I have found) is to take many sample points where the raw midi value is stored together with the dB value displayed by the daw. These sample points (I suggest 100+) are stored in an XML file and that file is used when the corresponding daw is selected in the dB value section of the Value display dropdown.

When the plugin receives a fader midi value, the file is checked to see if that exact value is a registered sample point, in which case the registered dB value is used. If the received value is in-between two registered sample points, the plugin will calculate the dB value based on the information in the two sample points. With few sample points in the file, there is a risk that the displayed dB value in the plugin differs from that in the daw since the calculation may be inaccurate. So, the more sample points there are, the better the dB value accuracy is.

Quick and "easy" configuration

Copy one of the built-in dB fader files. Register a large amount of sample points. You're done. :-)

  1. Copy a suitable file from "%appdata%\Elgato\StreamDeck\Plugins\se.trevligaspel.midi.sdPlugin\dBCurves" (Windows) or "~/Library/Application Support/com.elgato.StreamDeck/Plugins/se.trevligaspel.midi.sdPlugin/dBCurves" (macOS) and paste it to "Documents\Trevliga Spel\dBCurves" (create the folder if it doesn't exist; files must be stored in that folder, it's the only place where the plugin is looking for them). Filenames starting with "db_" are targeted at the Mackie Control action, while filenames beginning with "db127_" are targeted at the Control Change action. All the files have the same structure, so unless you intend to add extra sample points to an existing file, it doesn't matter that much which file you copy.
  2. If you want to refine the samples for an existing file, please keep the file name unchanged (in which case the plugin will use your copy instead of the built-in file). If you want to add a file for a new daw, please rename it (wisely) and change the name attribute in the file to whatever you want to see in the dropdown.
  3. Configure a Stream Deck button to display the midi value for a fader.
  4. Move the fader in small steps (either in the daw or by using Stream deck buttons) and register as many sample points as you endure, creating one Value row for each sample point (100+ sample points evenly spread is a good starting point...).
  5. Save the file.
  6. Select the new entry in the plugin.
  7. Move the fader, and watch in awe how reasonably accurate dB values are being displayed in Stream Deck.
  8. Take a rest and a cup of coffee; you're worth it. :-)

A bit more detailed configuration

In the installed plugin folder, the subfolder dBCurves contains the built-in xml files for the various daws. The Value display dropdown in the editor is populated with the name attributes from the files found (with a valid content)

Please do not edit the files in the dBCurves folder.
In case a bundled dB file needs improvements or if you want to add a file for another daw, please do as follows:

  1. Create a folder Trevliga Spel in your Documents folder (if it's not already there...)
  2. Create a folder dBCurves in the Trevliga Spel folder.
  3. If you want to change an existing dB file: copy the file you want to improve from the plugin dBCurves folder to your Trevliga Spel/dBCurves folder. Do not rename the file.
  4. If you want to create a new dB file: copy one of the files from the plugin dBCurves folder to your Trevliga Spel/dBCurves folder and rename the file to reflect the new daw. Change the name attribute in the beginning of the file to whatever text you want to see in the dropdown.
  5. Make whatever changes you want (as described below) to the file in your Trevliga Spel/dBCurves folder.

If the plugin finds a file in your personal folder with the same name as a file in the plugin folder, the file in your personal folder will be used. The fact that the file is found in the personal folder is indicated by an asterisk before the name in the dropdown.

The files have the following format:

										<?xml version="1.0" encoding="utf-8" ?>
<dBCurve name="Cubase/Nuendo, 12dB" decimals1="2" decimals2="1" decimals3="1" version="1">
  <Values>
    <Value midivalue="26" dbvalue="-104"/>
    <Value midivalue="53" dbvalue="-98"/>
    <Value midivalue="79" dbvalue="-94.5"/>
    .
    .
    .
    <Value midivalue="15612" dbvalue="7.46"/>
    <Value midivalue="16039" dbvalue="8.9"/>
    <Value midivalue="16369" dbvalue="10.33"/>
  </Values>
</dBCurve>
									
File syntax
Attribute Description
name The text to be displayed in the dropdown dB value section of the Display Value dropdown in either the Mackie Control or the Control Change action.
decimals1, decimals2, decimals3 The number of decimals to display depending on the number of integers in the dB value. (Please note that this is independent on the number of decimals entered in the dbvalue field.)
  1. decimals1 = number of decimals to display for dB values between 0 and 9 (positive or negative)
  2. decimals2 = number of decimals to display for dB values between 10 and 99 (positive or negative)
  3. decimals3 = number of decimals to display for dB values between 100 and 999 (positive or negative)
version Not used by the plugin, you can use that attribute keep track on changes you make.
midivalue This is the raw midi value for the sample point and should be registered as an integer. For the Control Change action, this value is in the range 0 - 127, while the Mackie Control action has a range of 0 - 16383.

Important: The plugin will select the available files based on the max value for the midivalue attribute in each file. If the max value is higher than 127, the file will be added to the Mackie Control dropdown; if the max value is 127 or lower, it will be added to the Control Change dropdown.
dbvalue This is the dB value to be used in calculations when midi values are received. The value is a decimal with an optional number of decimals. The plugin treats decimal point (.) and decimal comma (,) in the same way, so you can use whatever notion is natural for you. ("12.5" and "12,5" are both treated as "twelve and a half")
  • You don't have to register the Value rows in (midivalue) numerical order, but I highly recommend doing so.
  • Recevied midi values lower than the lowest registered value will be displayed as "-Inf".
  • Recevied midi values higher than the highest registered value will be displayed as the highest registered value.
File naming

File names are important since when you select a dB file in the dropdown, it is, in fact, the file name you choose. You can change the name attribute in the file without losing the link between a button and the selected dB file, but if you change the file name, all buttons that reference that file will lose their configuration. The plugin doesn't have any requirements at all for the file names. The following naming convention has been used for the built-in files; you can use the same naming convention or something completely different.

  • File names for the Mackie Control action (with a midivalue range of 0 - 16383) are prefixed with "db_".
  • File names for the Control Change action (with a midivalue range of 0 - 127) are prefixed with "db127_". Please note that these two "rules" only let us humans understand the difference between the files; when deciding where to display the different files, the plugin looks at the file content, not the file name.
  • After the prefix, the target daw name is used.
  • Finally, the max dB value for the target fader is used. This was primarily necessary for Cubase/Nuendo that can have both 6dB and 12dB as max value for the faders, but I've used the same structure for all file names.
  • Examples: "db_Bitwig6db.xml", "db127_Cubase12db.xml", "db_StudioOne10db.xml".

Formatting guidelines

In an xml file some characters are reserved for the xml structure itself, and you must not use those characters when defining texts. If you want to have any of the following characters displayed in the dropdowns, please use the following replacement strings (without the quotes):

  • To display the < character, please use "&lt;"
  • To display the > character, please use "&gt;"
  • To display the & character, please use "&amp;"
  • To display the " (quote) character, please use "&quot;"
  • To display a line feed, please use "&#xA;"