Welcome to Decent Sampler Q&A, where you can ask questions and receive answers from other members of the community.
+6 votes

Hello Dave!

Not exactly a question, more of a "hidden feature" from XML code.

it is possible to use XLM entities to refer to data that you will use very often, or when you might want to be able to quickly change a bunch of elements with just a simple code change.

In my case I have used to do the mapping in my Drum Library, so I can quickly change the kit pieces to the notes I want. Let me show a little how it works.

Declaring an entity should look like this:

<!DOCTYPE DOCUMENTNAME [
<!ENTITY NAME "VALUE">
]>

It will be declared in the top of the document,  after the <?xml... and before the <DecentSampler> element, like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Mapping [
  <!ENTITY Kick "036">
  <!ENTITY Rim "037">
  <!ENTITY Snare "038">
  <!ENTITY TomLo "041"

  <!ENTITY SampleVol "6dB">
  <!ENTITY LabelColor "FFFFFFFF">
]>

<DecentSampler pluginVersion="">
...

Like this, I can change all my kick or snare sample notes, just by changing the entity element. See that in the sample element, the rootNote, loNote and hiNote uses the &Kick; instead of the note number. This way, everything that is receiving &Kick; will be receiving 036 instead, because this is the value that was defined in the entity declaration. It's a huge time saver for big libraries like this one, where I'll have different round-robins and mic positions for each drum kit piece. 

<group name="Kick" volume="&SampleVol;">
  <sample path="samples/Kick_Dir_001-037_rr1.wav" rootNote="&Kick;" loNote="&Kick;" hiNote="&Kick;" loVel="001" hiVel="037" seqPosition="1" tags="Kick_Dir"/>
  <sample path="samples/Kick_Dir_030-064_rr1.wav" rootNote="&Kick;" loNote="&Kick;" hiNote="&Kick;" loVel="030" hiVel="064" seqPosition="1" tags="Kick_Dir"/>
  <sample path="samples/Kick_Dir_059-099_rr1.wav" rootNote="&Kick;" loNote="&Kick;" hiNote="&Kick;" loVel="059" hiVel="099" seqPosition="1" tags="Kick_Dir"/>
...

Also in that entity delcaration, I used to define the main color of my labels, and the default sample volume, so, it can be suited to your needs.
Please note that reffering to an entity is expressed a little bit different than receiving a value. You'll need to express it this way, starting with & and ending with ;  

hiNote="&Kick;" loVel="001"

Hope this makes sense and I could make myself understandable.

Also, if it makes sense, might be valid and useful mentioning it in the format-documentation as a tool somehow.

in Other by mauriloureiro (830 points)
edited by mauriloureiro

2 Answers

+1 vote
 
Best answer
This is really cool! I had no idea that could work.
by decentsamples (6.3k points)
selected by mauriloureiro
0 votes

Thanks so much, this is awesome!

Is there any way to change one of these variables using a Decent Sampler knob/control element? I'm wanting to set up a control to vary the Start attributes of my samples and I don't think there's a way to do that natively, though I could be wrong!

Thanks again!

by tobias-f-james (860 points)
...