The <ui> element
The <ui>
element is how you specify a user interface for your instrument. Each dspreset should have at most one <ui>
element. There are several important attributes:
coverArt
(optional): A relative or absolutely path to a cover art image to use. After the first time this library is opened, this will get displayed on the “My Libraries” tab.bgImage
(optional): A relative or absolutely path to a background image to use.bgColor
(required): An eight digit hex value indicating the background color to be used for the background of the UI. This color will be drawn underneath any background image specified bybgimage
.width
(required): The width of your user interface. Recommended value: 812.height
(required): The height of your user interface. Recommended value: 375.
Example:
<DecentSampler>
<ui width="812" height="375">
<tab name="main">
<labeled-knob x="560" y="0" label="Tone" type="float" minValue="60" maxValue="22000"
textColor="FF000000" value="22000.0" uid="y8AA4uuURh3">
<binding type="effect" level="instrument" position="0" parameter="FX_FILTER_FREQUENCY"/>
</labeled-knob>
<label x="360" y="0" width="50" height="30" text="Reverb"/>
<control x="360" y="30" parameterName="Reverb" type="float" minValue="0" maxValue="1" textColor="FF000000" value="0.5">
<!-- Your <binding /> elements should go here -->
</control>
</tab>
</ui>
</DecentSampler>
The <tab> element
The <tab>
element lives underneath the <ui>
element. This architecture was chosen because we may, at some point, add support for multiple tabs. At present it is only possible to have a single tab within DecentSampler instruments. As such, every UI must have at most one <tab>
element.
Attributes:
name
(optional): An optional name to be associated with this tab. This is currently not displayed anywhere.
The <image> element
The <image>
element allows you to place a static image into your user interface. It lives underneath the <tab>
element. Attributes:
x
(required): Thex
position of your image where (0,0) is the top-left cornery
(required): They
position of your image where (0,0) is the top-left cornerwidth
(required): The width in pixels of the image componentheight
(required): The height in pixels of the image componentpath
(required): The relative path of the image file to show in this componentaspectRatioMode
(required): Whether or not the engine should preserve the aspect ratio of the image. Note: regardless of these settings, you still need to specify a width and height for your image element. Valid values:preserve
,stretch
. Default value ispreserve
.visible
(optional): This controls whether or not this image is visible. There are two valid values:true
(default),false
.tooltip
(optional): A tool tip to display when the user hovers over this image.
The <label> element
The <label>
element allows you to place a static block of text into yoru user interface. It lives underneath the <tab>
element. Attributes:
x
(required): Thex
position of your control where (0,0) is the top-left cornery
(required): They
position of your control where (0,0) is the top-left cornertext
(required): The actual text that should be displayed as part of the label.textColor
(optional): An 8 digit hex value indicating the text color to be used for the label. See Appendix A for an explanation on these hex values.textSize
(optional): A font size for the text label. Default: 12width
(required): The width in pixels of the label.height
(required): The height in pixels of the label.vAlign
(optional): The vertical alignment of the text within the box described by the width and height attributes. Valid values:top
,bottom
,center
. Default iscenter
.hAlign
(optional): The horizontal alignment of the text within the box described by the width and height attributes. Valid values:left
,right
,center
. Default iscenter
.visible
(optional): This controls whether or not this text label is visible. There are two valid values:true
(default),false
.tooltip
(optional): A tool tip to display when the user hovers over this label.
A label’s text can also be set dynamically using bindings using the TEXT
binding parameter name.
The <labeled-knob> and <control> elements
The <labeled-knob>
and <control>
elements live underneath the <tab>
element. These tags correspond to user controls (usually round radial dials) that can be used as part of a UI. These two element types are the same except that <labeled-knob>
elements contain built-in labels, where as <control>
elements do not. Every tab can have many <control>
or <labeled-knob>
elements underneath it.
For precise UI creation, it may be advisable to use a combination of <control>
& <label>
elements rather than <labeled-knob>
.
Attributes:
x
(required): Thex
position of your control where (0,0) is the top-left cornery
(required): They
position of your control where (0,0) is the top-left cornerwidth
(required): The width in pixels of the knob + label.height
(required): The height in pixels of the knob + label.parameterName
(required): In a situation where the sampler does not have enough room to display the full UI, a shrunken down version of the UI will be used. In such situations, this control will be labeled using theparameterName
. It is good practice to always include aparameterName
. If notparameterName
is specified and a valuelabel
is specified, then that will be used instead.style
(optional): The specific kind of control that is created. The following values are supported:linear_bar
,linear_bar_vertical
,linear_horizontal
,linear_vertical
,rotary
,rotary_horizontal_drag
,rotary_horizontal_vertical_drag
,rotary_vertical_drag
,custom_skin_vertical_drag
,custom_skin_horizontal_drag
. Default:rotary_vertical_drag
.showLabel
(optional): A true/false value dictating whether or not a built-in label should be displayed. Default: true for<labeled-knob>
and false for<control>
elementslabel
(optional): IfshowLabel
is true, the actual text that should be displayed above the control.parameterName
(required): In a situation where the sampler does not have enough room to display the full UI, a shrunken down version of the UI will be used. In such situations, this control will be labeled using theparameterName
. It is good practice to always include aparameterName
.minValue
(optional): The minimum value of your control. Default: 0maxValue
(optional): The maximum value of your control. Default: 1value
(optional): The initial value of your control. Default: 0defaultValue
(optional): If a user double-clicks on the control, the control’s value will be set to this default value. If no default value is specified, then nothing will happen on double-click.valueType
(optional): There are three possible values for thisfloat
which yields numbers with two decimal points,integer
which yields whole numbers, andmusical_time
which yields musical time increments in beats and measures. This last option is for use with the built-in delay effect only. Default: floattextColor
(optional): An 8 digit hex value indicating the text color to be used for the label. See Appendix A for an explanation on these hex values.textSize
(optional): A font size for the text label. Default: 12trackForegroundColor
(optional): An 8 digit hex value indicating the foreground color to use for the knob track. See Appendix A for an explanation on these hex values.trackBackgroundColor
(optional): An 8 digit hex value indicating the background color to use for the knob track. See Appendix A for an explanation on these hex values.visible
(optional): This controls whether or not this control is visible. There are two valid values:true
(default),false
.tooltip
(optional): A tool tip to display when the user hovers over this control.snapMode
(optional): This attribute controls how the control should snap to values. Valid values:none
,whole_numbers
,tenths
,hundredths
,thousandths
, andstop_points
. Default: none.snapStopPoints
(optional): A comma-separated list of values that the control should snap to whensnapMode
is set tostop_points
. Default: none.defeatSnapWithShift
(optional): A true/false value indicating whether or not the user can defeat the snap-to-value behavior by holding down the shift key. Default: false.
It is also possible to use custom control graphics using the following attributes:
customSkinImage
(optional): This is path to an image to use for the control. This is expected to be a JPEG or PNG in KnobMan format. A huge gallery of compatible knobs can be found here (https://www.g200kg.com/en/webknobman/gallery.php).customSkinNumFrames
(optional): The number of animation frames contained in the KnobMan image pointed to bycustomSkinImage
.customSkinImageOrientation
(optional): The orientation of the frames within the KnobMan image pointed to bycustomSkinImage
. Valid values:horizontal
,vertical
. Default: vertical.mouseDragSensitivity
(optional): An integer number describing how sensitive the control should be to mouse drags. The higher the number, the less sensitive the control will be to mouse movements.
If you are using custom knobs, it’s important that you specify a style=
value of either custom_skin_vertical_drag
or custom_skin_horizontal_drag
.
Example:
<DecentSampler>
<ui>
<tab>
<labeled-knob x="560" y="0" label="Tone" type="float" minValue="60" maxValue="22000" textColor="FF000000" value="22000.0">
<!-- Your <binding /> elements should go here -->
</labeled-knob>
<label x="360" y="0" width="50" height="30" text="Reverb"/>
<control x="360" y="30" parameterName="Reverb" type="float" minValue="0" maxValue="1" textColor="FF000000" value="0.5" style="custom_skin_vertical_drag" customSkinImage="Samples/ENIGMA-nolight.png" customSkinNumFrames="31" customSkinImageOrientation="horizontal" mouseDragSensitivity="100">
<!-- Your <binding /> elements should go here -->
</control>
</tab>
</ui>
</DecentSampler>
To learn how to make knobs actually control parameters of your instrument, see “Appendix B: Bindings” section below.
The <xyPad> element
The <xyPad>
element allows you to create a two-dimensional pad control within your UI. This control functions almost like two sliders, one for the x-axis and one for the y-axis.
Attributes:
x
(required): Thex
position of your control where (0,0) is the top-left cornery
(required): They
position of your control where (0,0) is the top-left cornerwidth
(required): The width in pixels of the control.height
(required): The height in pixels of the control.markerDiameter
(optional): The diameter of the marker that moves around the control. Default: 10markerOutlineColor
(optional): An 8 digit hex value indicating the color of the marker’s outline. See Appendix A for an explanation on these hex values.markerFillColor
(optional): An 8 digit hex value indicating the color of the marker’s fill. See Appendix A for an explanation on these hex values.outlineColor
(optional): An 8 digit hex value indicating the color of the control’s outline. See Appendix A for an explanation on these hex values.bgColor
(optional): An 8 digit hex value indicating the color of the control’s background. See Appendix A for an explanation on these hex values.tooltip
(optional): A tool tip to display when the user hovers over this control.
The <x> and <y> elements
Below the <xyPad>
element, you can specify <x>
and <y>
elements. These elements are used to specify the bindings for the x and y axes of the control.
Example:
<xyPad x="10" y="10" width="300" height="100" parameterName="Pad" xValue="0.5" yValue="0.5" bgColor="77FFCC00" markerFillColor="FFFFFFFF" outlineColor="77FFFFFFF">
<x>
<binding type="amp" level="group" groupIndex="0" parameter="AMP_VOLUME" translation="linear" translationOutputMin="0" translationOutputMax="1" />
<binding type="amp" level="group" groupIndex="1" parameter="AMP_VOLUME" translation="linear" translationOutputMin="1" translationOutputMax="0" />
</x>
<y>
<binding type="effect" level="instrument" effectIndex="0" parameter="FX_FILTER_FREQUENCY"
translation="table"
translationTable="0,33;0.3,150;0.4,450;0.5,1100;0.7,4100;0.9,11000;1.0001,22000"/>
</y>
</xyPad>
The <keyboard> element
The <keyboard>
element lives underneath the <ui>
element. This is where you specify settings relating to the on-screen keyboard. There should be only one <keyboard>
element in your preset file. At this point, the only settings are color ranges which are specified using <color>
sub-elements.
The <color> element
You can use <color>
elements to change the color of portions of the on-screen keyboard. You can have as many <color>
elements as you like. Only white keys are affected. It’s worth noting that colors specified in the <color>
elements are overlayed on top of the white keys using a 75% transparency, so choose your colors accordingly. This is done to preserve the readability of the key labels.
<DecentSampler>
<ui>
<!-- Other stuff here -->
<keyboard>
<color loNote="36" hiNote="50" color="FF2C365E" />
<color loNote="51" hiNote="57" color="FF6D9DC5" />
<color loNote="58" hiNote="67" color="FFCCF3F5" />
<color loNote="68" hiNote="73" color="FFE8DA9B" />
<color loNote="74" hiNote="84" color="FFD19D61" />
</keyboard>
</ui>
<!-- Other stuff here -->
</DecentSampler>
Attribute |
Description |
|
---|---|---|
|
(required) |
The bottom of the range for which this color should be displayed. Format: MIDI Note number. |
|
(required) |
The top of the range for which this color should be displayed. Format: MIDI Note number. |
|
(required) |
A text representation of the color to be used for this key range. See Appendix A for an explanation on these hex values. |