Hello,
the default mapping for notation launchpad is ok for me,
but I want to expand it.
I looked at the mapping and tried to understand it :)
From my understanding the buttons (Y1 .. Y8) on the right switch a variable pad mode.
For the moment only buttons Y1 and Y2 are used, so I will extend it
Y3:
I want to use the 3 buttons to activate with each button a special shader.
When I press a button
- the light of the button should be on
- the shader "X" should be selected
- the shaders should be activated
When I press the button a second time
- the light of the button should be off
- the shader "X" can stay selected
- the shaders should be deactivated
When I press another button while a button is active
- the light of the old button should be off, the light of the new selected be on
- the new shader "Y" should be selected
- the shaders should be still activated
the current script for a mapped button is
How is the syntax to expand it for pad mode 2?
Also the script for LED should be modified I guess
I understand that I have to do this for all 64 buttons and all 64 leds
best regards
stephan
the default mapping for notation launchpad is ok for me,
but I want to expand it.
I looked at the mapping and tried to understand it :)
From my understanding the buttons (Y1 .. Y8) on the right switch a variable pad mode.
For the moment only buttons Y1 and Y2 are used, so I will extend it
Y3:
set '$padmode' 2
I want to use the 3 buttons to activate with each button a special shader.
When I press a button
- the light of the button should be on
- the shader "X" should be selected
- the shaders should be activated
When I press the button a second time
- the light of the button should be off
- the shader "X" can stay selected
- the shaders should be deactivated
When I press another button while a button is active
- the light of the old button should be off, the light of the new selected be on
- the new shader "Y" should be selected
- the shaders should be still activated
the current script for a mapped button is
var '$padmode' 0 ? var '$recmode' 1 ? sampler_rec 1 : sampler_pad 1 & sampler 1 select : var '$padmode' 1 ? deck left hot_cue 1 : nothing
How is the syntax to expand it for pad mode 2?
Also the script for LED should be modified I guess
var '$padmode' 0 ? get_sample_color 1 : var '$padmode' 1 ? deck left hot_cue 1 ? get_constant 'red' : get_constant '#550000' : nothing
I understand that I have to do this for all 64 buttons and all 64 leds
best regards
stephan
Inviato Fri 04 Nov 22 @ 10:34 pm
Add on to my question:
I assume that is possible to select a shader somehow by its name:
Is it possible to have a list with all mapped shader names?
so that in my button code I can write something like
I thin it much easier to modify this list, that to modify each mapping ..
I assume that is possible to select a shader somehow by its name:
select shader "name"
Is it possible to have a list with all mapped shader names?
myshaders = ("shader1", "shader2", ...)
so that in my button code I can write something like
select shader my shaders[0]
I thin it much easier to modify this list, that to modify each mapping ..
Inviato Fri 04 Nov 22 @ 10:40 pm
@sh69, help is on the way, just a thing needs checking, but I'm assuming you're calling the shader as a deck master video effect? [not on deck or audioOnlyvisualisation ]
@Adion is the pretty name [effect_string 2] this working your end?
this is working
@Adion is the pretty name [effect_string 2] this working your end?
param_equal `get_effect_string shader 2` "pretty name" ? on : off
this is working
param_equal `get_effect_string shader 1` "MsX3RH" ? on : off
Inviato Fri 04 Nov 22 @ 11:26 pm
@locodog thank you for answering so fast :)
and yes you are right, I'm using the shaders for master
this code is for lights of leds, as it is a get?
To be honest, I struggle with inline syntax, I prefer the multiline scripts with if ... then else or switch case statements.
So where do I have to add the new code to the existing?
and yes you are right, I'm using the shaders for master
this code is for lights of leds, as it is a get?
param_equal `get_effect_string shader 1` "MsX3RH" ? on : off[/quote]
To be honest, I struggle with inline syntax, I prefer the multiline scripts with if ... then else or switch case statements.
So where do I have to add the new code to the existing?
var '$padmode' 0 ? get_sample_color 1 : var '$padmode' 1 ? deck left hot_cue 1 ? get_constant 'red' : get_constant '#550000' : nothing
Inviato Sat 05 Nov 22 @ 1:24 am
We're not there yet, there's 2 ways shaders are named, effect_sting 1 which is the shadertoy catalogue name [base64 that has no sense to a human] and there's effect_sting 2, which is the shader's given name [which would make sense for a human]
The problem is, it appears there's a problem with effect_string 2 comparing against a known string [needed to get your idea going], so hang fire.
we'll get this snag worked out and then I'll give you the full run down.
The problem is, it appears there's a problem with effect_string 2 comparing against a known string [needed to get your idea going], so hang fire.
we'll get this snag worked out and then I'll give you the full run down.
Inviato Sat 05 Nov 22 @ 2:12 am
locodog wrote :
@Adion is the pretty name [effect_string 2] this working your end?
param_equal `get_effect_string shader 2` "pretty name" ? on : off
Yes, seems to work fine here (tried as custom button name)
`param_equal `deck master get_effect_string shader 2` "Steel Lattice" ? constant "yes" : constant "no"`
Inviato Sat 05 Nov 22 @ 12:31 pm
button
LED LOGIC
var '$padmode' 0 ? var '$recmode' 1 ? sampler_rec 1 : sampler_pad 1 & sampler 1 select : var '$padmode' 1 ? deck left hot_cue 1 : var '$padmode' 2 ? deck master effect_active shader ? param_equal `deck master get_effect_string shader 2` "SHADERSNAME" ? deck master effect_active shader off : deck master get_effect_string shader 2 "SHADERNAME" : deck master get_effect_string shader 2 "SHADERNAME" & deck master effect_active shader on : nothing
LED LOGIC
var '$padmode' 0 ? get_sample_color 1 : var '$padmode' 1 ? deck left hot_cue 1 ? get_constant 'red' : get_constant '#550000' : var '$padmode' 2 ? deck master effect_active shader ? param_equal `deck master get_effect_string shader 2` "SHADERSNAME" ? CASE_FOR_LED_ON : CASE_FOR_LED_OFF : CASE_FOR_LED_OFF : nothing
Inviato Sat 05 Nov 22 @ 2:35 pm
@locodog: thanks again, this works for me :
var '$padmode' 0 ? var '$recmode' 1 ? sampler_rec 1 : sampler_pad 1 & sampler 1 select : var '$padmode' 1 ? deck left hot_cue 1 : var '$padmode' 2 ? deck master effect_active shader ? param_equal `deck master get_effect_string shader 2` "Matrix Code" ? deck master effect_active shader off : deck master get_effect_string shader 2 "Matrix Code" : deck master get_effect_string shader 2 "Matrix Code" & deck master effect_active shader on : nothing
but this not easy to maintain
Is it possible to define a function ... (not VirtualDJ syntax )
and only call this function for each mapping
This would make the whole thing a lot easier
var '$padmode' 0 ? var '$recmode' 1 ? sampler_rec 1 : sampler_pad 1 & sampler 1 select : var '$padmode' 1 ? deck left hot_cue 1 : var '$padmode' 2 ? deck master effect_active shader ? param_equal `deck master get_effect_string shader 2` "Matrix Code" ? deck master effect_active shader off : deck master get_effect_string shader 2 "Matrix Code" : deck master get_effect_string shader 2 "Matrix Code" & deck master effect_active shader on : nothing
but this not easy to maintain
Is it possible to define a function ... (not VirtualDJ syntax )
function launchPads($NR$, $NAME$)
var '$padmode' 0 ? var '$recmode' 1 ? sampler_rec $NR$ : sampler_pad $NR$ & sampler $NR$ select : var '$padmode' 1 ? deck left hot_cue $NR$ : var '$padmode' 2 ? deck master effect_active shader ? param_equal `deck master get_effect_string shader 2` $NAME$ ? deck master effect_active shader off : deck master get_effect_string shader 2 $NAME$ : deck master get_effect_string shader 2 $NAME$ & deck master effect_active shader on : nothing
and only call this function for each mapping
1.1 lauchPads(1, "Matrix Code")
1.2 lauchPads(2, "Blender")
This would make the whole thing a lot easier
Inviato Sat 05 Nov 22 @ 5:56 pm
unfortunately not, launchpads do make for unwieldy mappings.
There are hacky ways to have functions but it's messy, having them on custom buttons or written into the skin as multibuttons, realistically it's just as unwieldy.
Sometimes I wish for a spreadsheet style of mapping [a new column for each reply to a query], it would make it easier for maintaining, and probably easier for creating mappings too. BUT that said recent encapsulation in scripts makes it less likely.
I've tried in the past but found the repeated conversion process is as cumbersome as dealing with mappings 40 queries deep.
launchpad mappings are forever a WIP
There are hacky ways to have functions but it's messy, having them on custom buttons or written into the skin as multibuttons, realistically it's just as unwieldy.
Sometimes I wish for a spreadsheet style of mapping [a new column for each reply to a query], it would make it easier for maintaining, and probably easier for creating mappings too. BUT that said recent encapsulation in scripts makes it less likely.
I've tried in the past but found the repeated conversion process is as cumbersome as dealing with mappings 40 queries deep.
launchpad mappings are forever a WIP
Inviato Sat 05 Nov 22 @ 6:32 pm