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 <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. |