Connexion rapide:  

Forum: General Discussion

Sujet Automix with 1 beat loop & noise blend

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

I'm having a problem with the following script which I posted on my private BB which I took apart and I get parts of it working but when it all goes together, it's not quite doing what it should. The reason for this is this BB doesn't allow formatting code with an outline with the correct indents to differentiate where conditionals start and end.

This script should start a loop of 1 on both decks and start noise at .01 on the left & .99 on the right and both noise f/x knobs should spin by themselves in opposite directions as a mix goes across decks. If you look carefully you see I sync the left deck to the right before doing a crossfade. Later I will change this somehow so that no matter what side you start the mix from it will initiate the sync from the opposite deck but let's see right now if someone can help me figure out why it's not sliding left to right. Interestingly enough I remove the param_add section to either the active or default then the knob spins. It's almost like with the +0.01 and -0.01 are adding together on both knobs (almost like a bug)

My LoopNoiseAutomix Code

I'll also post the code here for anyone familiar with a single liner:

color "yellow" & deck left effect "Noise" active on & deck right effect "Noise" active on & set $noiseactive 0.01 & get_var "$noiseactive" & param_cast & deck left effect_slider 'Noise' & set $noisedefault 0.99 & get_var "$noisedefault" & param_cast & deck right effect_slider 'Noise' & deck right goto_first_beat & deck left play & deck right play &deck left loop 1 & deck right loop 1 & deck right sync & crossfader & param_smaller 0.5 ? crossfader 0% & repeat_start "myRepeater1" 33ms 101 & get_var "$noiseactive" & param_add +0.01 & param_cast & deck left effect_slider 'Noise' & get_var "$noisedefault" & param_add -0.01 & param_cast & deck right effect_slider 'Noise' & crossfader +1% & crossfader 100% ? deck right loop 0 & deck left loop 0 & deck right effect "Noise" active off & deck left effect "Noise" active off : nothing : crossfader 100% & repeat_start "myRepeater2" 33ms 101 & get_var "$noiseactive" & param_add 0.01 & param_cast & deck left effect_slider 'Noise' & get_var "$noisedefault" & param_add -0.01 & param_cast & deck right effect_slider 'Noise' & crossfader -1% & crossfader 0% ? deck right loop 0 & deck left loop 0 & deck right effect "Noise" active off & deck left effect "Noise" active off : nothing


Now look if i remark out the decreasing value on the right noise position knob while the crossfader is supposed to move right (crossfader near the left and where the value is smaller than 50% halfway) and remark out the increasing value on the left noise position knob while the crossfader is supposed to move left (crossfader near the right){seems vdj script just skips code between &'s that it doesn't understand and continues on}

color "yellow" & deck left effect "Noise" active on & deck right effect "Noise" active on & set $noiseactive 0.01 & get_var "$noiseactive" & param_cast & deck left effect_slider 'Noise' & set $noisedefault 0.99 & get_var "$noisedefault" & param_cast & deck right effect_slider 'Noise' & deck right goto_first_beat & deck left play & deck right play &deck left loop 1 & deck right loop 1 & deck right sync & crossfader & param_smaller 0.5 ? crossfader 0% & repeat_start "myRepeater1" 33ms 101 & get_var "$noiseactive" & param_add +0.01 & param_cast & deck left effect_slider 'Noise' & *get_var "$noisedefault" & *param_add -0.01 & *param_cast & *deck right effect_slider 'Noise' & crossfader +1% & crossfader 100% ? deck right loop 0 & deck left loop 0 & deck right effect "Noise" active off & deck left effect "Noise" active off : nothing : crossfader 100% & repeat_start "myRepeater2" 33ms 101 & *get_var "$noiseactive" & *param_add 0.01 & *param_cast & *deck left effect_slider 'Noise' & get_var "$noisedefault" & param_add -0.01 & param_cast & deck right effect_slider 'Noise' & crossfader -1% & crossfader 0% ? deck right loop 0 & deck left loop 0 & deck right effect "Noise" active off & deck left effect "Noise" active off : nothing


Hmm still working on it...
One of these commands keeps returning false no matter where the slider is and that's why it seems to keep starting from the right side

color "yellow" &
deck left effect "Noise" active on &
deck right effect "Noise" active on &
set $noiseactive 0.01 &
get_var "$noiseactive" &
param_cast &
deck left effect_slider 'Noise' &
set $noisedefault 0.99 &
get_var "$noisedefault" &
param_cast &
deck right effect_slider 'Noise' &
deck right goto_first_beat &
deck left play &
deck right play &
deck left loop 1 &
deck right loop 1 &
deck right sync &
crossfader &
param_smaller 0.5
? crossfader 0% & more of my commands
: crossfader 100% & more of my commands




If anyone is interested in the perl script file (which uses regex) to convert it from a formatted vdj script to the single liner, let me know and I'll post it here.

 

Posté Fri 20 Jan 17 @ 1:58 am
I could spot A LOT of errors just by looking at your code, not even by trying to run it.
Before I give you a code to start working on, here are some remarks:

1) skip the "color" action. That's for leds
2) Always use quotes around variables (e.g on 4th line you should have set '$noiseactive')
3) Include spaces where needed (e.g. &deck left loop should be & deck left loop)
4) Asterisk is NOT valid on VDJ script (e.g. & *param_add -0.01 should be & param_add -0.01)
5) Use VALID VirtualDj 8 syntax, and not deprecated version 7 syntax on your script (e.g. effect "Noise" active on should be effect_active 'Noise' on)

Finally: Instead of using variables and adding them and casting them and blah blah why don't you set the sliders directly ?

Try the following code and modify it to fit your needs:

deck left effect_slider 'Noise' 1 0.01 & deck right effect_slider 'Noise' 1 0.99 & deck left effect_activate "Noise" on & deck & deck right effect_active 'Noise' on & deck right goto_first_beat & deck left play & deck right play & deck left loop 1 & deck right loop 1 & deck right sync & param_smaller 0.5 crossfader ? crossfader 0 & repeat_start 'myRepeater1' 33ms & param_equal 1 crossfader ? deck left loop_exit & deck right loop_exit & deck left effect_active 'Noise' off & deck right effect_active 'Noise' off & repeat_stop 'myRepeater1' : deck left effect_slider 'Noise' 1 +0.01 & deck right effect_slider 'Noise' 1 -0.01 & crossfader +0.01 : crossfader 1 & repeat_start 'myRepeater2' 33ms & param_equal 0 crossfader ? deck left loop_exit & deck right loop_exit & deck left effect_active 'Noise' off & deck right effect_active 'Noise' off & repeat_stop 'myRepeater2' : deck left effect_slider 'Noise' 1 -0.01 & deck right effect_slider 'Noise' 1 +0.01 & crossfader -0.01

PS: If I get right what you want to do the correct code should be this:
param_smaller 0.5 crossfader ? crossfader 0 & deck left effect_slider 'Noise' 1 0.01 & deck right effect_slider 'Noise' 1 0.99 & deck left effect_activate "Noise" on & deck right effect_active 'Noise' on & deck right goto_first_beat & deck left play & deck right play & deck left loop 1 & deck right loop 1 & deck right sync & deck left repeat_start_instant 'myRepeater1' 33ms & param_equal 1.0 crossfader ? deck left loop_exit & deck right loop_exit & deck left effect_active 'Noise' off & deck right effect_active 'Noise' off & deck left repeat_stop 'myRepeater1' : deck left effect_slider 'Noise' 1 +0.01 & deck right effect_slider 'Noise' 1 -0.01 & crossfader +0.01 : crossfader 1 & deck left effect_slider 'Noise' 1 0.99 & deck right effect_slider 'Noise' 1 0.01 & deck left effect_activate 'Noise' on & deck right effect_active 'Noise' on & deck left goto_first_beat & deck left play & deck right play & deck left loop 1 & deck right loop 1 & deck left sync & deck right repeat_start_instant 'myRepeater2' 33ms & param_equal 0 crossfader ? deck left loop_exit & deck right loop_exit & deck left effect_active 'Noise' off & deck right effect_active 'Noise' off & deck right repeat_stop 'myRepeater2' : deck left effect_slider 'Noise' 1 -0.01 & deck right effect_slider 'Noise' 1 +0.01 & crossfader -0.01


 

Posté Fri 20 Jan 17 @ 1:23 pm
locoDogPRO InfinityModeratorMember since 2013
nassausky wrote :
If anyone is interested in the perl script file (which uses regex) to convert it from a formatted vdj script to the single liner, let me know and I'll post it here.


FYI, vdj script ignores new line chars and tab chars so you can use your logic tree formatted script directly in the mapping/pad editors

Also, np++ ctrl+j will join lines

 

Posté Fri 20 Jan 17 @ 3:10 pm
@PhantomDeejay your first (unbolded) code is exactly the effect I wanted. Perfect thanks.

1) skip the "color" action. That's for leds
Yep was just playing, that wasn't important but it would be nice for the buttons in virtual dj to change colors. Didn't look into that yet.

2) Always use quotes around variables (e.g on 4th line you should have set '$noiseactive')
I apologize I was just reading a post 2 days ago that you mentioned that.

3) Include spaces where needed (e.g. &deck left loop should be & deck left loop)
That one got by without me seeing it.

4) Asterisk is NOT valid on VDJ script (e.g. & *param_add -0.01 should be & param_add -0.01)
The playing around I've done so far when I put the * in front it leaves my code but it seems to bypass that section. I'm taking those out for now but will play around more with it for debugging purposes.

5) Use VALID VirtualDj 8 syntax, and not deprecated version 7 syntax on your script (e.g. effect "Noise" active on should be effect_active 'Noise' on)
I keep hearing that there is certain syntax for VDJ8 vs VDJ7 but I don't see it specifically say which is which in the manuals online. As I continue working with all this coding I'll get used to it more. Thanks.


@locodog. Thanks that's interesting and I'm definitely going to try that out now.. Feature request would be a bigger code window when you open up the buttons. I hope scripting gets better for editing and specifically debugging so we can see whatever errors we have in the code.
 

Posté Sat 21 Jan 17 @ 1:45 am
Oh yeah @locodog I was just reading back again and thought about what you said..You hit the nail on the head. How did you know I use notepad ++. Who else would know np++ is that acronym haha. Nice!

 

Posté Tue 24 Jan 17 @ 9:36 pm
locoDogPRO InfinityModeratorMember since 2013
There are better text editors for regex but in general np++ is the weapon of choice for many.

I've just tabbed up my launchpad 2 mapper so I can use alt+shift and alt+c for column writing, it saves so much pain.

As for debugging, just set a var to a number for each part [query/reply] of the script, if the script doesn't work check the var_list to see where it stopped.
 

Posté Tue 24 Jan 17 @ 10:23 pm
Not a bad idea at all. Thanks @loco
 

Posté Wed 25 Jan 17 @ 3:33 pm


(Les anciens sujets et forums sont automatiquement fermés)