Issue with the States module + If modules

Hello Mario Nieto, hello MNodes users and developers,

This is my second post regarding the States module.
You can find the first one here: Problems with the States module

In my previous post, I already discussed the problems that arise when trying to use the States module to create a way to save user patches.

Unfortunately, the situation in this area hasn’t improved for me with version v1.0.9 either.
MNodes still crashes whenever I close the program or load a different project if I have integrated a States module into a subgraph or another module.
The crash is so severe that it drags the DAW (Ableton Live 12) down with it.

Furthermore, the values ​​of combo boxes, toggle buttons, and often radio groups are still not being saved. These are persistent controls, after all, and their values ​​​​ought to be preserved.
For instance, I nearly gave up in frustration while trying to develop a small step sequencer—modeled after classic analog hardware-based on the Riff Generator in a test project.
I eventually quit because the States module flatly refused to save the settings for the controls used to toggle individual steps on and off. I tried using toggle buttons (the obvious choice), but radio groups didn’t save the state either.

However, the main reason I’m writing this is a different - and, in my view, far more significant - issue:
I happened to notice that the States module also alters the properties of If-modules.
I have to admit, I wasn’t expecting that. I first noticed this while troubleshooting an elusive error - one of those nasty bugs where things work sometimes but not others.
I then realized that it obviously depends (yet again) on the saved state.
Upon closer inspection, I discovered that switching states was altering the operators within certain If-modules. An “==” suddenly turned into an “!=”!!!
In the course of ongoing development, I had occasionally modified parts of the execution logic (as one does).
The fact that the States-module reverts the operator settings of those If-modules to their previous values ​​is a major concern for me.
How should this be handled?
In my opinion, operators within flow-control modules should never be stored in a way that allows other modules to modify them.

If we draw a parallel to conventional programming languages, modules like If correspond to the constructs used to control a program’s execution flow.
They are, in effect, integral parts of the program itself.
It would be impossible to create a reliable program in any language if user input could alter the conditions of If-constructs.
The entire program logic -and thus the software’s semantics - must remain immutable regardless of the data involved (and I am not aware of any programming language where such a thing is even possible).
Master data, transaction data - all of which can and should be modifiable by the program based on requirements. But the program logic? Never!

Of course, I am aware that the States-module is designed to collect, save, and restore virtually all properties of all modules - including If-modules.
I also know that these properties can be locked in the inspector (although I’m not sure if that actually solves the problem reliably). Aside from the fact that you would have to do this for every single If-block - since all properties are reset whenever you copy them (which is very annoying!) - this remains a significant conceptual flaw. While the States feature can modify the operators and operands of an If-module, it cannot alter the wiring.
Consequently, this approach is bound to lead to errors that are difficult to track down.
What is the solution? Deleting and recreating all states after every change to an If-module? That certainly can’t be the answer!

In short: Any module used to build the execution logic in an MNodes project should be off-limits to the States-module!

I hope you understand the reasoning behind my criticism here.
I hope I’ve made it clear that, despite the fantastic possibilities MNodes offers developers, there is a vulnerability here affecting a fundamental aspect of the system - one that, in my experience, makes working with it incredibly difficult.

Thanks for reading! :wink:

All the best, dr.rom

hey thanks for the report ->Two of the three are fixed.

The If: you were right. A state should never change an operator. It does not any more, and your existing states stop touching it the moment you open the patch. Nothing to re-save.

The dropdowns: a Module’s own settings were being saved into every state and then never put back. Fixed.

The crash: I need your crash report to get this one. Settings has a “Show Crash Reports” button that opens the folder where they are written. Could you send me the files from the newest folder in there? There should be three of them.

Hi Mario,

Thanks for the prompt reply.
I’m glad to hear you’ve already found a solution for the other two issues.
I’d also like to mention that the states of toggle buttons aren’t being saved for me either.

Regarding the crash: I just tested this again with a different project where I experimentally placed a “States” node into a module.
I saved two states, just to see if it made a difference whether an empty or populated “States” module was used.
Sure enough, MNodes crashes consistently whenever I try to switch projects.
When running as a plugin within my DAW (Ableton Live 12), the DAW crashes as well.
So, the issue is easily reproducible—at least on my end.

However, I can’t find the corresponding crash report when I click the relevant button in the MNodes settings.
The folder […\AppData\Roaming\Mario Nieto\MNodes\Diagnostics] is empty, except for the [CrashReports] subfolder - which is also empty.
I looked around the folder structure a bit and found a folder one level up: […AppData\Roaming\Mario Nieto\MNodes\Crashes]. There is a text file in there, but it’s just a single file generated during the crash, not three.

Unfortunately, the forum software won’t let me upload anything.
The file filter doesn’t allow *.txt-files. I tried to get around this by zipping the file.
But then the forum software says, “Sorry, new users can not upload attachments.”
What now?

I hope this helps you anyway.

All the best, dr.rom

oh you can drag and drop in here haha had me going to at first

hmm thats new that you cant as a new user to me

also tip:

Hey dr.rom,

This forum uses a trust level, and since for you it was still level zero i assume you couldn’t upload anything. this is just a protection for new people that could be spammers and prevents that new person to do any harm by sending files with bad intententions.

Normally if you’re a bit active on this forum for a while you get trust level one and that would normally give you that access.

At least, as a moderator i have still get to use what i can or can’t do since i am not an administrator but i have set you trust level to one now. So you could you check if you are able to upload (attach) a file on a message.

So you would now be able to upload:

jpg, jpeg, png, gif, heic, heif, webp, avif, svg, jxl, mp3, wav, flac, ogg, aiff, zip, mnprt, mnbundle, mid, mnprtz, mnmod, mnsub, rar, 7z, m4a, aac, opus, midi, mnsubgraph, mp4, mov, webm, m4v).

With a limit of 50mb.

Hope my adjustment of that trust level helps out. If not, let me know.