MCPcopy Create free account
hub / github.com/GuitarML/NeuralPi / loadConfig

Method loadConfig

Source/PluginProcessor.cpp:330–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330void NeuralPiAudioProcessor::loadConfig(File configFile)
331{
332 this->suspendProcessing(true);
333 String path = configFile.getFullPathName();
334 char_filename = path.toUTF8();
335
336 try {
337 // Check input size for conditioned models
338 // read JSON file
339 std::ifstream i2(char_filename);
340 nlohmann::json weights_json;
341 i2 >> weights_json;
342
343 int input_size_json = weights_json["/model_data/input_size"_json_pointer];
344 LSTM.input_size = input_size_json;
345 if (input_size_json == 1) {
346 is_conditioned = false;
347 LSTM.load_json(char_filename);
348 }
349 else {
350 is_conditioned = true;
351 LSTM.load_json2(char_filename);
352 }
353 model_loaded = 1;
354 }
355 catch (const std::exception& e) {
356 DBG("Unable to load json file: " + configFile.getFullPathName());
357 std::cout << e.what();
358 }
359
360 this->suspendProcessing(false);
361}
362
363void NeuralPiAudioProcessor::loadIR(File irFile)
364{

Callers 2

modelSelectChangedMethod · 0.80
loadButtonClickedMethod · 0.80

Calls 2

load_jsonMethod · 0.80
load_json2Method · 0.80

Tested by

no test coverage detected