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

Found <midi></midi> elements to save midi cc assignments in few .dspreset files. Could not find any explanations in format-documentation. Any plans to add some description and examples there?

Example 1:
<midi>
    <cc number="11">
      <binding level="ui" type="labeled_knob" position="0" parameter="value" translation="linear" translationOutputMin="0" translationOutputMax="1.0"/>
    </cc>
    <cc number="1">
      <binding level="ui" type="labeled_knob" position="1" parameter="value" translation="linear" translationOutputMin="0" translationOutputMax="1.0"/>
    </cc>
  </midi>

 

Example 2:
    <midi>
    <cc number="11">
      <binding level="ui" type="labeled_knob" position="1" parameter="value" translation="linear" translationTable="0,200;30,355;60,850;90,4950;128,22000"   translationOutputMin="0" translationOutputMax="1"/>
    </cc>
    <cc number="1">
      <binding level="ui" type="labeled_knob" position="0" parameter="value" translation="table" translationTable="0,200;30,355;60,850;90,4950;128,22000"   translationOutputMin="0" translationOutputMax="1"/>
    </cc>
  </midi>

Something like below ccNumber ="1" would be intuitive way to assign a cc control to a certain knob:

<labeled-knob x="617" y="80" label="release" type="float" minValue="0.0" maxValue="5.0" value="1.75" textColor="FFFFFFFF"
textSize="16" width="120" height="120" trackForegroundColor="E63D99F4" trackBackgroundColor="80808080">
<binding type="amp" level="instrument" position="0" parameter="ENV_RELEASE" ccNumber ="1"/>
</labeled-knob>

in Using the Sampler by Juu Pek (170 points)

1 Answer

0 votes

Hi! Apologies for the super late reply. I've finally documented the <midi> section. You can see the new docs here

Basically, the way it works is that you have a top-level <midi> section within your instrument. Underneath that you have entries for each CC number you want to listen on, and underneath that you have entries for your bindings:

<midi>
    <cc number="1">
        <binding></binding>
    </cc>
    <cc number="11">
        <binding></binding>
    </cc>
</midi>

As for bindings, you can use all the same bindings that you would use with knobs or sliders, but with the addition of a new type called labeled_knob. If you have a knob that is already targeting the same specific parameter that you want to be able to change in your instrument, you will want to use that so that you are moving the knob instead of simply changing the underlying parameter. Here's an example from the Soft String Spurs instrument:

<midi>
  <cc number="11">
    <binding level="ui" type="labeled_knob" position="0" parameter="value" translation="linear" translationOutputMin="0" translationOutputMax="1"/>
  </cc>
  <cc number="1">
    <binding level="ui" type="labeled_knob" position="1" parameter="value" translation="linear" translationOutputMin="0" translationOutputMax="1"/>
  </cc>
</midi>

As you can see, we are targeting two knobs at positions 0 and 1. These numbers are the indexes of the knob positions in the <tab> section from above. Where things get complicated is that when coming up with index positions for your labeled_knob bindings (0 and 1 in this case), all controls (including labels) count in that number scheme. So if you have a bunch of labels, you will need to account for that in your numbering. By the way, these <midi> bindings are what is added by the MIDI learn functionality.

by decentsamples (6.3k points)
...