Retriggering a chase instead of toggling.

Ask a generic question about the usage of QLC+, not related to a particular operating system
Post Reply
benrossm
Posts: 3
Joined: Sat Sep 09, 2023 3:01 am
Real Name:

Im triggering a light show from a midi drum pad, im trying to retrigger a chase or sequence every time i hit the pad. The toggle button wont work because it turns the chase off every other time the pad is hit, Flash mode only works on scenes, and ive tried a cue list but i cant seem to start playing a cue list without a toggle either, Any ideas?
kenact
Posts: 370
Joined: Thu Apr 23, 2015 6:43 am
Real Name: Ken Coughlin

Are you trying to start a chase from the 1st step, whenever you trigger the midi drum pad?
benrossm
Posts: 3
Joined: Sat Sep 09, 2023 3:01 am
Real Name:

kenact wrote: Mon Sep 18, 2023 4:50 pm Are you trying to start a chase from the 1st step, whenever you trigger the midi drum pad?
Yes , i also dont want it to loop.
julianb240393
Posts: 12
Joined: Sun Mar 08, 2020 11:15 am
Real Name: Julian

I could also have a usecase to retrigger a chase, but I would need it like followed, and would like to know if that's possible:

I would have to start the scene, which is looping and if needed retrigger it to immediately start again from step 1, without a break.
MichelSliepenbeek
Posts: 504
Joined: Wed Feb 08, 2023 10:24 am
Location: Nederland
Real Name: Michel Sliepenbeek

You could use a Script to Retrigger.
Basically you only need to Stop the function and then Start the function again.
So:
Stopfunction(functionXYZ)
Startfunction(functionXYZ)

Depending on the type of function you may have to put a Wait behind the Start (if functions don't have a Running Time, they get started but End immediately, so it will look to you as if the Script isn't working).

Create a Script, put a button on your VC that launches this Script and add the intended Midi Messages as External Input.
Now it is up to you to play with the parameters (including the Wait in your Script) to get the Timing Right: do you want a chaser to Loop or only to Run Once and how long should it remain on, should it Fade In, ..............


Warning: if you Change the name of a Function, all Buttons, Sliders, Collections etc related to this Function will automatically use the changed name.
This does not apply for Scripts: you need to change the changed name of your function manually.
A QLC Workspace is like a Bob Ross painting: "it's your world, you can create whatever you want!"
Yestalgia
Posts: 371
Joined: Thu Jun 17, 2021 9:31 am
Location: Australia
Real Name:
Contact:

MichelSliepenbeek wrote: Mon Sep 25, 2023 9:25 am You could use a Script to Retrigger.
Wow thanks for that! - great idea to bridge the gap for now.

Unfortunately it's not going to solve the issue for OP, or indeed the rest of us. What I believe is needed is a new mode for the "button" type.

It would look something like this:
  • Create a function
  • Create a button on the VC
  • Set button to "Launch Instance of function"
  • (In the background, QLC+ duplicates your function in a hidden folder x number of times)
  • Operate Mode
  • Press button, button goes green while the function runs and clear when the function stops
  • Press button multiple times, an instance (contained in the hidden folder) is launched for each button press. Button goes green while the functions run and clear when all the function stop.
I'll setup a design document to get the ball rolling.

Cheers.
julianb240393
Posts: 12
Joined: Sun Mar 08, 2020 11:15 am
Real Name: Julian

MichelSliepenbeek wrote: Mon Sep 25, 2023 9:25 am You could use a Script to Retrigger.
Basically you only need to Stop the function and then Start the function again.
So:
Stopfunction(functionXYZ)
Startfunction(functionXYZ)

Depending on the type of function you may have to put a Wait behind the Start (if functions don't have a Running Time, they get started but End immediately, so it will look to you as if the Script isn't working).

Create a Script, put a button on your VC that launches this Script and add the intended Midi Messages as External Input.
Now it is up to you to play with the parameters (including the Wait in your Script) to get the Timing Right: do you want a chaser to Loop or only to Run Once and how long should it remain on, should it Fade In, ..............


Warning: if you Change the name of a Function, all Buttons, Sliders, Collections etc related to this Function will automatically use the changed name.
This does not apply for Scripts: you need to change the changed name of your function manually.

OK so I tried this, but it does not work.
If i set the "script button" in VC to Flash-mode, nothing happens with the function
If I set it to toggle, when I press it, it starts my function, but if I press again (to retrigger) it stops both.

Or did I get something wrong?

I put "stop function", then "start function" and then "wait 10h" in the script

Thanks
MichelSliepenbeek
Posts: 504
Joined: Wed Feb 08, 2023 10:24 am
Location: Nederland
Real Name: Michel Sliepenbeek

If i set the "script button" in VC to Flash-mode, nothing happens with the function
If you check the on-line manual (https://docs.qlcplus.org/v4/virtual-console/button), you will find:
Flash Function: You can "flash" the attached Scene when you keep the button pressed. If another type of Function is attached to the button, nothing happens when you click it.[

As a Script is "another type of Function" then a Scene, it should not be a surprise that nothing happens.

Or did I get something wrong?
No, it's me that misunderstood your question.
Yestalgia was right that this is not the solution to retrigger an already running function.
Apologies for that.
A QLC Workspace is like a Bob Ross painting: "it's your world, you can create whatever you want!"
User avatar
GGGss
Posts: 2732
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

julianb240393 wrote: Sun Feb 11, 2024 8:42 pm
I put "stop function", then "start function" and then "wait 10h" in the script
I hope this is a typo because you instruct the script to wait for 10 HOURS.
All electric machines work on smoke... when the smoke escapes... they don't work anymore
MichelSliepenbeek
Posts: 504
Joined: Wed Feb 08, 2023 10:24 am
Location: Nederland
Real Name: Michel Sliepenbeek

Might be intentional: if you start a function and you only want it to stop "if you say so" (by using a Stop Button), you need to use a Wait Time that is longer than your expected "Show Time".
If you run marathon shows that might take up to 8 hours, you have added a "safe margin" of 2 hours. :) :D
A QLC Workspace is like a Bob Ross painting: "it's your world, you can create whatever you want!"
kproth
Posts: 76
Joined: Sun Jan 01, 2023 2:31 pm
Real Name: Kevin Roth

I think I have a solution.
  1. Build a chaser with whatever lighting content you want to be able to trigger. Set its Run Order to "Single Shot".
  2. Build another chaser containing exactly 2 steps. The first step should be a "null" scene (with nothing defined), with timing set to 0ms fade in, 0ms fade out and 0ms hold. The second step should be the real chaser, with timing set to 0ms fade in, 0ms fade out and a hold time that matches the "real" chaser's run-time.
  3. Add a Cue List widget to your Virtual Console, tie it to the 2-step "parent" chaser, and configure external MIDI input to trigger the "Previous" button. (be sure to keep the default option to "Run chaser from first/last step" if Next/Previous buttons are pressed when it's not active)
  4. Depending on how your drum pad sends MIDI notes, you might have to reconfigure your Input Profile. I tested on Windows from external software called MultiPlay, routing MIDI into QLC+ via LoopBe1, and had to tweak the Generic-MIDI input profile before it would work. I re-configured the selected MIDI note as a "Button", and then enabled the optional Behaviour to "Generate an extra Press/Release when toggled". If you find you need to do this too: start on the Input/Output pane, then select the universe with your MIDI Input, switch to the Profile tab and edit your Input profile, click over to the Input Profile Editor "Channels" tab, locate the selected note, set it's Type to "Button" and then check the box to generate the extra press/release.
Now, any time you send that MIDI command, the cue list will start playing, at step 1, then immediately jump to step 2 and show your "sub-chaser", and then stop.

If you send the MIDI command again while it's playing step 2, it will back up to step 1 and then re-start playing step 2 immediately.

BUT... this ONLY works if the Note On command (with non-zero velocity) is followed by a Note Off command (or Note On with zero velocity); believe that's because this type of external input is only triggered when the selected note's velocity goes from off (0) to on (non-0). So the way I tested it, with the MIDI note from the Generic MIDI input profile using the "Slider" mode, then it only works once, until you "reset" it by sending a separate Note Off command (or a Note On with velocity=0).

I attached a workspace to illustrate -- but remember, your mileage may vary depending on how your drum pad transmits MIDI notes...


Opportunities for improvement:
  • It'd be nifty if the hold time on a chaser step that is a "sub-chaser" could be auto-calculated to match the overall duration of the sub-chaser... We don't want "infinite" in this case; we just want to "play the sub-chaser until it stops on its own".
  • To use a VC Button instead of a Cue List to drive this, the only thing missing is to be able to re-trigger it while it's playing (it automatically becomes inactive once the chaser finishes, and can then be started again as desired). Would there be value in coding up a new external input option that could "re-start" the associated function if the external input is received while its function is already running?
    It would probably only make sense for functions that stop on their own; otherwise you'd have no way to turn it off using external input.... I've already done some work on a custom fork to add an option to change the toggle handling -- specifically to let external input tell the button to turn "on" if a non-zero velocity is received, and "off" if a zero velocity or note-off is received, instead of just toggling between off and on every time a non-zero input is received. If there's general value in letting a second "on" command "re-start" a function, I might consider adding that to my custom fork also. And I'd be happy to submit a PR for it someday too...
Attachments
Test-retriggerable.qxw
(14.85 KiB) Downloaded 8 times
User avatar
GGGss
Posts: 2732
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

On top of above solution, couldn't you make use of some Loopback-magic and a flash button? The midi signal now triggering the flash button and the above mechanism is triggered?
All electric machines work on smoke... when the smoke escapes... they don't work anymore
Post Reply