Connexion rapide:  

Forum: General Discussion

Sujet Map switcher - Page: 1

Cette partie de ce topic est ancien et peut contenir des informations obselètes ou incorrectes

I need a map for switching between mappings. I have a few keys mapped for more than one use (depending on how and where i'm playing). Don't want to keep going into settings and doing the switch. Any help would be greatly appreciated. Thanks.
 

Posté Tue 17 Jan 17 @ 3:18 pm
locoDogPRO InfinityModeratorMember since 2013
I honestly don't know if this works with 8 http://www.virtualdj.com/addons/12300/SBDJ_Profile_Switcher.html
I also don't get why it isn't in options, I mean the info is actually held in settings.xml but the setting isne visible,

I thought about this way back and you can just combine your mappings either reply of a var query

var "profile" 1 ? action for profile 1 : action for profile 2

 

Posté Tue 17 Jan 17 @ 3:33 pm
I'm using a mac with 8. If i'm suppose to just add that to a key it didn't work.Could you explain? If you can, write it for me to just copy and paste. Thanks
 

Posté Tue 17 Jan 17 @ 3:55 pm
locoDogPRO InfinityModeratorMember since 2013
No it wasn't mean to be used...

This might be a bit much if you didn't get that,
 

Posté Tue 17 Jan 17 @ 4:28 pm
Never claimed to be a comp wiz bro.. Thanks anyway.
 

Posté Tue 17 Jan 17 @ 4:52 pm
@kevilev
I myself have different key mapping (need something quickly to change to it back n forth)

I put something like in the wish forum. Take a look at what I had in mind cause from the last time this was brought up, there is no MAPPING to switch instantly.

http://www.virtualdj.com/forums/215119/Wishes_and_new_features/Quicker_to_change_KE_MAPPING.html


My idea is at least faster (take a look the image by the mapper area underneath it)



@locodog, that plugin is for a PROFILE switcher not a KEY MAPPER switching ability.
 

Posté Tue 17 Jan 17 @ 5:05 pm
That's exactly what I'm thinking.. Would be very efficient to say the least. Must be a way to do this.
 

Posté Tue 17 Jan 17 @ 5:16 pm
There are a lot of things to consider in order to change the mapper of a device "on the fly"
The most important is that <ONEXIT> action of the old mapper and <ONINIT> of the new will be executed.
For some controllers that's not wise to do while playing live...

Now, back on your subject:
You could always change your current mapper to handle variables and conditions in order the buttons to act differently.

For instance map a button (even on your skin) as "toggle '$MyFunkyMap'"

Then change the mapping of your button to something like this:
var_equal '$MyFunkyMap' 1 ? Advanced Modified Stuff : Original Stuff

You can even expand the above example to have multiple variations:
"cycle '$MyFunkyMap' 3"
var_equal '$MyFunkyMap' 0 ? Original Stuff : var_equal '$MyFunkyMap' 1 ? other action 1 : var_equal '$MyFunkyMap' 2 ? other action 2

Or even you can automate the behavior of the button(s):
video ? video_transition : effect_activate
In this example, the button behaves differently if video output is enabled, and differently if it's disabled.
 

Posté Tue 17 Jan 17 @ 5:27 pm
Phantom, i'm trying understand your example but I think what I wanted is different thing.

I have this MAPPERS made.
1. KEYMAP 1
2. KEYMAP 2
3. KEYMAP 3
etc....

this is just examples some script might not make sense.

KEYMAP 1
KEYBOARD P play ? nothing : play
KEYBOARD Z play ? cue_3 ? delete_cue 3 : nothing : Play

KEYMAP 2
KEYBOARD P video ? effect_video : unload
KEYBOARD Z whatever ? DO'NT DO IT : DO IT

KEYMAP 3
KEYBOARD P DIFFERENFE ? NOT : OK


question is, How can I cycle thru this 3 MAPPERS (KEYMAP 1,2,3) ? With a push of a button ? Without going to CONFIG and make a selection (let's say out of 5 MAPPERS) ?

Also, let's say that NONE of the MAPPERS have any ONEXIT or ONINIT (it's for Keyboard not controllers).

I hope it could be done (saves some steps)
 

Posté Tue 17 Jan 17 @ 6:21 pm
Step 1:
On your keyboard remap 2 buttons like this:
<map value="{" action="cycle '$Keymap' -4" />
<map value="}" action="cycle '$Keymap' 4" />
Step 2:
On a custom button on your skin assign this action:
get_var '$Keymap'
and set the button name to "query" (that's mandatory, don't skip)
This will show you which "mapper" is active.
Step 3:
Map your keys like this (here it's example for key "P" as you typed it above:
<map value="P" action="var_equal '$Keymap' 1 ? video ? effect_video : unload : var_equal '$Keymap' 2 ? DIFFERENFE ? NOT : OK : play ? nothing : play" />
On the above example we execute the part in bold when "$Keymap' is not 1 or 2. Therefore the action in bold will execute if '$Keymap' is 0 or 3
In other words, the part in bold is the "default" mapping we want for the button.
Look this example:
<map value="P" action="var_equal '$Keymap' 0 ? : play ? nothing : play : var_equal '$Keymap' 1 ? video ? effect_video : unload : var_equal '$Keymap' 2 ? DIFFERENFE ? NOT : OK" />
In this example we don't have a "default" mapping. So, the P button won't do anything if '$Keymap' is equal to 3
Both ways are correct to map and use. It only depends on how you want your buttons to behave.
Another thing is that this way you DON'T have to remap every button.
If button "G" is doing the same on "all" keymaps then it's mapping can be:
<map value="G" action="loop" />
 

Posté Tue 17 Jan 17 @ 6:59 pm
thanks Phantom. I will slowly go with your instructions (& I mean slowly). I will report back when done.


edit....

I got # 1 & 2... lost in 3

I'm trying but somehow I am getting really confuse so, here are my 3 MAPPERS that I created (let's called it KEYMAP 1, 2 ,3 )
This are the actual scripts in my 3 MAPPERS


KEYMAP 1
Keyboard "P"
play ? repeat_start_instant 'levelSweep' 10ms 101 & level & param_smaller 1% ? stop & level 100% & repeat_stop 'levelSweep' & stop : level -1% : stop

KEYMAP 2
Keyboard "P"
deck 1 play ? nothing : deck 1 unload & sidelist_load_and_remove & deck 1 level 75% & goto 100% & goto -80ms & set_cue 3 & goto 0% & goto 1ms

KEYMAP 3
KEYBOARD "P"
deck 1 play ? has_cue 3 ? goto_cue 3 : repeat_song : deck 1 load "C:\Magic DJ\Jingles - Samplers - Fillers\Drum Effects & Instruments\Jingles - Drum Roll (with ending).mp3" & deck 1 play


How can I combined this 3 into ONE line with Keyboard "P" ?

Thanks for your time... I really like to get this done so I don't have to keep going into the CONFIG.


 

Posté Wed 18 Jan 17 @ 2:00 am
Here's the final script in 3 lines. Each line shows one variation:

var_equal '$Keymap' 2 ? deck 1 play ? nothing : deck 1 unload & sidelist_load_and_remove & deck 1 level 75% & goto 100% & goto -80ms & set_cue 3 & goto 0% & goto 1ms

: var_equal '$Keymap' 3 ? deck 1 play ? has_cue 3 ? goto_cue 3 : repeat_song : deck 1 load "C:\Magic DJ\Jingles - Samplers - Fillers\Drum Effects & Instruments\Jingles - Drum Roll (with ending).mp3" & deck 1 play

: play ? repeat_start_instant 'levelSweep' 10ms 101 & level & param_smaller 1% ? stop & level 100% & repeat_stop 'levelSweep' & stop : level -1% : stop

And here's a "copy/paste™" ready version of it:
var_equal '$Keymap' 2 ? deck 1 play ? nothing : deck 1 unload & sidelist_load_and_remove & deck 1 level 75% & goto 100% & goto -80ms & set_cue 3 & goto 0% & goto 1ms : var_equal '$Keymap' 3 ? deck 1 play ? has_cue 3 ? goto_cue 3 : repeat_song : deck 1 load "C:\Magic DJ\Jingles - Samplers - Fillers\Drum Effects & Instruments\Jingles - Drum Roll (with ending).mp3" & deck 1 play : play ? repeat_start_instant 'levelSweep' 10ms 101 & level & param_smaller 1% ? stop & level 100% & repeat_stop 'levelSweep' & stop : level -1% : stop
 

Posté Wed 18 Jan 17 @ 8:17 am
Phantom you've solve his issue and that's very good but is there anyway you could solve mine? Just a copy paste for map switching. Thanks
 

Posté Wed 18 Jan 17 @ 12:05 pm
That's not map switching.
That's a SINGLE mapper that the buttons act differently depending on a "Keymap" variable.

You can do the same for your own mappers.
You didn't provide any examples and therefore I can't help you further, but the general approach is the same
PhantomDeejay wrote :
Step 1:
On your keyboard remap 2 buttons like this:
<map value="{" action="cycle '$Keymap' -4" />
<map value="}" action="cycle '$Keymap' 4" />
Step 2:
On a custom button on your skin assign this action:
get_var '$Keymap'
and set the button name to "query" (that's mandatory, don't skip)
This will show you which "mapper" is active.
Step 3:
Map your keys like this (here it's example for key "P"):
<map value="P" action="var_equal '$Keymap' 1 ? action from mapper 2 : var_equal '$Keymap' 2 ? action from mapper 3 : var_equal '$Keymap' 3 ? action from mapper 4 : action from mapper 1" />


 

Posté Wed 18 Jan 17 @ 12:15 pm
Thanks a million Phantom. I will copy and paste and give a try.

I will try to understand how it's done (cause I have to do this with 4 more buttons).

I use a Remote medial player gadget (Airclick USB by Griffen) that has 5 buttons.

I will slowly analyze what you did there and change the mappings in its place for the other button functions.

P.S. Thanks for the SKIN also (SS3) that is the only one I use. cause its perfect for my needs.
 

Posté Wed 18 Jan 17 @ 5:21 pm
WoW ! ! I got all 5 buttons to function correctly.

Thanks again Phatom.

Just have to remember the Keymap 0 & 1 is KEYMAP 1 ( is there a way to remove the 0)?

I tried changing the CYCLE '$KEYMAP' 4 to 3 and it will display 0,1,2 but then I lose the KEYMAP 3 function.

or should I change the var_equal '$Keymap values to 1 & 2 instead of the 2 & 3 ?

also, anyway we can name the 'Query' ? to display MAP Names instead of just NUMBERS ?

Thanks. Now I need to combined all the rest of the COMMON keys (buttons) all into a new COMBINED MAPPER.
 

Posté Wed 18 Jan 17 @ 7:11 pm
No, zero value cannot be removed by default.
For the query (custom button) use this:

var_equal '$Keymap' 1 ? get_text 'Variation 1' : var_equal '$Keymap' 2 ? get_text 'Another Variation' : var_equal '$Keymap' 3 ? get_text 'Final Variation' : get_text 'Default Mapping'

Of course you can change the text in italics to your own
 

Posté Thu 19 Jan 17 @ 8:42 am
Thanks again Phantom, this really puts the icing on the cake.
 

Posté Thu 19 Jan 17 @ 3:32 pm
Guys I'm not that good with scripting as you. All i want to do is map 2 keys to flip through my maps like how i can flip through my sample banks. I have zero clue to what phantom wrote. Such is life.
 

Posté Fri 20 Jan 17 @ 1:29 am
Kev, like Phantom said above, you have not provided examples.... or better yet, why not COPY/PASTE the scripts from the mappers.

Maybe yours might be different of what I need done.
 

Posté Fri 20 Jan 17 @ 4:16 am
91%