SpotlightKid/moony-lv2-scripts

note_filter.lua script won't load

Closed this issue · 3 comments

ssj71 commented

I've been thinking lots about using moony but I've always been scared of lua. But I finally downloaded the nightly and was trying it out with your note_filter script, but I run into several errors. Line 46 looks like it needs something in the index brackets (i maybe?). Line 65 just needs a then for the if. But then Line 84 I get the error "attempt to index a number value (local 'seq')". This is my first foray into lua and I haven't gone through the moony docs so I have no idea how to proceed. If you could help me work this out your scripts are great templates for midi filters that I'd like to play with.

Thanks!

ssj71 commented

ok, figured out I was using the control port version of moony rather than the atom port. That fixes the line 84 issue, the other 2 are still there. Mostly I just need to know if I should use the i or n variable for the index of t[].

Thanks again!

Yes, you're correct, it should be t[n] = true. Somehow I messed up the previous commit, which was meant to fix this function, but obviously didn't. Fixed by 8faa1ca now.

Since this file was meant only as a template for implementing note filter scripts, it was never really tested. The scripts, which are based on this template, e.g. scale_velocity.lua, have the correct code, though, I believe. I haven't found a good way to test these scripts programmatically, so sometimes these kinds of errors slip through manual testing.

ssj71 commented