GuitarML / Proteus

Guitar amp and pedal capture plugin using neural networks.
GNU General Public License v3.0
155 stars 12 forks source link

When loading a state, the text-field on the model picker doesn't update #9

Closed ylmrx closed 1 year ago

ylmrx commented 1 year ago

... when we click load model, it shows the right (ie. last visited) folder, and the model is loaded correctly. Hence it seems we are only missing some .setText, after the setState does its thing, and also reload the attached list (as im guessing, every fd related stuff are reset upon load) I'll look into it tonight.

Take care

GuitarML commented 1 year ago

@ylmrx Thanks for reporting, I'm looking into a similar issue where the text in the dropdown doesn't show up after loading saved preset in a new instance of Proteus. In all other cases I'm seeing the drop down update correctly. Is this what you're seeing as well, or something different? If it is different, can you verify which version of Proteus you're using? (version 1.2 is the latest) And which DAW, and operating system are you using, thanks!

ylmrx commented 1 year ago

hi, it sounds like we're dealing with the same issue.

I'm able to reach for the model name by making the chooser public, like you did with editor->resetImages()

Here's the code i get so far (in process/LoadConfig(file)):

     if (LSTM.input_size == 1) {
         conditioned = false;
     } else {
         conditioned = true;
     }

+    if(auto* editor = dynamic_cast<ProteusAudioProcessorEditor*> (getActiveEditor())) {
+        editor->modelSelect.setText(saved_model.getFileNameWithoutExtension());
+        Array<File> files = configFile.getParentDirectory().findChildFiles(2, false, "*.json");
+        for (auto file : files) {
+            if (editor->isValidFormat(file)) {
+                editor->modelSelect.addItem(file.getFileNameWithoutExtension(), jsonFiles.size() + 1);
+                jsonFiles.push_back(file);
+                num_models += 1;
+            }
+        }
+
+    }

     //saved_model = configFile;
     model_loaded = true;
     this->suspendProcessing(false);

this is taken from the editor' loadFromFolder() method, but the maths are wrong, and thus it init well, the chooser is messed-up and crashes the vst if you try to use it, this needs more works.

I'm really tired, and will leave it for now, but please advise wether you like this approach.

(regarding my test setup, nothing too fancy here : win11 , proteus1.2, bitwig5/live11, vst3)

GuitarML commented 1 year ago

@ylmrx This should be fixed in my updates-v1-3 branch, I'm planning on adding some other updates so it might be awhile before it gets to an official release, but it's there if you want to use it.

ylmrx commented 1 year ago

It was just that single line ? :D

awesome, this fixes it for me, closing the issue now, thanks again.