How to Flash a light ?

317 views
Skip to first unread message

Pierre Cap

unread,
Feb 14, 2020, 5:52:57 AM2/14/20
to QLab
Hello :)

I'm new on Qlab and I would like to do a flash effects on the hotkeys.

For example, I have my keyboard A who is putting the light at 100% when I press it but i would like that the light would come back to 0% when I release it. 
Does someone has an idea ? 

Thanks a lot ;)

Rich Walsh

unread,
Feb 14, 2020, 6:11:20 AM2/14/20
to ql...@googlegroups.com
I thought you could use "second trigger on release" and "If running, second trigger: … hard stops" but I hit two problems:

  1. If I hold a key down I start getting alert beeps – regardless of having "Key Repeat" off in System Preferences, or picking a key that doesn't pop up a panel of variations (à, á, etc). I think I've missed something really basic there!?
  2. Although I can make an Audio Cue play and stop like this, I can't see how to do that with a Light Cue as they behave more like fades – ie: when you stop them they don't undo their action on the levels.

I can't think of an elegant way. Stumped.

Rich

Abdel El Asri

unread,
Feb 14, 2020, 6:39:44 AM2/14/20
to QLab
Hi,

I set up two cues. One with the light @100 and the other @0. Set the midi trigger of the first on midi note on with value @any, and the second set the midi trigger on note off (of course the same note) with value @any.
I hope this helps.

I Joined the file juste change the note number in the trigger tab.

Cheers
flash_light_midi.qlab4

Pierre Cap

unread,
Feb 14, 2020, 7:49:25 AM2/14/20
to QLab
It would have been amazing if we were working with Midi but the problem is that we are using a keyboard. (We are doing an escape room with arduino and Qlab) 
It's a shame that we don't have so many option with keyboards... 

But Thanks anyway ;)

Jean-Etienne Bettler

unread,
Feb 14, 2020, 8:03:44 AM2/14/20
to ql...@googlegroups.com
hi

you could use an app or a simple bash script to emulate a midi signal (like a note) with any key from your keyboard

in this script I do the exact opposite, generating specific keys with midi note. I’m sure the opposite is possible.

cheers

midi-to-keys

Richard Williamson

unread,
Feb 14, 2020, 8:40:00 AM2/14/20
to ql...@googlegroups.com
I think the issue is that it’s easy to map an action in qlab to a keyDown keyboard event, but qlab doesn’t give a method to map a keyUp event. If you can find an app that can sit in the middle and re-map keyboard events to either midi or OSC then this should work - you could look at Luminosus which may help you on the OSC side. 

Sent from my iPhone

On 14 Feb 2020, at 13:03, Jean-Etienne Bettler <aroo...@gmail.com> wrote:

hi

you could use an app or a simple bash script to emulate a midi signal (like a note) with any key from your keyboard

in this script I do the exact opposite, generating specific keys with midi note. I’m sure the opposite is possible.

cheers

--
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/4A7E7FF9-5350-47AF-847C-2207F8E43D7A%40gmail.com.
<midi-to-keys>


-- 
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/541d1105-8655-4df3-bcb4-37755fda324a%40googlegroups.com.

--
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/4A7E7FF9-5350-47AF-847C-2207F8E43D7A%40gmail.com.

Jean-Etienne Bettler

unread,
Feb 14, 2020, 8:46:18 AM2/14/20
to 'Rich Walsh' via QLab
I suck with AppleScript but would it be possible to simply create a script cue triggered by a key that will generate a note on?

I see that in Qlab’s dictionary you have the midi command note_on available.


bye the way I found a soft that can generate a midi note mapping keys, but the issue is that you have to be focused on the soft to generate it. (https://sourceforge.net/projects/vmpk/)

Richard Williamson

unread,
Feb 14, 2020, 8:52:40 AM2/14/20
to ql...@googlegroups.com
You still need to capture the keyUp event - which I don’t think qlab will do, so wouldn’t be able to pass it to the AppleScript 

You could have a cue which goes off automatically after 1 second, then I think if you keep hitting the button the light would stay on, but you would have to tap the button at a rate of more than once a second so it’s a bit ugly. 

Sent from my iPhone

On 14 Feb 2020, at 13:46, Jean-Etienne Bettler <aroo...@gmail.com> wrote:

I suck with AppleScript but would it be possible to simply create a script cue triggered by a key that will generate a note on?

Rich Walsh

unread,
Feb 14, 2020, 8:56:05 AM2/14/20
to ql...@googlegroups.com
No: note_on sets the message type for a MIDI Cue – it doesn't generate MIDI. You could just use a MIDI Cue triggered by a hotkey to generate MIDI! Use the IAC bus to route it back into QLab.

Still doesn't solve the problem of how you trigger again on key up.

I can get a MIDI note to fire twice from a hotkey by setting a non-zero post wait and having it hard stop & restart on second trigger. Can't make it send a different message (need to control TWO Light Cues) – probably going to end up having to use the same note twice to toggle yet another intermediary cue, but don't have time right now to figure that out.

Rich

On 14 Feb 2020, at 13:46, Jean-Etienne Bettler <aroo...@gmail.com> wrote:

Rich Walsh

unread,
Feb 14, 2020, 9:30:35 AM2/14/20
to ql...@googlegroups.com
This sort of works. Can't stop it beeping when I hold down the key…? Very unstable using a toggle (looping cue list) – needs some protection to make sure you start from the top! If in doubt, reset all before testing.

You need a working IAC bus.

Rich

Flash.qlab4
Message has been deleted

micpool

unread,
Feb 14, 2020, 9:45:45 AM2/14/20
to QLab
Corrected script for  my previous (deleted ) post

This works and registers the keyup to return the light to 0, but unfortunately it is too slow for flashing in time with music etc.

If accurate timing is not necessary it may do what you want.

Or someone may think of a means of making it faster.

--Uncheck run in separate process

--set post wait of  this cue to a large value

-- set second trigger of this cue to hard stop and restart

set thelight to 1

set thelevel to 100 --level to bump to

set mycue to "1" --cue number of this cue --used as alternative to finding the cue number of me in tell Qlab block in attempt to speed things up.

tell application id "com.figure53.QLab.4" to tell front workspace

set theflag to notes of cue mycue

--set mycue to last item of (cues whose running is true and q type is "script") -- find cue number of me

if theflag = "0" then

set myOSC to ("/dashboard/setLight " & thelight as string) & " " & thelevel as string

do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"

set the notes of cue mycue to "1"

else

set myOSC to ("/dashboard/setLight " & thelight as string) & " 0"

do shell script "echo " & myOSC & " | nc -u -w 0 127.0.0.1 53535"

set the notes of cue mycue to "0"

stop cue mycue

end if

end tell


Screen Shot 2020-02-14 at 14.32.06.png




Mic

Rich Walsh

unread,
Feb 14, 2020, 11:28:37 AM2/14/20
to ql...@googlegroups.com
I don't think you can speed up this approach by much: shell scripts come with some noticeable overhead.

I've simplified the attached so it's using fewer cues, and it looks pretty responsive. I can't, however, seem to stop my Mac from beeping at me if I hold down a key for too long in QLab – what have I missed there? (Turning off the alerts would address the symptom, not the cause.)

Rich
Flash 2.qlab4

Shaul Dover

unread,
Feb 14, 2020, 11:42:14 AM2/14/20
to QLab
A "dirty" workaround that I will consider, Use OSC to trigger the light in external DMX program (for example free QLC+). 
shaul.

Patrick Spadrille

unread,
Feb 14, 2020, 2:10:26 PM2/14/20
to QLab
Pierre, qu'est-ce que je te disais?!! Meilleure communauté sur un forum EVER ! 😀

Abdel El Asri

unread,
Feb 14, 2020, 8:35:20 PM2/14/20
to QLab
I came up with the same solution as Rich but using osc to toggle beetween the "Note on" and "Note off" of the midi cue. Seem responsive but Rich's solution definitely uses less cues. Maybe someone find it useful. I added a reset light to zero if that's not the case.
Abdel

PS: bienvenu Pierre donc ;)
flash_light_Osc.qlab4

Abdel El Asri

unread,
Feb 14, 2020, 8:43:36 PM2/14/20
to QLab
Just a precision, the reset cue is useless if the Osc cue has set the midi cue to "Note off"... Not very useful

Abdel El Asri

unread,
Feb 15, 2020, 4:55:17 AM2/15/20
to QLab
Hi Guys!
I think I've found a way to do it. The light will always be on when the hotkey is pressed even when the light is already on and then off when the hotkey is released. 
The beeping is still there tough

Abdel
flash_light_Osc 2.qlab4

aroom

unread,
Aug 31, 2020, 5:39:05 PM8/31/20
to QLab
hi Mic,

any possibility to target anything else than a single light from the patch (with the "set thelight to" argument) ?

like a group of lights, a submaster, a light cue or any cue?

@tFigure53 
that being said, it would be great if we could have the option build in the software in the "if running, a second trigger: kill the light cue/go back to zero/etc". I'm now working a production without enough USB port for a midi controller, and it would be really nice to have this option to toggle on/off a light cue with the house lights, VP shutter, etc...

thanks

aroom

Simon VB

unread,
Sep 1, 2020, 4:32:46 AM9/1/20
to QLab
aroom, you say "I'm now working a production without enough USB port for a midi controller".
Aside from all QLab coding, I'd just like to add that USB hubs are really quite cheap ;)

micpool

unread,
Sep 1, 2020, 6:20:09 AM9/1/20
to QLab
Using that script you can flash anything listed on the dashboard e.g

change the first line of the script to 

set thelight to "group1"

to flash group 1


Mic

aroom

unread,
Sep 1, 2020, 4:33:41 PM9/1/20
to QLab
thanks Mic

micpool

unread,
Sep 1, 2020, 5:00:25 PM9/1/20
to QLab
Obviously the most responsive method of flashing lights is to use MIDI.
If you can't use a MIDI keyboard you can use MIDIKeys.app

In QLab set up / to trigger this script:
tell application "MidiKeys" to activate

In QLab set up MIDI Note on 60 velocity any to trigger this script
tell application "QLab" to activate

You now have a toggle on the forward slash key (/) to switch focus from QLab to MidiKeys and back again.

In QLab Settings MIDI controls set up   Note on 42 velocity any to GO
In QLab Settings MIDI Light Dashboard set up white notes starting at Note 41  to control Lights 1 to 10

When MIDIkeys has keyboard focus, key 2 will GO QLab, and the row of keys starting with Q will flash Lights 1-10

Screen Capture attached. (Download if you can't view in your browser)
Flashing.mov

aroom

unread,
Jan 15, 2024, 1:17:38 PM1/15/24
to QLab
Hello group

Does anyone knows how to incorporate the OSC Access Passcode to this kind of script?

Thanks

aroom

Andrew Nelson

unread,
Jan 15, 2024, 2:02:25 PM1/15/24
to QLab
You send a connect message via OSC first:
/workspace/FILENAME.EXTENSION/connect nnnn

Example:
/workspace/MyShow.qlab5/connect 6492
/workspace/MyOtherShow.qlab4/connect 7842

Just make sure you don't change the name of your show workspace file. You can also use the unique workspace ID, but I usually use the file name for readability. 
Reply all
Reply to author
Forward
0 new messages