Skip to content

Commit 510d5e5

Browse files
committed
Fix Line unit test
1 parent c2684c3 commit 510d5e5

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

source/src/node/envelope/line.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ Line::Line(NodeRef start, NodeRef end, NodeRef time, NodeRef loop, NodeRef clock
1717

1818
this->alloc();
1919

20-
if (!clock)
21-
{
22-
this->trigger();
23-
}
20+
// Don't trigger immediately as start/end times can only be read when inputs have been processed.
21+
// Init-time trigger happens at the start of process().
2422
}
2523

2624
void Line::alloc()
@@ -51,7 +49,7 @@ void Line::process(Buffer &out, int num_frames)
5149
{
5250
for (int frame = 0; frame < num_frames; frame++)
5351
{
54-
if (SIGNALFLOW_CHECK_CHANNEL_TRIGGER(clock, channel, frame))
52+
if (SIGNALFLOW_CHECK_CHANNEL_TRIGGER(clock, channel, frame) || (!clock && !this->duration_samples[channel]))
5553
{
5654
this->step[channel] = 0;
5755
this->duration_samples[channel] = this->graph->get_sample_rate() * this->time->out[channel][frame] - 1;

0 commit comments

Comments
 (0)