PnS - Output strings for native scripts

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

Post

Hello,
I have a x64 binary that outputs a string to outputStrings[0] and is accessed in KUIML using $script_output_string0$, and this works as expected. When exporting the plugin as a VST, however, what is the equivalent variable for custom non-PnS skins? I tried dsp.output_string0, but it's already populated with the script loading status, and it seems output strings 0-5 are already used for the script name, description etc. Are $script_output_stringX$ and dsp.output_stringX different things altogether? If so, how can I use DSP_EXPORT array<string> outputStrings(1) with custom KUIML skins?
Thanks!

(Edit: I found my outputString[0] to be dsp.output_string28, but it displays the name of the string as set by outputStringsNames() rather than its contents)

Post

If you look at the mapping.inc file in the original PnS skin, you will find the following for strings:

Code: Select all

 <!-- Output Strings ******************************************************-->
    <NEXT_OUTPUT_STRING id="script_status_string"/>
    <NEXT_OUTPUT_STRING id="script_name_string"/>
    <NEXT_OUTPUT_STRING id="script_description_string"/>
    <NEXT_OUTPUT_STRING id="script_author_string"/>
    <NEXT_OUTPUT_STRING id="script_file_path"/>
    <NEXT_OUTPUT_STRING id="log_file_path"/>
    <NEXT_OUTPUT_STRING id="script_doc_path"/>
    <NEXT_OUTPUT_STRING id="script_gui_path"/>

    <REPEAT count="$SCRIPT_PARAMS_COUNT$">
        <NEXT_OUTPUT_STRING id="script_input_param$index$_name"/>
        <NEXT_OUTPUT_STRING id="script_input_param$index$_unit"/>
        <NEXT_OUTPUT_STRING id="script_input_param$index$_enum_values"/>
        <NEXT_OUTPUT_STRING id="script_input_param$index$_value_format"/>
    </REPEAT>
    <REPEAT count="$SCRIPT_OUT_PARAMS_COUNT$">
        <NEXT_OUTPUT_STRING id="script_output_param$index$_name"/>
        <NEXT_OUTPUT_STRING id="script_output_param$index$_unit"/>
        <NEXT_OUTPUT_STRING id="script_output_param$index$_enum_values"/>
        <NEXT_OUTPUT_STRING id="script_output_param$index$_value_format"/>
    </REPEAT>
    <REPEAT count="$SCRIPT_STRINGS_COUNT$">
        <NEXT_OUTPUT_STRING id="script_input_string$index$_name"/>
    </REPEAT>
	<REPEAT count="$SCRIPT_OUT_STRINGS_COUNT$">
        <NEXT_OUTPUT_STRING id="script_output_string$index$_name"/>
    </REPEAT>
	 <REPEAT count="$SCRIPT_OUT_STRINGS_COUNT$">
        <NEXT_OUTPUT_STRING id="script_output_string$index$"/>
   </REPEAT>
   
So the offset for the strings is a bit larger than that. I advise you to use the same mapping file and macros in your own skin to make sure that it is compatible with future updates, as the output strings layout may change when some features are added.

Post

Oh wow, OK! Thanks for the information :)

Post

ajl1606 wrote: Wed Aug 16, 2023 9:31 am Oh wow, OK! Thanks for the information :)
You are welcome!

Post

You can also take a look here:
https://pns.letimix.com/how-to/add-para ... nveniently

My formula for that is:

<!-- custom output strings start index -->
<VAR id="N" formula="if ($SCRIPT_EDIT_MODE$, 360, 8 + ($PLUGIN_INPUT_PARAMS_COUNT$-1)*4 + $PLUGIN_OUTPUT_PARAMS_COUNT$*4 + 16 + 16)" />
<VAR id="MY_OUT_STRING_A" value="dsp.output_string$N$" /><NEXT_N />
<VAR id="MY_OUT_STRING_B" value="dsp.output_string$N$" /><NEXT_N />

<TEXT string_id="$MY_OUT_STRING_A$" />
<TEXT string_id="$MY_OUT_STRING_B$" />

Post

That's neat, thanks Ilya!

Post Reply

Return to “Blue Cat Audio”