Skip to content

Commit

Permalink
SegmentPlayer: Tidyups
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Jan 23, 2024
1 parent c2f0cc8 commit 1cf5ed9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions source/include/signalflow/node/buffer/segment-player.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ class SegmentPlayer : public Node
BufferRef buffer;
PropertyRef onsets;

/*
* If phase is stored as a float, rounding errors quickly accumulate for non-integer rates
* and cause detuning. Should investigate whether this also affects other oscillators...
*/
/*--------------------------------------------------------------------------------
* If phase is stored as a float, rounding errors quickly accumulate for
* non-integer rates and cause detuning. Should investigate whether this also
* affects other oscillators...
*--------------------------------------------------------------------------------*/
double phase;
NodeRef index;
NodeRef rate;
Expand Down
2 changes: 1 addition & 1 deletion source/src/node/buffer/segment-player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ void SegmentPlayer::set_buffer(std::string name, BufferRef buffer)
{
if (name == "buffer")
{
this->Node::set_buffer(name, buffer);
this->num_output_channels = buffer->get_num_channels();
this->rate_scale_factor = buffer->get_sample_rate() / graph->get_sample_rate();
}
this->Node::set_buffer(name, buffer);
}

void SegmentPlayer::process(Buffer &out, int num_frames)
Expand Down

0 comments on commit 1cf5ed9

Please sign in to comment.