Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
Meter

Language Guide / Controls and Parameters · Generated API signature

Meter

klang::Meter

Creates a meter for a value supplied by the model.

Use a meter to display a value calculated by the model. Write to it as the value changes. The optional minimum, maximum, and initial value default to 0, 1, and 0. Set the range in the same units as the measurement.

Basic use

Add the control to the model’s Controls collection during setup.

controls = { Meter("Output") };

Optional properties

Choose a range and initial value in the units your model sends to the meter. This example displays a level from −60 to 0 dB and starts at −60 dB.

controls = { Meter("Output", -60, 0, -60) };

Optional placement and size

Pass Control::Size as the last argument. Its values are x, y, width, and height. Omit it for automatic layout.

controls = { Meter("Output", 0, 1, 0, { 0, 0, 120, 24 }) };