gen confusion

鬱咕 神田's icon

鬱咕 神田

8月 05 2024 | 2:48 午後

I'm still a beginner, so I can understand that patches are slow or don't work because I'm not good at patchwork, but sometimes objects that are supposed to exist aren't compiled, and frequently used DELTA~ and < objects don't work. I will. What should I do about this? Also something like [string "-- main2.lua..."]:697: failed to compile genpatcher Is there a way to find out what the error message specifically says?


riva.maxpat
Max Patch


👽'tW∆s ∆lienz👽's icon

👽'tW∆s ∆lienz👽

8月 05 2024 | 4:01 午後

the error messaging of gen~ is sometimes, admittedly, not descriptive enough.

i see this error when running your patch and can't really tell much from it, either:

[string "-- main2.lua..."]:697: failed to compile genpatcher

sometimes you can use the 'C' icon in the right toolbar to open up the code it generates for your patcher to see what it might be referring to, but in this case, '697' doesn't match up to any line number that exists or that can be seen there:

unfortunately, there's no way to tell easily what the error message means :(

__________________

for this one:...

sometimes objects that are supposed to exist aren't compiled,

i just ran into this when reopening your patch a third time... i cannot reproduce the steps, but it's interesting that your patch is one that has more of a tendency to do this than others i've come across:

at one point when opening your patch, the main gen~ patcher which is connected to the 'ezadc~' object in your riva.maxpat didn't appear with any of its extra inlets or outlets, and when i clicked inside i saw all of the objects, but clicking on 'C' didn't show any code like it normally does, and furthermore, because it was missing inlets and outlets, remained disconnected from everything else(even though there were inlets and outlets that could visually be seen in object-form within the gen~ patcher)...

unfortunately, i didn't get a screencap of it before closing out, and now i can't reproduce the problem easily again, but hopefully @GrahamWakefield or someone @Cycling74 can check out this patch and find the same or similar issues.

edit - i ran into it again -> i tried opening up all the gen patchers(so all windows of every gen-encapsulated patcher or subpatcher is displayed on my desktop) then closing out(not out of max, just closing the patch), then reopening again, the second time, i tried turning on audio, then opened up all the gen patchers again(same way as before: so all display open), then turned off audio, then closed out of the patcher yet again, and finally when reopening the patch i got the error again:

@Cycling74: console window shows certain errors before this 'disappearing gen~' issue occurs(those errors always show up in the console before this issue occurs:" '...PatcherToExpr"]443:table index is nil' " and "'...assertion failed!'" ). Thanks for taking a look!

the only advice i have for this is to keep backup copies of your max patching in case you need to revert back, especially when working with gen~(and check all your patches when first opening them up to make sure the problem doesn't exist anywhere like this(when it happens, it always shows up right away when first loading a patch), that way you won't accidentally save the error permanently into your backup copy... if you run into this particular kind of problem, close out without saving and reopen to try again).

_____________________________________

separately, i've not run into this at all:

and frequently used DELTA~ and < objects don't work

maybe check the math again, tracking start of a phasor should utilize the '<' but in your patch you have a '> 0.1':

____________________________

gen~ is extra difficult from beginner level because it doesn't have the same debugging and error-messaging detail as the rest of Max(though it is quite close and seeing the code it generates helps in a much different way), it just takes patience as you might be running into an internetworked set of complications that make it harder to figure out each possible individual issue. one thing that you can do further is split up your larger gen patcher into smaller ones(not just encapsulated within one 'gen~' patcher, but split up into many... a bit like you already have the two in the parent patcher...). if you take the larger gen~ and test out its parts in separate gen~ patchers within your main riva.maxpat, you can make sure each part compiles properly before moving it all into one.

hope this can help 🌻

鬱咕 神田's icon

鬱咕 神田

8月 06 2024 | 12:10 午後

Thank you for your quick and accurate reply. I see, gen is difficult. I think I'll try it with msp