快速登录:  

Forum: General Discussion

话题: Need help with controller custom button coding
Krisyx PRO SubscriberMember since 2014
i have a pioneer srt 1000, im trying to create a custom button for it but it doesn't work the way I want this is the code:

down ? scratch +150ms : scratch -150ms

when I try this on the keyboard mapping it works the way I want; which is it repeats the first condition (scratch +150ms) while the button is pressed and does the second condition (scratch -150ms) when not pressed.

That doesn't seem to be the case on the controller; it does the first command (scratch +150ms ) and wait for the button to be released then it does the second command (scratch -150ms)

so im not able to hold the button down to keep the action going
 

发表时间 Mon 07 Mar 22 @ 3:22 pm
That's because a keyboard buttons is automatic repeatable
Like if you are writing an email and hold down a letter
So the mapping does what it's supposed to do

But your shouldn't use the scratch action when you have an actual controller
It sounds pretty awful - it's meant for absolute beginners that don't have controllers, and a left-over from old versions of VDJ

If you don't want to do simple baby-scratches on your controller (that will be a lot better), then you can use the Scratch DNA feature which is also a lot better than the scratch action

Another also better option is triggering/looping a scratch sample
 

发表时间 Mon 07 Mar 22 @ 3:30 pm
Krisyx PRO SubscriberMember since 2014
I'm aware of all of that; I want it for the you reason you described, training purposes. I'm trying to have the buttons on my controller work in a similar fashion as my keyboard hence I'm trying to figure that out. this is just a code example I'm using to test,
I'm hoping for a repeat solution or something of that nature
or someone who knows the way to nest multiple functions within a condition (if this is possible)
 

发表时间 Mon 07 Mar 22 @ 8:14 pm
Krisyx wrote :
I'm aware of all of that; I want it for the you reason you described, training purposes. I'm trying to have the buttons on my controller work in a similar fashion as my keyboard hence I'm trying to figure that out. this is just a code example I'm using to test,
I'm hoping for a repeat solution or something of that nature
or someone who knows the way to nest multiple functions within a condition (if this is possible)

Oh ok :)

Like explained the repeater of your keyboard key is part of how a keyboard works
So if you want repeater somewhere else, you need to script it using repeat_start or repeat_start_instant

In your case you would get something like:
up ? repeat_stop 'scratcher' & scratch -60ms : repeat_start_instant 'scratcher' 0.125bt & scratch +60ms
which will continue the 60ms forward scratch every 1/8 of a beat, and then do one backward scratch when released

Or the other way around, and with 120ms scratches:
up ? repeat_stop 'scratcher' & scratch +120ms : repeat_start_instant 'scratcher' 0.125bt & scratch -120ms

Of course you may want to combine the 2 better to get back and forth scratching, but the above is closer to what a keyboard key would do
 

发表时间 Tue 08 Mar 22 @ 8:48 am
To get the back and forth result with scratchdna, in case you also like that, this simple scratchdna script is a lot better:
scratch_dna 'EAEAEAEA.EAEAEAEA'
... of course there are a million patters you can apply to it

You can then change if you want the scratch "on top" of the playing track, or want it to be a real scratch by using this toggle script:
scratch_dna_option 'drymix'

And you can toggle if you want the scratching to be quantized/"in time" by using this toggle script
scratch_dna_option 'quantized'
 

发表时间 Tue 08 Mar 22 @ 8:56 am
Krisyx PRO SubscriberMember since 2014
damn this is impressive thank u so much

 

发表时间 Tue 08 Mar 22 @ 3:52 pm