First time here? Check out the FAQ!
x

Reset every time when changing the VCS preset

0 votes
378 views
I have an OscillatorTimeIndex and would like that every time I change the VCS preset of the OscillatorTimeIndex, a reset of the Oscillator happens. Is there a way to do this without using the preset prototypes like PresetChange or InterpolatePresets? Maybe a capytalk option?

Thanks,

Knut
asked Oct 5, 2021 in Capytalk & Smalltalk by knut-kaulke (Adept) (2,050 points)

1 Answer

0 votes

Is there an EventValue that you know to be unique to each preset? If so, then you could try:

!anEventValue hasChangedInLast: 0.2 s

in the Reset field of the OscillatorWithTimeIndex.

Alternatively, if you know that at least one of two (or more) EventValues will change, you could use the logic:

(!ev1 + !ev2 + !ev3) hasChangedInLast: 0.2 s

as long as their values don't always add to the same sum (which seems unlikely).

answered Oct 6, 2021 by ssc (Savant) (128,080 points)
This is a really elegant solution. I used it once in a track of my multigrid, which is quite computationally intensive. There the reset signal should not only reset the OscillatorTimeIndex, but also numerous CountTriggersReset commands, which are used in other modules. I noticed that the reset command is not always executed equally. To use a hasChangedInLast command to reset all desired modules, I used it as a TransformedEventExpression in a TransformEventValue prototype for !Reset and inserted the rightmost one in the signal chain. What could be the reason for this faulty reset?
Is there another alternative to hasChangedInLast?
...