Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lune module stops working #10

Open
dandante opened this issue Aug 18, 2024 · 3 comments
Open

Lune module stops working #10

dandante opened this issue Aug 18, 2024 · 3 comments

Comments

@dandante
Copy link

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:

config.frameDivider = 1
config.bufferSize = 8

buttonTrig = BooleanTrigger.new()

function process(block)
	if buttonTrig:process(block.button) then
		display('Button pressed')
	end
end

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:

image

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.

@dandante
Copy link
Author

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.

@dandante
Copy link
Author

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.

@Simon-L
Copy link
Owner

Simon-L commented Aug 20, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants