I’m not sure if I understand it the right way. I try to make use of the group feature for audio parameters.
The plan was to use it to create a readable preset file.
I tried the following:
AudioProcessorValueTreeState::ParameterLayout layout;
auto pads = std::make_unique<AudioProcessorParameterGroup>("pads", "Pads", " | ");
for (int i = 0; i < TalSampler::NumberOfPads; i++)
{
auto outputParam = std::make_unique<AudioParameterInt>("output" + getPadPostfix(i), "Output " + getPadPostfix(i), 0, 7, 0);
pads->addChild(std::move(outputParam));
auto mappings = std::make_unique<AudioProcessorParameterGroup>("mappings", "Mappings", " | ");
for (int j = 0; j < TalPad::NumberOfMappings; j++)
{
auto mappingVolumeParam = std::make_unique<AudioParameterInt>("volume" + getPadMappingPostfix(i, j), "Volume " + getPadPostfix(i), 0, 7, 0);
mappings->addChild(std::move(mappingVolumeParam));
}
pads->addChild(std::move(mappings));
}
layout.add(std::move(pads));
I expected to get a hierarchical XML as an output where the groups are also visible in the XML but i got the following result with all parameters in the root:
<?xml version="1.0" encoding="UTF-8"?>
<ProjectX>
<PARAM id="midinote00" value="36.0"/>
<PARAM id="midinote01" value="36.0"/>
<PARAM id="midinote02" value="36.0"/>
<PARAM id="midinote03" value="36.0"/>
<PARAM id="midinote04" value="36.0"/>
<PARAM id="midinote05" value="36.0"/>
...
Can anybody tell me what I’m doing wrong?