mirror of
https://github.com/xodio/xod.git
synced 2026-03-25 01:56:54 +01:00
fix(xod/core): fix xod/core/delta to work just like before adding pulses into tabtests
This commit is contained in:
@@ -12,15 +12,16 @@ void evaluate(Context ctx) {
|
||||
auto inValue = getValue<input_IN>(ctx);
|
||||
|
||||
if (isInputDirty<input_RST>(ctx)) {
|
||||
state->refValue = 0;
|
||||
emitValue<output_OUT>(ctx, inValue);
|
||||
state->refValue = inValue;
|
||||
emitValue<output_OUT>(ctx, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isInputDirty<input_REF>(ctx)) {
|
||||
state->refValue = inValue;
|
||||
if (!isInputDirty<input_UPD>(ctx)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto outValue = inValue - state->refValue;
|
||||
emitValue<output_OUT>(ctx, outValue);
|
||||
state->refValue = inValue;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
IN BIAS RST OUT
|
||||
IN UPD RST OUT
|
||||
0 no-pulse no-pulse 0
|
||||
10 pulse no-pulse 0
|
||||
30 no-pulse no-pulse 20
|
||||
0 no-pulse no-pulse -10
|
||||
20 no-pulse pulse 20
|
||||
10 no-pulse no-pulse 10
|
||||
10 pulse no-pulse 0
|
||||
10 pulse pulse 10
|
||||
50 no-pulse no-pulse 50
|
||||
10 pulse no-pulse 10
|
||||
30 no-pulse no-pulse 10
|
||||
20 no-pulse pulse 0
|
||||
30 pulse no-pulse 10
|
||||
50 pulse no-pulse 20
|
||||
10 pulse no-pulse -40
|
||||
10 pulse pulse 0
|
||||
5 pulse no-pulse -5
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"description": "Outputs a difference between the current `IN` value and its reference value.",
|
||||
"description": "Calculates difference between current and past input values.",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "HyJCAXqNG",
|
||||
@@ -10,9 +10,9 @@
|
||||
"type": "xod/patch-nodes/not-implemented-in-xod"
|
||||
},
|
||||
{
|
||||
"description": "Triggers memoization of the input value as the reference value.",
|
||||
"description": "Update: trigger a calculation and store the current `IN` value as the new “past” value.",
|
||||
"id": "S1bhCQqVM",
|
||||
"label": "REF",
|
||||
"label": "UPD",
|
||||
"position": {
|
||||
"x": 102,
|
||||
"y": 0
|
||||
@@ -20,7 +20,7 @@
|
||||
"type": "xod/patch-nodes/input-pulse"
|
||||
},
|
||||
{
|
||||
"description": "The difference between `IN` and the reference value which was stored when `REF` received a pulse. Can be positive or negative. Always equals to 0 on the first update.",
|
||||
"description": "The last difference value.",
|
||||
"id": "SkFpRm9Nz",
|
||||
"position": {
|
||||
"x": 34,
|
||||
@@ -29,7 +29,7 @@
|
||||
"type": "xod/patch-nodes/output-number"
|
||||
},
|
||||
{
|
||||
"description": "Resets the reference value to 0.",
|
||||
"description": "Resets the stored past value to the current input value. Efficiently sets `OUT` to 0.",
|
||||
"id": "SyYn0X5NM",
|
||||
"label": "RST",
|
||||
"position": {
|
||||
|
||||
Reference in New Issue
Block a user