I’m in the process of making a wavetable synthesizer, and I want to implement a combo box that has a list of all the wave files in a directory. I want it to be similar to how Serum does its wavetable select. I’m having a hard time finding relevant resources, so I was hoping to get some guidance here. Here is my current attempts, which is called in the “createParameters()” function passed to the constructor of the APVTS that I’m using:
std::vector<std::unique_ptrjuce::RangedAudioParameter> params;
juce::StringArray wt_names;
wt_names.clear();
// const std::string WT_DIR { “C:\Users\myName\Documents\Xfer\Serum Presets\Tables\Analog” };
for (const auto& filenameThatWasFound : juce::File(WT_DIR).findChildFiles(2, false, “*.wav”)) {
wt_names.add(filenameThatWasFound.getFileNameWithoutExtension());
}
// Oscillator Select
params.push_back(std::make_uniquejuce::AudioParameterChoice(
“_OSC1”, // Parameter ID
“Oscillator 1”, // Parameter name
wt_names, // List of options
0 // Default list index
));
// instantiate the rest of the parameters
Currently, the plugin immediately crashes. Any guidance would be extremely helpful.