快速登录:  

Forum: General Discussion

话题: Script School - Page: 18.20
locodogPRO InfinityModeratorMember since 2013
get_beat_bar & some applied maths.

May as well write something, and I last said, get_beat_bar, so what is it?
It returns a value between 0.0 & 1.0 to represent the current position of the current bar,
if it returns 0.25, you're exactly on the second beat, 0.5 third beat.

it accepts a parameter [any positive integer]
so get_beat_bar 1, returns 0.5 when you are half way between two beats
get_beat_bar 32, returns 0.5 when you are exactly on the 17th beat.

lets make something with it. How about an echo that turns itself off

effect_active 'echo' on & repeat_start 'rsEchoEnd' 30ms -1 & param_bigger `get_beat_bar 4` 0.03125 ? effect_active 'echo' off & repeat_stop 'rsEchoEnd' : nothing

nothing much to it, echo on, rsi started, when 0.03125 is bigger than what beat_bar 4 returns, turn the fx off and the rsi off

let's do something a bit more involved.
let's make the filter dial oscillate from off [50%] to 80% and back over 8 beats. button on button off

Without thinking we'll do the bits we can do without thinking, button on button off logic, is a rsi running? yes stop it : no so we'll start it

repeat_start_instant 'filtOsc' ? repeat_stop 'filtOsc' : repeat_start_instant 'filtOsc' 30ms -1 &...


we have some things to figure out. Lets think about going up from 0.5 to 0.8 first.

when beat_bar 8 returns 0.0 we want the filter to be 0.5
when beat_bar 8 returns 0.5 we want the filter to be 0.8
so 0.5 change from beat_bar is 0.3 change in the filter, so 3/5ths, multiply by 0.6, then add 0.5 because our filters start is 0.5

get_beat_bar 8 & param_multiply 0.6 & param_add 0.5 & param_cast & filter

test that on a button, it seems to work, but it breaks our design spec when beat_bar returns more than 0.5, let's check for beat_bar >0.5

param_bigger `get_beat_bar 8` 0.5 ? 0.5 is bigger than beat_bar, we have the script for that : 0.5 is smaller than beat_bar, we need to work out how to do that.

0.0 to 0.5 worked very well for the way up, how can we get 0.5 to 0.0 for the way down?
well, 1 - get_beat_bar 8 would do that but how to script that.

get_beat_bar 8 & param_multiply -1 & param_add 1 &

*SIDE NOTE AT THE END*

try it out on a test button
get_beat_bar 8 & param_multiply -1 & param_add 1 & param_multiply 0.6 & param_add 0.5 & param_cast & filter

seems ok when beat bar is > 0.5, lets combine both buttons and the >/< 0.5 check

param_bigger `get_beat_bar 8` 0.5 ? get_beat_bar 8 & param_multiply 0.6 & param_add 0.5 & param_cast & filter : get_beat_bar 8 & param_multiply -1 & param_add 1 & param_multiply 0.6 & param_add 0.5 & param_cast & filter


Strap it all together, job done

repeat_start_instant 'filtOsc' ? repeat_stop 'filtOsc' : repeat_start_instant 'filtOsc' 30ms -1 & param_bigger `get_beat_bar 8` 0.5 ? get_beat_bar 8 & param_multiply 0.6 & param_add 0.5 & param_cast & filter : get_beat_bar 8 & param_multiply -1 & param_add 1 & param_multiply 0.6 & param_add 0.5 & param_cast & filter


Side note
get_beat_bar 8 & param_multiply -1 & param_add 1 &
works but could also be expressed as
get_beat_bar 8 & param_invert &
 

发表时间 Thu 07 Oct 21 @ 6:02 am
mg_1978PRO InfinityMember since 2008
wow!!
 

发表时间 Thu 07 Oct 21 @ 8:29 am
mg_1978PRO InfinityMember since 2008
hi at all! i’m modifying sampler page and i would record with pad 9-16 in rightdeck what i “play” samples 1-8 in leftedeck..like a sequencer. i’m in “Recordings bank” and i have put 8 samples..in this way i can play samples in leftdeck….in rightdeck with pad 9-16 i would record what i play (for this i have a var ‘bank’ = 0 for pad 1-8 and 1 for pad 9-16) and i have mapped pad 1:
var ‘bank’ 1 ? leftdeck ? sampler_bank ‘recordings bank’ ? sampler_loaded 9 ? sampler_pad 9 : sampler_rec 9 ‘master’ : sampler_pad 9 ‘master’ : sampler_bank ‘recordings bank’ ? sampler_loaded 9 ? sampler_pad 9 : sampler_rec 9 ‘master’ : sampler_loaded 9 : var ‘bank’ 0 ? leftdeck ? sampler_bank ‘recordings bank’ ? sampler_loaded 1 ? sampler_pad 1 : sampler_rec 1 ‘master’ : sampler_pad 1 : sampler_bank ‘recordings bank’ ? sampler_loaded 1 ? sampler_pad 1 : sampler_rec 1 ‘master’ : sampler_pad 1 : nothing

and i have mapped param1:
param_bigger 0.5 ? var ‘bank’ 0 ? sampler_loaded 8 ? set ‘bank’ 1 : nothing : var ‘bank’ 1 ? set ‘bank’ 0

but my problem is in rightdeck (with var ‘bank’ 1) sampler_pad 9 ‘play’ same sample in leftdeck sampler_pad 1 (with var ‘bank’ 0) :(
can you help me?
thanks!
 

发表时间 Thu 07 Oct 21 @ 8:52 am
mg_1978PRO InfinityMember since 2008
hi, is there a script to zoom scratch zone (in Pro Skin)…i have tried zoom_scratch but zoom only deck waveform..thanks a lot
 

发表时间 Sat 16 Oct 21 @ 10:20 pm
locodogPRO InfinityModeratorMember since 2013
zoom_vertical
 

发表时间 Sat 16 Oct 21 @ 10:29 pm
mg_1978PRO InfinityMember since 2008
locodog wrote :
zoom_vertical


yeah! thanks

 

发表时间 Sun 17 Oct 21 @ 6:58 am
twagaPRO InfinityMember since 2009
I want to scratch -60000ms/BPM (scratch backwards by one beat).
Is there a way to write a VDJ script to achieve this?
I'm not sure how to combine the scratch and get_bpm command with param_multiply or param_1_x.
 

发表时间 Sun 17 Oct 21 @ 6:39 pm
locodogPRO InfinityModeratorMember since 2013
scratch_dna "-Q"
try that, not exactly sure what you're after.
 

发表时间 Sun 17 Oct 21 @ 6:54 pm
mg_1978PRO InfinityMember since 2008
hi! i have mapped an encoder that move a sample in sideview ‘sampler’ with var ‘samplermove’ 1:
encoder: browser_window ‘sampler’ ? var ‘samplermove’ 1 ? param_smaller 0 ? browser_move -1 : browser_move +1 : nothing : nothing
but, for example, if i move sample 1 to 3 position and i play with pad 3 i can’t listen new sample in position 3, but i listen old sample 3 :( is not a really moving with script ‘browser_move’?
thanks who help me
 

发表时间 Sun 17 Oct 21 @ 10:14 pm
locodogPRO InfinityModeratorMember since 2013
appears so.
 

发表时间 Sun 17 Oct 21 @ 10:53 pm
NicotuxHome userMember since 2014
list looks to visually change, order seem to match but this is only visual and temporary
nothing is done, even using the mouse
exiting the bank and enter the bank again restore initial order
easy to see using sampler pad, no name change

this only moves slot position on screen, but do not move sample from slot to another
nothing save
 

发表时间 Sun 17 Oct 21 @ 11:49 pm
twagaPRO InfinityMember since 2009
Ultimately, I want to play one beat and then scratch back one beat. However, scratch_dna does not allow us to take our hand off the platter and play it.
 

发表时间 Mon 18 Oct 21 @ 5:31 am
locodogPRO InfinityModeratorMember since 2013
@twaga I understand even less now, wanting a script and talking about hand on platter are opposites.
 

发表时间 Mon 18 Oct 21 @ 5:36 am
NicotuxHome userMember since 2014
Not sure about that either
maybe a button to back scratch one beat ?

touchwheel_touch on & param_multiply -60000 `get_bpm & param_1_x` & param_cast ms & scratch & repeat_start ws 1 & repeat_stop ws & touchwheel_touch off
 

发表时间 Mon 18 Oct 21 @ 7:42 am
mg_1978PRO InfinityMember since 2008
Nicotux wrote :
list looks to visually change, order seem to match but this is only visual and temporary
nothing is done, even using the mouse
exiting the bank and enter the bank again restore initial order
easy to see using sampler pad, no name change

this only moves slot position on screen, but do not move sample from slot to another
nothing save

ok thanks!

hi at all, is there a way to add samples with focus in browser_window ‘songs’ to sideview ‘sampler’ (in one sampler bank)? because if focus is in sideview ‘sampler’ with script browser_remove i can remove a sample from sample bank..but i haven’t see a script for add a sample, is there? thanks!!

 

发表时间 Mon 18 Oct 21 @ 8:04 am
twagaPRO InfinityMember since 2009
Nicotux wrote :
Not sure about that either
maybe a button to back scratch one beat ?

touchwheel_touch on & param_multiply -60000 `get_bpm & param_1_x` & param_cast ms & scratch & repeat_start ws 1 & repeat_stop ws & touchwheel_touch off



Thank you very much.
It's a complicated script for me, but could you please tell me the meaning of "ws"?




Ultimately, I would like to make a scratch like this video with VDJscript or scratch_dna.

https://www.youtube.com/watch?v=wRALDF5-jBU


 

发表时间 Mon 18 Oct 21 @ 1:40 pm
NicotuxHome userMember since 2014
There is no special meaning at all, it's the name I gave to the "wait for scratch to end" pseudo loop ;)
(repeat_start needs a name, duration is in parameter (same as scratch duration)
wait delay is needed because "scratch" returns imediately and does not work when jog is not touched
 

发表时间 Mon 18 Oct 21 @ 1:54 pm
mg_1978PRO InfinityMember since 2008
hi, why button script:
get_browsed_folder & param_contains ‘Recordings’ ? loaded ? unload : load : nothing

that if focus is in browser_window ‘songs’ would load in a deck only samples in Recordings Sampler Folder doesn’t work? in a deck i read “no file detected” and under i read “Recordings”…..what is wrong? 🤔
 

发表时间 Mon 18 Oct 21 @ 11:06 pm
mg_1978PRO InfinityMember since 2008
hi, i’m trying to map 2 buttons that make sequencer like Rekordbox (i have Pioneer Ddj-Rzx)…for button play i have solved, but for button record i have this problem: i would that pushed rec button, ‘sampler’ rec be ready to rec, but rec when i push e sampler pad and not instantanealy…is there a script help me? thanks!
 

发表时间 Fri 22 Oct 21 @ 8:03 am
locodogPRO InfinityModeratorMember since 2013
you're calling the sample with a script event, so just make that the moment when you call record too.
 

发表时间 Fri 22 Oct 21 @ 10:45 am
40%