DanT's Bright Idea?

Last night I made a really simple module to CV control the Cable Opacity & Tension, Room Brightness, and Light Bloom.

Seems to work fairly well, but the module would need a bunch more testing, maybe a CV input to control the bypass, and the panel design isn’t complete…

Should I finish off this module?

21 Likes

Yes please :slight_smile:

I woul love that…

Hell yes! this is the kind of clever twist that makes Rack and its open api so brilliant. I’d use this often

Yes please!

Also investigate whether you can control flashlight state and/or intensity. I think menu control has been requested by many. I assume that is on the list of things to add to VCV eventually. If menu control is added, I suppose it could impact any code that you write before its release.

Controlling the cables and lights in Rack 2 is very easy because they have been added to the SDK: VCV Rack API: rack::settings Namespace Reference

So if the flashlight info is also added then it will be a simple addition (although the panel might need a redesign to fit in extra knobs and ports).

That is what I figured. I was thinking if you wanted to perhaps be a bit reckless, you could try to figure out the flashlight without an SDK hook. But any such code should probably be updated once SDK hook is available. So yeah, it seems prudent to wait for the SDK. But a man can dream right :wink:

Looking forward to your new module. I think it will be popular.

It’s worth noting that a certain “Ben” is famous for making impossible modules. I assume he is doing things not in the sdk?

I’ve never used the sdk, so I don’t know what’s in there. But it’s always been pretty easy to reach inside rack and do magic. Don’t know if this is in that category.

Hmmm, just had a thought, the module changes the Rack values directly based on the params.

Not entirely sure what would happen if you added more than one instance of the module… there would be no reason to do this, but I’m not sure there is anyway to prevent multiple copies of a module.

I guess whichever module gets processed last would take precedence.

Any devs know how I can detect existing copies of the module?

I love you.

Talk to @k-chaffin his module is a Singleton. Don’t know if that’s the recommended way to do it though.

Ah thanks, that’s the term I needed, search found this thread Force single module instance

2 Likes

Glad to help.

As pgatt mentioned, my PurrSoftware Meander module is implemented as a singleton due to its use of global variables since it was once a Windows app. Andrew guided me a couple of years ago on how to make a singleton and the technique works very well but it is not trivial even though it is fairly straight forward. One complication is that you have to handle the situation of the user actually trying to add a 2nd instance. You either have to do nothing and confuse the user, or display some type of disabled module that tells the user what the deal is. This last is what Meander does.

1 Like

Ah, glad you found the thread. I had forgotten that was around.

1 Like

I would think an easier and less confusing option would be to just make multiple instances work. If your knobs follow the actual setting in rack, and only change it when a knob moves, then multiple instances would always have the same value.

This doesn’t work with how I have coded the module, I am directly setting the Rack value from the parameter + CV value, multiple instances overwrite the value on each process step.

The master instance is easy enough to implement, so I’ve done that, currently only the master instance gets ports & knobs. Once I’ve done the full panel design, I will add a label that indicates why the non-master instances do not do anything.

I’ve got a quick Windows build here for anyone that wants to give it a bug bash. (I may have a Mac build later if I find the time…) Release Windows test build including Bright-Idea · Miff-Real/DanTModules-Manual · GitHub

I think I need to add a feature to deactivate the module when the module browser is open, because its quite annoying not being able to see when adding modules to a patch. Is there any knowledge on detecting the module browser?

There should be more than enough room to add a parameter for the flashlight, should that be added to the API.

1 Like

You might look in my Meander.cpp file on my GitHub repository as I handle this. Look in the MeanderWidget constructor where I mention what I did to get the panel to display in the browser when there is no module instance due to being a singleton.

Actually, I misinterpreted what you were asking, I think. My comment had nothing to do with Room Brightness, etc.

I added the GitHub workflow from Automated building and releasing Plugins on Github with Github Actions to my repo and it seems to work, so I have made a new test build for Windows, Linux & MacOS (although the Linux build was made with ubuntu-latest which I’ve read can cause issues)

1 Like

After a little digging in the API and Stoermelder PackOne, I think this may work: APP->scene->browser->isVisible()

1 Like