Open dandante opened 3 months ago
I may have missed an error like this:
[521.794 debug src/LuaJITEngineAPI.cpp:6 display] Button pressedd
[521.794 warn src/LuaJITEngine.cpp:277 process] LuaJIT: ...rt/Rack2/plugins-mac-arm64/ModScript/scripts/lib/lib.lua:161: attempt to index a nil value
[521.794 debug src/LuaJITEngine.cpp:278 process] ...rt/Rack2/plugins-mac-arm64/ModScript/scripts/lib/lib.lua:161: attempt to index a nil value
[521.794 warn src/Lune.cpp:276 process] Script /Users/dtenenba/Library/Application Support/Rack2/plugins-mac-arm64/ModScript/scripts/hello.lua process() failed. Stopped script.
It seems like right clicking and going to User Scripts / Unload Script and then reloading my script fixes the problem. But I will work on on a little more to confirm, and if that is the case I will close this issue.
It might be nice to have a feature where, if the script stops and "Auto script reload on" is checked, Lune continues to monitor the script file for changes and if the file is changed (saved) again, it automatically unloads it and reloads it). This would avoid a lot of clicking. Instead I could just fix the issue that caused the script to stop, then save the file again, and it would reload.
Hi @dandante and thanks for your interest
I don't use ModScript anymore sadly, sorry. However, I'm on Linux and I juste tried your simple script, monitoring the log file, on Rack2Free 2.5.2 and I can't seem to reproduce!
Also, I double checked the behaviour: if your script has a syntax error or tries to call a nil value, it will show in the log but keep monitoring. If you save again with the issue fixed, it will reload just fine. Can you confirm that?
I usually set "Auto reload script on" and then open my script. I tail the VCV log file while I am working and usually when I make a change to my script and save it, I'll see the script contents in the log file.
However, sometimes Lune gets into a state where it stops doing this and does not seem to be working at all. For example with a simple script like this:
If I make a change and save the script, I do not see the script contents in the log file, and pressing the button on Lune does not display anything. I also have a Helper module that doesn't seem to be working right either. If I mouse over a module, it correctly shows the module name, but if I then click the id button, it does not change the clipboard contents. Same with the dump button.
I have tried closing and reopening VCV Rack, removing and re-adding the Lune and Helper modules, and none of that seems to help. I have not tried rebooting yet. This is on an M1 Mac running Sonoma 14.5, VCV Rack Free 2.5.2, and ModScript 2.0.0 nightly.
This has happened a few times on two different machines. At some point the problem seems to fix itself, until it happens again. Do you have any hints as to how to get things working again?
I do notice one thing - if I close my patch and create a new patch in VCV Rack, then add Lune, and open my script, it starts working again. So I wonder if other modules are somehow putting Lune into a non-receptive state. But this makes it hard/impossible to work on a Patch that includes Lune.
I also notice that Lune seems to have regular CPU spikes:
There is pretty much always a spike like this.
This seems like a super useful module! Looking forward to getting past this issue so I can make full use of it. Thanks in advance.