Accesso rapido:  

Forum: General Discussion

Topic: os2l_scene and song variables
Virtual DJ has a very peculiar scripting, I just can’t understand it. I need to convey the color of a song in os2l through the scene. I'm trying like this:
os2l_scene 'color' `get_loaded_song 'color'`
the output is something like:
{ evt: 'btn', page: "color", name: "`get_loaded_song 'color'`", state: 'on' }
that is, the value of the variable is not substituted
how to do it right?
Is there a way to automatically send this message when mixing?
 

Inviato Thu 26 Oct 23 @ 10:14 pm
locoDogPRO InfinityModeratorMember since 2013
I don't think the os2l_ scripts accept an action as a parameter, only a string is accepted
try it this way

get_loaded_song 'color' & param_cast & os2l_scene
 

Inviato Thu 26 Oct 23 @ 11:16 pm
it doesn`t work (
Any another ideas?
 

Inviato Fri 27 Oct 23 @ 7:49 am
locoDogPRO InfinityModeratorMember since 2013
what is it sending in that case?

you could be explicit

param_equal `get_loaded_song 'color'` "red" ? os2l_scene "red" : test another case
 

Inviato Fri 27 Oct 23 @ 8:00 am
yes, it works!
Strange logic of course.
Is there some way to automatically send this event during a message?
Many thanks for the help!
 

Inviato Fri 27 Oct 23 @ 11:53 am
AdionPRO InfinityCTOMember since 2006
To use as implicit parameter you probably need to cast to string explicitly, as os2l_scene doesn't accept color as a parameter.
 

Inviato Fri 27 Oct 23 @ 12:22 pm
locoDogPRO InfinityModeratorMember since 2013
try this then
get_loaded_song 'color' 'text' & param_cast & os2l_scene

when you say "automatically", automatically when? there's always the onSongLoad entry in the keyboard mapping

 

Inviato Fri 27 Oct 23 @ 1:27 pm
By "Automatically" I intended to send an event when the song starts playing. But I think the best solution is to send an event when a button is clicked, because the transition can be lengthy

Thanks again everyone for your help
PS: the scripting language is of course very unique. I know about 10 programming languages, but I have never encountered anything like this...
 

Inviato Sun 29 Oct 23 @ 7:02 pm