RSS Twitter Facebook
g200kg > KnobMan Online Help > 11.Dynamic Texts

KnobMan Online Help

2008/06/19

11.Dynamic Texts



Dynamic Texts

In the 'Text' type primitive, the text is specified by the 'Text' field. It can contain two special syntax for dynamic changing texts between frames.

comma separated texts
if the text has multiple parts separated by comma( , ), for example "A,B,C", the A and B and C will be assigned between frames.

ex) "Sin,Tri,Sqr,Saw,Noise"

contiguous numbers
if the text has following format, it will be expand to the sequence of the numbers.

(FromNumber:ToNumber[:StepNumber] [:FormatString][:FomulaString])

Parameters after third can be omitted. the most simple form is (1:100). if add the step number, it will be (1:100:10), or add formatstrig (1:100:%03d). You can also add the FomulaString (0:100:%.2f:pow(2,x/100)). Note that you cannot omit the FormatString if you use FomulaString. If all parameter used (0:100:1:%3.1f:pow(10,x/100)).

For example, the default text of the text primitive is (1:99), it will be expand to "1,2,3,4,......98,99". if the last value is less than the first value, the sequence will be decremental. in addition, the first or last value can be negatve.

if you need detail formatting, the C-like format string can be added. for example "(0:99:%02d)",

Format String:
format string can be following form

%[+][0][width][.precision]type

+ add '+' sign if the value is positive (optional)
0padding by '0' (optional)
widthminimum number of output width (optional)
.precision the number of the decimal portion digits. used for the 'f' type(optional)
type c a character by ascii code
dsigned decimal
xhexadecimal lower case
Xhexadecimal upper case
ffloating point

format string examples

  • "%d" -99 / 0 / 99
  • "%+d" -99 / +0 / +99
  • "%02d" 00 / 49 / 99
  • "%02X 00 / 7F / FF
  • "%.1f" 0.0 / 0.5 / 1.0

In almost case, 'f' type is used with a fraction number step. ex) "0:1:0.1:%.1f" will be expanded to 0.0 to 1.0 with 0.1 step : 0.0,0.1,0.2,0.3...1.0

If no format string is specified, it is equivalent to "%d".

Fomula String:

The FomulaString allow the complex value definition by mathematical fomula. In this fomula, the original value are represented by 'x' and converted by operators/builtin funcitons. Available operators and builtin functions are bellow.

Operator+Plus
-Minus
*Multiply
/Division
Functionlog(x)logarithm (base e)
log10(x)logarithm (base 10)
exp(x)exponential
pow(x,y)x power of y
sqrt(x)square root

For example, if you need exponential curved values from 10 to 1000, the text-string is

(0:100:%.2f:10*pow(100,x/100))

The formula "10*pow(100,x/100)" is the FormulaString that convert the range 1-100 to 1-500 exponentialy.

combination
comma separated texts and contiguous numbers can be used in the combinaton. following is a 'Pan Control' sample.

L(50:1),<C>,R(1:50)

it will be expand to

L50,L49,...L2,L1,<C>,R1,R2,...R49,R50


Return


g200kg