summaryrefslogtreecommitdiffstats
path: root/src/server/Buffer.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-01-17 16:20:34 -0500
committerDavid Robillard <d@drobilla.net>2016-01-17 16:20:34 -0500
commit05def9fc79404a032709e955fb0f8f3abf440398 (patch)
tree61d7775addd6f4b89f3977a3eb2f97d37551b33b /src/server/Buffer.cpp
parent8e33bca074954cf57883e51551b214e66829bed1 (diff)
downloadingen-05def9fc79404a032709e955fb0f8f3abf440398.tar.gz
ingen-05def9fc79404a032709e955fb0f8f3abf440398.tar.bz2
ingen-05def9fc79404a032709e955fb0f8f3abf440398.zip
Fix CPU overload with some CV to control arcs
Diffstat (limited to 'src/server/Buffer.cpp')
-rw-r--r--src/server/Buffer.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp
index 8a36039e..4fbb44f9 100644
--- a/src/server/Buffer.cpp
+++ b/src/server/Buffer.cpp
@@ -347,19 +347,19 @@ Buffer::next_value_offset(SampleCount offset, SampleCount end) const
return ev->time.frames;
}
}
- } else if (is_audio()) {
- /* FIXME: This results in split cycles when a CV output port is
- connected to a control input port. In the worst case, that could
- run the receiving plugin every sample. Some way of controlling this
- behaviour is needed. */
- float val = samples()[offset];
- for (SampleCount i = offset + 1; i < end; ++i) {
- if (samples()[i] != val) {
- return i;
- }
- }
}
+ /* For CV buffers, it's possible to scan for a value change here, which for
+ stepped CV would do the right thing, but in the worst case (e.g. with
+ sine waves), when connected to a control port would split the cycle for
+ every frame which isn't feasible. Instead, just return end, so the
+ cycle will not be split.
+
+ A plugin that takes CV and emits discrete change events, possibly with a
+ maximum rate or fuzz factor, would allow the user to choose which
+ behaviour, at the cost of some overhead.
+ */
+
return end;
}