Quick Sign In:  

Forum: General Discussion

Topic: Endless Encoder Loop & Beatjump Mapping
I recently grabbed a MidiFighter Twister to recreate an old Traktor mapping I used on one of my old controllers, which had a few endless encoders. I'm struggling to figure out how to map these using the VDJ script.

I'd like to do the following with the four endless encoders:
- Encoder 1: adjust BOTH the beatjump and loop length for Deck 1 As I scroll the encoder to the right, I'd like both the loop and beatjump length to double; and to halve when scrolling to the left.
- Encoder 2: Move BOTH the beatjump and loop length for Deck 1 As I scroll the encoder to the right, I'd like both the loop location and beatjump to move right for the amount set on encoder 1; and move to the left for the same amount.
- Toggle Encoder 1: Loop turns on/off for Deck 1 when I toggle encoder 1.

- Encoder 3: adjust BOTH the beatjump and loop length for Deck 2 As I scroll the encoder to the right, I'd like both the loop and beatjump length to double; and to halve when scrolling to the left.
- Encoder 4: Move BOTH the beatjump and loop length for Deck 2 As I scroll the encoder to the right, I'd like both the loop location and beatjump to move right for the amount set on encoder 1; and move to the left for the same amount.
- Toggle Encoder 3: Loop turns on/off for Deck 2 when I toggle encoder 3.

How would I map this in the script?

 

Posted Thu 16 Nov 23 @ 10:31 am
locoDogPRO InfinityModeratorMember since 2013
deck 1 beatjump_select & loop_select

deck 1 param_multiply get_loop & param_cast relative & loop_move & param_bigger 0 ? goto 'loopsize+' :
I think on an encoder you wouldn't need the cast

deck 1 param_multiply get_loop & loop_move & param_bigger 0 ? goto 'loopsize+' :

deck 1 loop
 

Posted Thu 16 Nov 23 @ 12:06 pm
Just to make things easier:
Is the only reason you want to adjust the beatjump size the same time with the loopsize so that you can move the loop around by it's entire length ?

Because if that's the only reason you want beatjump and loop length synchronized then VirtualDJ has scripts that can move the loop based on it's length. So you don't need to worry about beatjump size.

For instance
Encoder 1: deck 1 loop_select
Encoder 2: param_bigger 0 ? deck 1 loop_move +100% : deck 1 loop_move -100%
Encoder 3: deck 2 loop_select
Encoder 4: param_bigger 0 ? deck 2 loop_move +100% : deck 2 loop_move -100%
Encoder 1 Push: deck 1 loop
Encoder 2 Push: deck 2 loop

For encoders 2/4 you can also use these alternatives:
Enc 2: param_bigger 0 ? deck 1 loop_move +100% & deck 1 goto 'loopsize+' : deck 1 loop_move -100%
Enc 4: param_bigger 0 ? deck 2 loop_move +100% & deck 2 goto 'loopsize+' : deck 2 loop_move -100%

The difference is only in forward movement of the loop.
The first script example advances the loop, but not the playing head which catches up naturally the "new" loop position instead of jumping to it.
The alternative script example advances the loop and then jumps the playing head inside it in the new position.

If there's any other reason besides moving the loop that you want beatjump to have the same value as loop length, then try to use the scripts Locodog provided.
 

Posted Thu 16 Nov 23 @ 12:14 pm
locoDogPRO InfinityModeratorMember since 2013
^Enc 2/4^ would need beatjump +1 or goto 'loopsize+' on the bigger side of the query ?
 

Posted Thu 16 Nov 23 @ 12:20 pm
Depends on the desired behavior.
Since I personally work with small loops (usually up to 8 beats) I prefer to let the deck forward naturally and capture the "new" loop rather than jump to it.
So yes, alternatives are:

param_bigger 0 ? deck 1 loop_move +100% & deck 1 goto 'loopsize+' : deck 1 loop_move -100%
and
param_bigger 0 ? deck 2 loop_move +100% & deck 2 goto 'loopsize+' : deck 2 loop_move -100%

I also updated the original post to include those examples as well
 

Posted Thu 16 Nov 23 @ 2:24 pm
Hmm, thus far neither of these routes are working for me.

This script only moves things in one direction, and very fast.
param_bigger 0 ? deck 1 loop_move +100% & deck 1 goto 'loopsize+' : deck 1 loop_move -100%
 

Posted Mon 20 Nov 23 @ 1:58 am
 

Posted Mon 20 Nov 23 @ 4:44 am
locoDogPRO InfinityModeratorMember since 2013
deck 1 param_multiply 100 & loop_select

deck 1 param_multiply 100 & param_multiply get_loop & loop_move & param_bigger 0 ? goto 'loopsize+' : loop on ? : goto 'loopsize-'
 

Posted Mon 20 Nov 23 @ 5:15 am
djdadPRO InfinityDevelopment ManagerMember since 2005
Sorry for coming late to the party. I just realized you are using the Midi Fighter Twister.
The Encoders of the device, are not the "traditional" click-by-step ones, and have high resolution. In order to make them work like encoders (and have "normal steps"), they are defined in the internal definition file with a certain sensitivity, which sometimes is not enough, but cannot be changed via Mapping.
I have sent you an email with further details and instructions
 

Posted Mon 20 Nov 23 @ 4:43 pm
Thanks DJDad for helping me out here! For anyone else trying to do something similar, here's the script I used for the beatjump / loop move that worked for me:

deck left set a & param_bigger 0.2 `get_var a` ? loop ? loop_move +100% & set a 0 : goto 'loopsize+' & set a 0 : param_smaller -0.2 `get_var a` ? loop ? loop_move -100% & set a 0 : goto 'loopsize-' & set a 0 : nothing

I still need to play with the loop settings a bit where, when moving an active loop, the loop moves in a way snapped to a grid and only up or down the number of beats of the loop. For example, if I have an active 8 beat loop, it tends to go up/down 16 beats and not snapped to the grid but sort of based on where the song is playing.
 

Posted Thu 23 Nov 23 @ 8:37 am
RES3SPRO InfinityMember since 2021
For what it's worth: I've been doing this on my AKAI APC using pads with the following. This DOES keep the loop start/stop positions on the grid where you want them.
deck 1 loop_move +100% & deck 1 goto 'loopsize+'
deck 1 loop_move -100% & deck 1 goto 'loopsize-'
deck 2 loop_move +100% & deck 2 goto 'loopsize+'
deck 2 loop_move -100% & deck 2 goto 'loopsize-'
 

Posted Wed 27 Dec 23 @ 2:09 pm
I Just got the Rane Four and am trying to add this code to it so it does what a pioneer does .When I make a loop i can then move that loop the same distance as the loop value without effecting the music playing. i'm replacing the beat jump buttons on deck one and two to change to loop move . this code doesn't specify where to add it. it works for deck 1 but I'm not sure where to put the code for deck two. What am I doing wrong ? Please help havnt done this in a while . Ive used my DDJSZ2 since it was first out.
RES3S wrote :
For what it's worth: I've been doing this on my AKAI APC using pads with the following. This DOES keep the loop start/stop positions on the grid where you want them.
deck 1 loop_move +100% & deck 1 goto 'loopsize+'
deck 1 loop_move -100% & deck 1 goto 'loopsize-'
deck 2 loop_move +100% & deck 2 goto 'loopsize+'
deck 2 loop_move -100% & deck 2 goto 'loopsize-'


 

Posted Mon 12 Feb 24 @ 3:30 pm
locoDogPRO InfinityModeratorMember since 2013
param_bigger 0 ? loop_move +100% : param_bigger "get_loop_in_time" "get_time elapsed absolute 1000" ? goto 'loopsize-' & loop_move -100% : loop_move -100%


maybe something like this.
edit simplified
 

Posted Mon 12 Feb 24 @ 4:21 pm