I’m going through the vvvv tutorials and I’m wondering how to increment a value every x amount of time.
If I were using Processing or P5 then I would do currentValue += increment every frame.
In my vvvv patch I’ve decided to use an LFO joined to a counter as my timer. The value of the counter is added to the position every time the LFO crosses a threshold. Is this the best approach to repeatedly increment a value in vvvv?
Also, one weird thing I encountered. I tried to use ‘equals’ logic to reset my counter, say when counter equals 1000 reset the counter to 0. However vvvv does not let me connect the equals output to the reset pin of the counter even though they are both boolean values. Oddly it does let me do it if I create a new equals node which has boolean inputs manually entered.
public class MyPatch
{
float Value = 0;
void Update()
{
var newValue = Value + 0.02;
if (Value > 1)
newValue = -1;
Value = newValue;
// Damper + Circle things
}
}
Hey, thank you for pointing me at the Integrator node and taking the time to show me the patches. Super helpful.
Option two is very programmery :) Also a good example of how to use the IF region.
I have not understood what pads are in Gamma and how they work. Do you know if there is documentation? For example how does the pad know what it should get initialised to at the beginning.
a pad (aka property) is just a field of the surrounding data type/patch. it is initialized with the default value on creation of the instance (just like in any other OOP language). if you want to initialize it with another value on create, you can do it like that: