koadrobot/aritmatics@0.1.3

License: GPL 3.0

Aritmatic nodes. 0.0.1: [01.02.2019]: Scale - (number/duty/to-duty), 0.0.2: [03.02.2019]: Counter - (avg/for/loop/step), 0.0.3: [04.02.2019]: Avg/Normalize/Ratio, 0.0.6: [05.02.2019]: Discretize - (ceil/floor/round/step), 0.1.0: [11.02.2019]: First Released. 0.1.1: [15.02.2019]: Counter - (loop-back) 0.1.2: [23.02.2019]: Added info.
NodeDescription
aallNo description
avg
Calculate average of inputs. (di-do is temp values for variadic)
constrain
Clip number. Min..Max. (calculate min/max for min<x<max)
counter(avg)
Stores a number which gets incremented on each `INC` pulse. AVG=SUM/IDX
counter(for)
Count from start to stop with step at each INC pulse. When RST pulse is received counting start (again). If use START is greater than STOP for decresing. STEP is converted to pozitive always. At end of the counting loop (to reach STOP), LOOP pulse transmit. If Last Inc/Dec bigger/smaller then STOP, STOP value transmit.
counter(loop)
Count from start to stop with step at each IVAL millisec. When RST pulse is received reset clock and start (again). If use START is greater than STOP for decresing. STEP is converted to pozitive always. At end of the counting loop (to reach STOP), LOOP pulse transmit. Count again. If Last Inc/Dec bigger/smaller then STOP, STOP value transmit.
counter(loop-back)
Count from start to stop and stop to start with step at each IVAL millisec. When RST pulse is received reset clock and start (again). If use START is greater than STOP for decresing. STEP is converted to pozitive always. At end of the counting loop (to reach STOP), LOOP pulse transmit. Count to BACKWARD.
counter(step)
Stores a number which gets incremented on each `INC` pulse.
discretize(ceil)
If input `X` is between the threshold `T0`, `T1`, ..., `T𝑛` then output is the LOWER threshold. If `X` is even greater than the last threshold, the value is round down to it.
discretize(floor)
If input `X` is between the threshold `T0`, `T1`, ..., `T𝑛` then output is the UPPER threshold. If `X` is even greater than the last threshold, the value is round down to it.
discretize(round)
If input `X` is between the threshold `T0`, `T1`, ..., `T𝑛` then output is the ROUND threshold. If `X` is even greater than the last threshold, the value is round down to it.
discretize(step)
If input `X` is between the threshold from start to stop. If `X` is even greater than the last threshold, the value is round to it.
normalize
Normalize X in Start..Stop. Clip X. Output is Norm (0..1.0). Start is 0 of Norm, Stop is 1.0 of Norm. X=-2, Start=10, Stop=0 then Norm is 1.2. Normalize= (X-Start) / (Stop-Start) Sdiff : +..+..--..-- Tdiff : +..--..+..-- Norm=+..--..--..+
ratio
Ratio = (Sstop-Sstart) / (TStop-TStart) Sdiff : +..+..--..-- Tdiff : +..--..+..-- Ratio=+..--..--..+
scale(duty)
Scale input duty (0..1) to value by Tmin..Tmax (map) with ensure (min<max).
scale(number)
Sacle value (map) with check min<max.
scale(to-duty)
Scale input value to duty (0..1) by Start..Stop (map) with ensure (Start<Stop ).
To use the nodes in your project you should have the koadrobot/aritmatics library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.