[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] Re: Latch init bug



On Dec 20, 2009, at 10:31 PM, James Harkins wrote:

I think the issue is that Latch should initialize its output to the input value, instead of as is currently assumed. After changing the last line of Latch_Ctor to this:

ZOUT0(0) = ZIN0(0); // 0.f;

... the test case above (with Latch) returns the expected 128.562 value.

Better (because Latch might not trigger at first, in which case its output really should be 0):

ZOUT0(0) = ZIN0(1) > 0.f ? ZIN0(0) : 0.f;

OK?
hjh


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman