From 614fea7343a94ee5c2ac0cf296568f24e8907c9d Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 26 Feb 2012 22:38:51 -0800 Subject: [PATCH] Don't drop the first notes of phrases when playing in sequence mode. --- src/phrase.C | 14 +++++--------- src/sequence.C | 9 ++++----- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/phrase.C b/src/phrase.C index f47b54b..da28640 100644 --- a/src/phrase.C +++ b/src/phrase.C @@ -178,14 +178,10 @@ phrase::play ( tick_t start, tick_t end ) if ( start > _end ) { - WARNING( "attempt to play a phrase that has ended (%lu, %lu)", start, _end ); + _playing = false; return; } - else - if ( start < _start ) - // not ready yet - return; - + if ( start < _start ) start = _start; @@ -226,10 +222,10 @@ try_again: if ( tse > start ) { pattern *p = pattern::pattern_by_number( 1 + note_to_y( e->note() ) ); - + if ( ! p->playing() ) - p->trigger( ts, offset + e->link()->timestamp() ); - + p->trigger( ts, tse ); + p->play( start, end ); } } diff --git a/src/sequence.C b/src/sequence.C index 87ca64b..5a488ae 100644 --- a/src/sequence.C +++ b/src/sequence.C @@ -209,16 +209,15 @@ sequence::play ( tick_t start, tick_t end ) const tick_t pend = offset + p->length(); // this phrase seems to be current. - if ( pend > start ) + if ( pend > start && pstart <= end ) { - // FIXME: don't really need to trigger more than once! + p->trigger( pstart, pend ); + _playing = p->number(); _index = start; - - p->trigger( pstart, pend ); + p->play( start, end ); - break; } offset = pend;