快速登录:  

Forum: VirtualDJ Technical Support

话题: Getting the name and status of current sampler effect
The below action code starts and stops the kick drum:

sampler_bank 3 &
sampler_play_stop 1


The below button code with back ticks displays the word 'Instrument' on the button
`get_sampler_bank`

How can I instead have it display the name of the instrument like 'Kick' and have the button show it's active?

:-/
 

发表时间 Sat 20 Apr 24 @ 10:08 pm
Does get_sample_name not do the job?
 

发表时间 Sat 20 Apr 24 @ 10:35 pm
groovindj wrote :
Does get_sample_name not do the job?


Great that's half of it. It doesn't show the status of the button though.
 

发表时间 Sat 20 Apr 24 @ 11:03 pm
locoDogPRO InfinityModeratorMember since 2013
sampler_bank 3 & sampler_play_stop 1 & sampler_play 1 ? on : off
 

发表时间 Sat 20 Apr 24 @ 11:44 pm
locoDog wrote :
sampler_bank 3 & sampler_play_stop 1 & sampler_play 1 ? on : off


Interesting, I tried that full command in back ticks but that didn't do the trick and just displays the text "on" in the custom button.
If I leave
sampler_bank 3 & sampler_play_stop 1
In the action code
and put
sampler_play 1 ? on : off
in the button name, the actual button toggles between the text "on" and the text "?"

Just to be clear this is for the custom buttons displayed on the laptop screen in VDJ.

Thanks

 

发表时间 Sun 21 Apr 24 @ 12:05 am
locoDogPRO InfinityModeratorMember since 2013
what I posted was the button action, not the name.
 

发表时间 Sun 21 Apr 24 @ 12:21 am
locoDog wrote :
what I posted was the button action, not the name.


Yep tried that and this in the action code with no luck:
sampler_bank 3 & sampler_play_stop 1 & sampler_play 1 ? color "red": color "green"

Closer when I use the following code back ticked in the custom name which shows the text "Red" or "Green" depending on state but it doesn't change the color of the button
sampler_play on ? color "Green" : color "Red"

This is all entered into the virtual DJ embedded Button Editor. Not using the template editor for this setup.

Is there more documentation than the Wiki, sorry maybe I am missing something.
 

发表时间 Sun 21 Apr 24 @ 12:56 am
locoDogPRO InfinityModeratorMember since 2013
custom buttons don't do colour, they do on|off
 

发表时间 Sun 21 Apr 24 @ 1:38 am
locoDog wrote :
custom buttons don't do colour, they do on|off



Hmmm, OK let's say I have the following button in my custom template:

<button deck="master" class="myPopupWin" action="custom_button 68" textaction="custom_button_name 68" rightclick="custom_button_edit 68" textcolor="textoff3" query="sampler_play 1 ? on : off">
<pos x="816" y="5"/>
<size width="100" height="35"/>
<up x="5" y="45"/>
<selected x="115" y="45"/>
<over x="225" y="45"/>

<off color="red" border_size="1" border="gray"/>
<on color="green" border_size="1" border="white"/>

<text size="14" font="Arial" weight="bold" align="center" color="#ffc8c8c8"/>
<textselected size="14" font="Arial" weight="bold" align="center" color="#ffffffff" text="[TEXT]"/>
<textover size="12" font="Arial" weight="normal" align="center" color="#ffFFFF00" />
</button>


Adding the query to the button doesn't seem to do the trick either unless I'm still mangling the use of the query.

Update: but ? blink : off does work
 

发表时间 Sun 21 Apr 24 @ 2:29 am
OK thanks @locodog & @groovindj

For now I created a custom button in a window popup via a new skin that just shows when I enable the kick drum and allowing toggling.

@locodog the query worked in the template but I couldn't use the on tag but the selected tag worked:

<button deck="master" class="toolbarX" action="custom_button 68" textaction="custom_button_name 68" rightclick="custom_button_edit 68" textcolor="yellow" query="(param_equal get_sampler_bank_id 3 && sampler_play 1) ? blink : off">
<pos x="816" y="5"/>
<size width="100" height="35"/>
<up x="5" y="45" radius="5" color="#550000" gradient="vertical" color2="#330000" border_size="5" border="#CCDDCC"/>
<selected x="115" y="45" radius="5" color="#009900" gradient="vertical" color2="#005500" border_size="5" border="#CCDDCC"/>
<over x="225" y="45" color="grey" radius="5" gradient="vertical" color2="grey" border_size="5" border="#CCDDCC"/>
<off color="black" border_size="5" border="#393939" gradient="vertical" color2="grey"/>
<text size="14" font="Arial" weight="bold" align="center" color="#ffc8c8c8"/>
<textselected size="14" font="Arial" weight="bold" align="center" text="[TEXT]"/>
<textover size="12" font="Arial" weight="normal" align="center" color="#ffFFFF00" />
</button>


This is fine for the most part but curious if I can add anything to the query that can determine wh
 

发表时间 Sun 21 Apr 24 @ 4:57 pm
Update:
This doesn't work perfectly. It will blink only when the kick drum f/x is running and the instrument bank is loaded. There are scenarios where you might start a kick drum and then load another f/x which will stop the display of the blinking of the button.

If I find a solution I'll post it.
 

发表时间 Sun 21 Apr 24 @ 6:25 pm
locoDogPRO InfinityModeratorMember since 2013
just call the sample by name then

sampler_play_stop "135 (1)"
 

发表时间 Sun 21 Apr 24 @ 6:42 pm
locoDog wrote :
just call the sample by name then

sampler_play_stop "135 (1)"


@Locodog, you're the master!

(sampler_play_stop 'Kick Hard') ? blink : off"
 

发表时间 Mon 22 Apr 24 @ 1:31 am