How to modify a skin of PatchWork so that it shows the Controls with 0-127 range
-
- KVRist
- 160 posts since 29 Apr, 2008
Hello everydody
What is the code that I have to add to the file layout.inc for show the range 0-127 on the MIDI Controls instead of 0-100.0%?
Experimenting a bit, I did it with the opacity button changing on the file titlebar.inc the value on "max" (and "default"):
<PARAM id="theme.opacity" min="0" max="100" default="100" unit="%" persistent="true" name="Opacity"/>
<PARAM id="theme.opacity" min="0" max="127" default="127" unit="%" persistent="true" name="Opacity"/>
and removing the {unit} label from content="Opacity: {value}{unit}". It was so easy.
Had to change also <THEME_MINI_KNOB param_id="theme.opacity" positions_count="101"> to "128".
So, on the "Assignable Params Knobs" section, I modified:
<THEME_MINI_KNOB param_id="$assignable_param$index$$" positions_count="101" id="assignable_control$index$"/>
to positions_count="128", and now when I move the Control knobs, they show the same proportion that it receives from my controler (midi value 64 -> 50.4%, and not 50.0%).
I tried to add the "max="127" code and value_format=".0" to <PARAM_TO_STRING_LINK from="$assignable_param$index$$" to="assignable_param$index$_value" content=": {text_value} {unit}"/>, but its ignored.
Cheers
What is the code that I have to add to the file layout.inc for show the range 0-127 on the MIDI Controls instead of 0-100.0%?
Experimenting a bit, I did it with the opacity button changing on the file titlebar.inc the value on "max" (and "default"):
<PARAM id="theme.opacity" min="0" max="100" default="100" unit="%" persistent="true" name="Opacity"/>
<PARAM id="theme.opacity" min="0" max="127" default="127" unit="%" persistent="true" name="Opacity"/>
and removing the {unit} label from content="Opacity: {value}{unit}". It was so easy.
Had to change also <THEME_MINI_KNOB param_id="theme.opacity" positions_count="101"> to "128".
So, on the "Assignable Params Knobs" section, I modified:
<THEME_MINI_KNOB param_id="$assignable_param$index$$" positions_count="101" id="assignable_control$index$"/>
to positions_count="128", and now when I move the Control knobs, they show the same proportion that it receives from my controler (midi value 64 -> 50.4%, and not 50.0%).
I tried to add the "max="127" code and value_format=".0" to <PARAM_TO_STRING_LINK from="$assignable_param$index$$" to="assignable_param$index$_value" content=": {text_value} {unit}"/>, but its ignored.
Cheers
-
Blue Cat Audio Blue Cat Audio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=39981
- KVRAF
- 6334 posts since 8 Sep, 2004 from Paris (France)
To do this, you would actually have to use another parameter with 0-127 range, link it from the original parameter and display its value, instead of using the real parameter (you cannot modify the range just for display).
Something like this for example:
Hope this helps!
Something like this for example:
Code: Select all
<!-- Define the parameter for display and link from original parameter -->
<PARAM id="$assignable_param$index$$_0_127" min="0" max="127" value_format=".0"/>
<PARAM_LINK from="$assignable_param$index$$" to="$assignable_param$index$$_0_127" normalized="true">
<!-- Change the source for display string: use the new parameter -->
<PARAM_TO_STRING_LINK from="$assignable_param$index$$_0_127" to="assignable_param$index$_value" content=": {text_value}"/>,
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
It truly did help, thank you !
I was getting this error message:
There were errors while parsing the skin:
- error: Fatal error line 521: expected end of tag 'PARAM_LINK' (layout.inc)
but is because the 2nd tag wasn't closed with " /" at the end:
<PARAM_LINK from="$assignable_param$index$$" to="$assignable_param$index$$_0_127" normalized="true" />
Here is the complete code of the section for everybody:
Regards from IsPain !
I was getting this error message:
There were errors while parsing the skin:
- error: Fatal error line 521: expected end of tag 'PARAM_LINK' (layout.inc)
but is because the 2nd tag wasn't closed with " /" at the end:
<PARAM_LINK from="$assignable_param$index$$" to="$assignable_param$index$$_0_127" normalized="true" />
Here is the complete code of the section for everybody:
Code: Select all
<!-- Assignable Params Knobs-->
<PARAM_LINK from="plug_ins_cell.width" to="assignable_knobs.width"/>
<LAYER_STACK id="assignable_knobs_cell" display="false">
<THEME_GROUP opacity="50%" width="100%" height="100%"/>
<CELL h_margin="4" v_margin="8" id="no_map_message" display="false" >
<TEXT value="No Controls Mapped" text_color="$NO_CONTROLS_MESSAGE_COLOR$"/>
<PARAM_MULTI_LINK from="$mapping_enabled_status_list$" to="no_map_message.display" mux_function="max" reverse="true"/>
</CELL>
<ROW width="$minimum_width$" id="assignable_knobs" reflow="true" spacing="4" v_margin="8" h_margin="6">
<REPEAT count="$assignable_params_count$" start="1">
<LAYER_STACK flex="0" id="assignable_control$index$_cell" display="false">
<THEME_MINI_KNOB param_id="$assignable_param$index$$" positions_count="128" id="assignable_control$index$"/>
<THEME_DSP_PARAM_SMALL_ROUND_SETTINGS_BUTTON param_id="$assignable_param$index$$" v_align="bottom" v_offset="9"/>
<PARAM_LINK from="assignable_control$index$.focus" to="assignable_control$index$_display_link.enabled"/>
<PARAM_TO_STRING_LINK from="$assignable_param$index$$" to="assignable_param$index$_value" content=": {text_value} {unit}"/>
<!-- Define the parameter for display and link from original parameter -->
<PARAM id="$assignable_param$index$$_0_127" min="0" max="127" value_format=".0"/>
<PARAM_LINK from="$assignable_param$index$$" to="$assignable_param$index$$_0_127" normalized="true" />
<!-- Change the source for display string: use the new parameter -->
<PARAM_TO_STRING_LINK from="$assignable_param$index$$_0_127" to="assignable_param$index$_value" content=": {text_value}"/>
<STRING id="assignable_param$index$_number" default="$index$. " />
<STRING id="assignable_param$index$_value" />
<STRING_MULTI_LINK from="assignable_param$index$_number;assigned_param_name$index$;assignable_param$index$_value" to="comment" id="assignable_control$index$_display_link" enabled="false"/>
<TEXT value="$index$" v_align="bottom" h_align="right" font_size="-2" font_style="italic" text_color="$CONTROL_TEXT_COLOR$" h_offset="5" v_offset="2"/>
</LAYER_STACK>
</REPEAT>
</ROW>
</LAYER_STACK>
</COLUMN>
Last edited by hellishvictor on Sun Dec 26, 2021 10:01 pm, edited 1 time in total.
-
Blue Cat Audio Blue Cat Audio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=39981
- KVRAF
- 6334 posts since 8 Sep, 2004 from Paris (France)
Thanks for correcting the typo!
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
Hi again. Today I notice that on the Controls' dialog box still appear as %. What is the parameter to modify this?
Cheers
You do not have the required permissions to view the files attached to this post.
-
- KVRist
- Topic Starter
- 160 posts since 29 Apr, 2008
Help with this will be appreciated, because here I'm not sure if the parameter for modify that is on layout.inc
-
Blue Cat Audio Blue Cat Audio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=39981
- KVRAF
- 6334 posts since 8 Sep, 2004 from Paris (France)
We'll double check but if I remember well, this is because the control is directly connected to the dsp parameter, so that's what you are editing here.