Create VST, VST3 and Audio Units with Plug'n Script 3.1

Official support for: bluecataudio.com
Post Reply New Topic
RELATED
PRODUCTS
Plug'n Script

Post

Ok, thanks! :)
(I'm looking for a mouse click detection with coordinates and am almost there with XY_ZOOM_SELECT_PAD, but only for the mouse-up event, so a bit limited. "Pushed" on the pad would be an easy way to detect mouse left button down). Probably there could be another way too.

Post

I keep testing XY_ZOOM_SELECT_PAD and XYZ_PARAM_SCRATCH_PAD, hoping to find solution for detecting mouse_down event.
I thought maybe .capturing attribute will work, if there's no ".pushed".
And it works :)

Here's my test code ( it'll work in PnS Custom Skin http://letimix.com/pns-skin/ ):

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<SKIN layout_type="column" h_margin="8" v_margin="2">


<!-- click pos helper template -->
<TEMPLATE id="CLICK_AREA" width="100%" height="100%" left_click_script="" right_click_script="" x_param_id="" y_param_id="" x_param_create="1" y_param_create="1" mouse_down_param_id="" mouse_down_param_create="1" cursor="system::hand" requires="">
  <LV id="TMPID" value="tmp_param_$LMPR$$LMID$" /><LMID_INC />
  <LV id="TMP_X_ID" value="X_COORD_$TMPID$" />
  <LV id="TMP_Y_ID" value="Y_COORD_$TMPID$" />
  <R index_list="$x_param_id$"><LV id="TMP_X_ID" value="$x_param_id$" /></R>
  <R index_list="$y_param_id$"><LV id="TMP_Y_ID" value="$y_param_id$" /></R>

  <CELL height="$height$" width="$width$">
    <!-- parameters for click detection -->
    <EPARAM id="CLICK_$TMPID$" max="1" default="0.5" />
    <PARAM_LINK from="window.loaded" to="CLICK_$TMPID$.default" reverse="true" />
    <R count="$x_param_create$"><EPARAM id="$TMP_X_ID$" min="0" max="$width$" default="0.5" /></R>
    <R count="$y_param_create$"><EPARAM id="$TMP_Y_ID$" min="0" max="$height$" default="1" /></R>
    <!-- area itself -->
    <XY_ZOOM_SELECT_PAD id="click_area_$TMPID$" height="100%" width="100%" x_enabled="true" x_param_id="$TMP_X_ID$" x_zoom_param_id="CLICK_$TMPID$" y_enabled="true" y_param_id="$TMP_Y_ID$" y_reverse="true" mouse_sensitive="true" cursor="$cursor$" opacity="0" />
    <!-- left click detection -->
    <AT event_id="CLICK_$TMPID$.value_changed" script="CLICK_$TMPID$ = 0.6; $left_click_script$" async="false" condition_formula="(window.loaded==1)*(CLICK_$TMPID$>0.5)" />
    <!-- right click detection -->
    <AT event_id="CLICK_$TMPID$.value_changed" script="CLICK_$TMPID$ = 0.1; $right_click_script$" async="false" condition_formula="(window.loaded==1)*(CLICK_$TMPID$==0)" />
    <!-- mouse down detection -->
    <R index_list="$mouse_down_param_id$">
      <R count="$mouse_down_param_create$" index_name="_tmp"><EPARAM id="$mouse_down_param_id$" /></R>
      <PARAM_LINK from="CLICK_$TMPID$.capturing" to="$mouse_down_param_id$" />
    </R>
  </CELL>
</TEMPLATE>

<LAYER_STACK>
  <SVG_BG  />
  <CLICK_AREA width="400" height="200" left_click_script="LEFT_CLICKS_COUNT++;" right_click_script="RIGHT_CLICKS_COUNT++;" x_param_id="mouse_x" y_param_id="mouse_y" mouse_down_param_id="mouse_down" />

  <!-- 
  	can use custom x, y parameters (not connected to pixels)
  	<EPARAM id="x_pos_custom" max="10000" default="0" type="integer" />
  	<CLICK_AREA width="400" height="200" left_click_script="LEFT_CLICKS_COUNT++;" right_click_script="RIGHT_CLICKS_COUNT++;" x_param_id="x_pos_custom" x_param_create="0" y_param_id="mouse_y" />
  -->
</LAYER_STACK>

<EPARAM id="LEFT_CLICKS_COUNT" max="99999" default="0" type="integer" />
<EPARAM id="RIGHT_CLICKS_COUNT" max="99999" default="0" type="integer" />


<ROW>
	<ROW width="140" internal_h_align="right">
  <PARAM_TEXT_CONTROL param_id="LEFT_CLICKS_COUNT" content="Left: {value}" value_format=".0"  />
  <PARAM_TEXT_CONTROL param_id="RIGHT_CLICKS_COUNT" content=" | Right: {value}" value_format=".0"  />
</ROW>
<ROW width="250" internal_h_align="left">
  <PARAM_TEXT_CONTROL param_id="mouse_x" content=" |  Mouse x: {value}" />
  <PARAM_TEXT_CONTROL param_id="mouse_y" content=", y: {value}" />
  <PARAM_TEXT param_id="mouse_down" content=", down: {value}" value_format=".0" />
</ROW>
</ROW>
</SKIN>

Post

Good morning all!
I am totally new and new to programming ...
I would like to develop a small plug in for my DAw thanks to your wonderful plug n script
I would like to understand the computer language to be able to write these lines of code
I of course read the tutorial with the creation of a gain button but I would like to go a little further
Do you know a site where I could inquire?
Thanks everyone!

Post

For the language itself, you may want to check out the angelscript website and associated resources.

Most of the work however is DSP programming, which may take some time to learn. See the programming resources chapter in the Plug'n Script manual for a few pointers.

Post Reply

Return to “Blue Cat Audio”