/ HALion Developer Resource / HALion Macro Page / Templates /

Curve Editor


On this page:


Curve Editor

Description

The Curve Editor template allows you to display and edit curves, such as the custom curve of the Velocity Curve MIDI module or the modulation matrix, for example. The template contains controls to adjust the values of the selected node and the minimum and maximum of the curve. These controls must be part of the template and they must use the UI variables as defined in the template to connect with the Curve Editor Control.

❕ The Curve Editor Control cannot be created manually in the GUI Tree. Please load the template from the Basic Controls library to use it. You can adapt the look and feel of the template to the requirements of your macro page with the Properties and Colors as described below. If certain controls are not required or wanted, they can be removed.

To explore the functionality and connections:

  1. Load the Init Basic Controls.vstpreset from the Basic Controls library.
  2. Open the Macro Page Designer, go to the GUI Tree and navigate to "Pages > Curve Editor Page".
  3. Select "Curve Editor" and click Edit Element Edit Element to examine the template.

Template Properties

PopertyDescription
NameThe name of the element. This name will be displayed in the GUI Tree.
Position/SizePosition X, Position Y, Width, Height: Position and size of the element in pixels. Position X/Y defines the position of the upper left corner.
AttachDefines how an element behaves when its parent element is resized. You can set the following parameters:
  • Left: If the parent element is resized, the element remains attached to left edge, with the specified ratio.
  • Right: If the parent element is resized, the element moves relatively to the right edge, with the specified ratio.
  • Top: If the parent element is resized, the element remains attached to top edge, with the specified ratio.
  • Bottom: If the parent element is resized, the element moves relatively to the bottom edge, with the specified ratio.
  • Left + Right: If the parent element is resized, the element is resized horizontally relatively to the left and right edges, with the specified ratio.
TooltipText that appears as a tooltip when the mouse hovers over the element.
TemplateDetermines the template to be referenced.

Template Parameters

ParameterDescription
Curve DataConnect this to the FuncData parameter of the Velocity Curve MIDI module, for example.
MinCompresses the curve vertically from the bottom. Connect this to the Minimum parameter of a Velocity Curve MIDI module, for example.
MaxCompresses the curve vertically from the top. Connect this to the Maximum parameter of a Velocity Curve MIDI module, for example.
Play PosAllows you to connect a parameter that sends the current value on the curve, e.g., input to output velocity.

Components inside the Template

Curve Editor Template

UI Variables

The following variables are needed to allow the communication between the curve editor and other controls in the template.

VariableDescriptionTypeRange
curveThe curvature of the selected node.float-10 - 10
valYThe y-value of the selected node.float0 - 1
valXThe x-value of the selected node.float0 - 1
indexThe index of the selected node.integer0 - 100

Controls and Subtemplates

ItemDescription
curveeditorThe Curve Editor control. The properties FuncData, Minimum, and Maximum are exported and thus are available as template parameters. The exported Minimum and Maximum properties and the exported Value property of Slider Min and Slider Max (see below) share the same name for the template parameters and therefore appear only as one template parameter, Min and Max respectively, on the instance level of the template. For more details about the configuration of the control, see Curve Editor Control.
Slider MaxA slider template. The Value property of this slider template is exported and thus available as template parameter. It shares the name Maxwith the exported Maximum property of the Curve Editor control. Therefore, both exported properties appear only as one template parameter.
Slider MinA slider template. The Value property of this slider template is exported and thus available as template parameter. It shares the name Minwith the exported Minimum property of the Curve Editor control. Therefore, both exported properties appear only as one template parameter.
EditA group of valuebox templates for displaying and editing the values of the selected node. The controls are connected to the Curve Editor control by the UI variables defined above. The respective UI variable must be set as Value to establish the connection.
  • ValX: A valuebox template to control the x-value of the selected node. Its Value is set to @valX.
  • ValY: A valuebox template to control the y-value of the selected node. Its Value is set to @valY.
  • Curve: A valuebox template to control the curvature of the selected node. Its Value is set to @curve.
  • Index: A valuebox template to select the index of the node to be edited. Its Value is set to @index.
imageA Bitmap resource for an embedded frame around the curve editor.

Curve Editor Control

The look and feel of the Curve Editor control can be configured with the following properties and colors.

Properties

PropertyDescription
NameThe name of the element. This name will be displayed in the GUI Tree.
Position/SizePosition X, Position Y, Width, Height: Position and size of the element in pixels. Position X/Y defines the position of the upper left corner.
AttachDefines how an element behaves when its parent element is resized. You can set the following parameters:
  • Left: If the parent element is resized, the element remains attached to left edge, with the specified ratio.
  • Right: If the parent element is resized, the element moves relatively to the right edge, with the specified ratio.
  • Top: If the parent element is resized, the element remains attached to top edge, with the specified ratio.
  • Bottom: If the parent element is resized, the element moves relatively to the bottom edge, with the specified ratio.
  • Left + Right: If the parent element is resized, the element is resized horizontally relatively to the left and right edges, with the specified ratio.
TooltipText that appears as a tooltip when the mouse hovers over the element.
Style
  • Bipolar: Activate this for bipolar curves like pitch or pan.
  • Cross: Shows cross lines when editing a node.
  • Grid: Shows a grid behind the curve.
  • Play Pos: Shows the position of the current value on the curve.
  • Nodes: Shows the nodes.
  • Add/Rem: Allows you to add and remove nodes, otherwise a fixed number of nodes is used.
  • Sel Node: Allows to select a node.
  • No Margins: Activate this if you want to draw the curve using the full rectangle. ScaleX and ScaleY are clipped if No Margins is enabled. Therefore, you should deactivate them.
  • Scale X: Shows a scale for the x-axis.
  • Scale Y: Shows a scale for the y-axis.
FuncDataExport this property to the instance level of the template and connect the corresponding template parameter to the FuncData parameter of the Velocity Curve MIDI module, for example.
Grid
  • MinX: Defines the minimum value of the horizontal grid.
  • MaxX: Defines the maximum value of the horizontal grid.
  • MinY: Defines the minimum value of the vertical grid.
  • MaxY: Defines the maximum value of the vertical grid.
Selected Node
  • Index: The index of the selected node. Connected to the valuebox template Index by the UI variable @index.
  • X: The x-value of the selected node. Connected to the valuebox template ValX by the UI variable @valX.
  • Y: The y-value of the selected node. Connected to the valuebox template ValY by the UI variable @valY.
  • Curve: The curvature of the selected node. Connected to the valuebox template Curve by the UI variable @curve.
MinimumCompresses the curve vertically from the bottom. Export this property to the instance level of the template and connect the corresponding template parameter to the Minimum parameter of the Velocity Curve MIDI module, for example.
MaximumCompresses the curve vertically from the top. Export this property to the instance level of the template and connect the corresponding template parameter to the Maximum parameter of the Velocity Curve MIDI module, for example.
Play PosAllows you to connect a parameter that sends the current value on the curve, e.g., input to output velocity. The Play Pos style must be activated to get access to this.

Colors

❕ Some colors are only available if the corresponding Style options are active.

PropertyDescription
LineLine color between the nodes.
FillFill color of the nodes.
FillSelectedFill color of the selected node.
FrameFocusFrame color of the focussed node.
FrameFrame color of the nodes.
HoverHover frame color of the nodes.
CrosshairNode edit crosshair color.
Play PosColor of the position indicator of the current value on the curve.
BorderOverall border color.
Grid VVertical grid color.
Grid V2Vertical fine grid color.
Grid V3Additional vertical fine grid color.
Grid HHorizontal grid color.
Grid H2Horizontal fine grid color.
ScaleScale font color.