From 8fb76ad09c062055170666de28661bd9da25f98e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 5 Feb 2015 22:37:01 +0000 Subject: Fix events at end of cycle. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5531 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/PortImpl.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index a86061c0..2dafcf32 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -243,10 +243,14 @@ PortImpl::set_voice_value(const Context& context, } break; case PortType::ATOM: if (buffer(voice)->is_sequence()) { - buffer(voice)->append_event(time - context.start(), - sizeof(value), - _bufs.uris().atom_Float, - (const uint8_t*)&value); + const FrameTime offset = time - context.start(); + // Same deal as above + if (offset < context.nframes()) { + buffer(voice)->append_event(time - context.start(), + sizeof(value), + _bufs.uris().atom_Float, + (const uint8_t*)&value); + } _voices->at(voice).set_state.set(context, time, value); } else { fprintf(stderr, -- cgit v1.2.1