From 1f0f01c0adcf8228e8f4efdd0340cf48484780d1 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Tue, 17 Nov 2020 19:53:06 -0800 Subject: [PATCH] Timeline: Don't send the same OSC control sequence value twice and so avoid messing with OSC learning in non-mixer when transport is stopped. --- timeline/src/Control_Sequence.C | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/timeline/src/Control_Sequence.C b/timeline/src/Control_Sequence.C index 9fda53a..f5ba68d 100644 --- a/timeline/src/Control_Sequence.C +++ b/timeline/src/Control_Sequence.C @@ -634,12 +634,15 @@ Control_Sequence::process_osc ( void ) if ( _osc_output() ) { - sample_t buf[1]; + sample_t buf = 0; + + play( &buf, (nframes_t)transport->frame, (nframes_t) 1 ); - *buf = 0; - - play( buf, (nframes_t)transport->frame, (nframes_t) 1 ); - _osc_output()->value( (float)buf[0] ); + /* only send value if it is significantly different from the last value sent */ + if ( fabsf( _osc_output()->value() - (float)buf ) > 0.001 ) + { + _osc_output()->value( (float)buf ); + } } }