[Loris-cvs] Loris/src Partial.C, 1.72, 1.73 Resampler.C, 1.22, 1.23 phasefix.C, 1.16, 1.17
C++ class library for sound analysis, synthesis, and morphing
Brought to you by:
kfitz
|
From: Kelly F. <kf...@us...> - 2010-01-17 07:28:58
|
Update of /cvsroot/loris/Loris/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11137/src Modified Files: Partial.C Resampler.C phasefix.C Log Message: Fixed several phase errors and cleaned up parameter interpolation in the Partial class. Phase interpolation is now consistent with synthesized phases. Index: Partial.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Partial.C,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** Partial.C 10 Jan 2010 07:09:27 -0000 1.72 --- Partial.C 17 Jan 2010 07:28:26 -0000 1.73 *************** *** 663,697 **** Partial::frequencyAt( double time ) const { ! if ( numBreakpoints() == 0 ) ! { ! Throw( InvalidPartial, "Tried to interpolate a Partial with no Breakpoints." ); ! } ! ! // lower_bound returns a reference to the lowest ! // position that would be higher than an element ! // having key equal to time: ! Partial::const_iterator it = findAfter( time ); ! ! if ( it == begin() ) ! { ! // time is before the onset of the Partial: ! return it.breakpoint().frequency(); ! } ! else if ( it == end() ) ! { ! // time is past the end of the Partial: ! return (--it).breakpoint().frequency(); ! } ! else ! { ! // interpolate between it and its predeccessor ! // (we checked already that it is not begin): ! const Breakpoint & hi = it.breakpoint(); ! double hitime = it.time(); ! const Breakpoint & lo = (--it).breakpoint(); ! double lotime = it.time(); ! double alpha = (time - lotime) / (hitime - lotime); ! return (alpha * hi.frequency()) + ((1. - alpha) * lo.frequency()); ! } } --- 663,668 ---- Partial::frequencyAt( double time ) const { ! Breakpoint bp = parametersAt( time ); ! return bp.frequency(); } *************** *** 720,782 **** Partial::amplitudeAt( double time, double fadeTime ) const { ! if ( numBreakpoints() == 0 ) ! Throw( InvalidPartial, "Tried to interpolate a Partial with no Breakpoints." ); ! ! // findAfter returns the position of the earliest ! // Breakpoint later than time, or the end ! // position if no such Breakpoint exists: ! Partial::const_iterator it = findAfter( time ); ! ! if ( it == begin() ) ! { ! double alpha = (time < it.time()) ? 0. : 1.; ! if ( fadeTime > 0 ) ! { ! // fade in ampltude if time is before the onset of the Partial: ! alpha = std::max(0., 1. - ((it.time() - time) / fadeTime) ); ! } ! return alpha * it.breakpoint().amplitude(); ! } ! else if ( it == end() ) ! { ! // ( first decrement iterator to get the tail Breakpoint) ! --it; ! ! double alpha = (time > it.time()) ? 0. : 1.; ! if ( fadeTime > 0 ) ! { ! // fade out ampltude if time is past the end of the Partial: ! alpha = std::max(0., 1. - ((time - it.time()) / fadeTime) ); ! } ! return alpha * it.breakpoint().amplitude(); ! } ! else ! { ! // interpolate between it and its predeccessor ! // (we checked already that it is not begin): ! const Breakpoint & hi = it.breakpoint(); ! double hitime = it.time(); ! const Breakpoint & lo = (--it).breakpoint(); ! double lotime = it.time(); ! double alpha = (time - lotime) / (hitime - lotime); ! return (alpha * hi.amplitude()) + ((1. - alpha) * lo.amplitude()); ! } } // --------------------------------------------------------------------------- - // wrapPi - // --------------------------------------------------------------------------- - // O'Donnell's phase wrapping function. - // - static inline double wrapPi( double x ) - { - using namespace std; // floor should be in std - #define ROUND(x) (floor(.5 + (x))) - const double TwoPi = 2.0*Pi; - return x + ( TwoPi * ROUND(-x/TwoPi) ); - } - - // --------------------------------------------------------------------------- // phaseAt // --------------------------------------------------------------------------- --- 691,700 ---- Partial::amplitudeAt( double time, double fadeTime ) const { ! Breakpoint bp = parametersAt( time, fadeTime ); ! return bp.amplitude(); } // --------------------------------------------------------------------------- // phaseAt // --------------------------------------------------------------------------- *************** *** 785,789 **** //! return the extrapolated from the nearest envelope endpoint //! (assuming constant frequency, as reported by frequencyAt()). ! //! Throw an InvalidPartial exception if this Partial has no //! Breakpoints. // --- 703,710 ---- //! return the extrapolated from the nearest envelope endpoint //! (assuming constant frequency, as reported by frequencyAt()). ! //! ! //! \param time is the time in seconds at which to evaluate the phase ! //! ! //! \throw Throw an InvalidPartial exception if this Partial has no //! Breakpoints. // *************** *** 791,841 **** Partial::phaseAt( double time ) const { ! if ( numBreakpoints() == 0 ) ! { ! Throw( InvalidPartial, "Tried to interpolate a Partial with no Breakpoints." ); ! } ! ! // findAfter returns the position of the earliest ! // Breakpoint later than time, or the end ! // position if no such Breakpoint exists: ! Partial::const_iterator it = findAfter( time ); ! ! // compute phase: ! if ( it == begin() ) ! { ! // time is before the onset of the Partial: ! double dp = 2. * Pi * (it.time() - time) * it.breakpoint().frequency(); ! return wrapPi( it.breakpoint().phase() - dp ); ! } ! else if (it == end() ) ! { ! // time is past the end of the Partial: ! // ( first decrement iterator to get the tail Breakpoint) ! --it; ! ! double dp = 2. * Pi * (time - it.time()) * it.breakpoint().frequency(); ! return wrapPi( it.breakpoint().phase() + dp ); ! } ! else ! { ! // interpolate between it and its predeccessor ! // (we checked already that it is not begin): ! const Breakpoint & hi = it.breakpoint(); ! double hitime = it.time(); ! const Breakpoint & lo = (--it).breakpoint(); ! double lotime = it.time(); ! double alpha = (time - lotime) / (hitime - lotime); ! double finterp = ( alpha * hi.frequency() ) + ! ( ( 1. - alpha ) * lo.frequency() ); ! ! // frequency is interpolated to the specified time, ! // interpolated phase is computed from the frequency ! // and offset from the phase of the preceding Breakpoint: ! double favg = 0.5 * ( lo.frequency() + finterp ); ! double dp = 2. * Pi * (time - lotime) * favg; ! ! // wrap phase, because other code depends on it: ! return wrapPi( lo.phase() + dp ); ! } } --- 712,717 ---- Partial::phaseAt( double time ) const { ! Breakpoint bp = parametersAt( time ); ! return bp.phase(); } *************** *** 852,886 **** Partial::bandwidthAt( double time ) const { ! if ( numBreakpoints() == 0 ) ! { ! Throw( InvalidPartial, "Tried to interpolate a Partial with no Breakpoints." ); ! } ! ! // findAfter returns the position of the earliest ! // Breakpoint later than time, or the end ! // position if no such Breakpoint exists: ! Partial::const_iterator it = findAfter( time ); ! ! if ( it == begin() ) ! { ! // time is before the onset of the Partial: ! return it.breakpoint().bandwidth(); ! } ! else if (it == end() ) ! { ! // time is past the end of the Partial: ! return (--it).breakpoint().bandwidth(); ! } ! else ! { ! // interpolate between it and its predeccessor ! // (we checked already that it is not begin): ! const Breakpoint & hi = it.breakpoint(); ! double hitime = it.time(); ! const Breakpoint & lo = (--it).breakpoint(); ! double lotime = it.time(); ! double alpha = (time - lotime) / (hitime - lotime); ! return (alpha * hi.bandwidth()) + ((1. - alpha) * lo.bandwidth()); ! } } --- 728,746 ---- Partial::bandwidthAt( double time ) const { ! Breakpoint bp = parametersAt( time ); ! return bp.bandwidth(); ! } ! ! // --------------------------------------------------------------------------- ! // wrapPi ! // --------------------------------------------------------------------------- ! // O'Donnell's phase wrapping function. ! // ! static inline double wrapPi( double x ) ! { ! using namespace std; // floor should be in std ! #define ROUND(x) (floor(.5 + (x))) ! const double TwoPi = 2.0*Pi; ! return x + ( TwoPi * ROUND(-x/TwoPi) ); } *************** *** 889,899 **** // --------------------------------------------------------------------------- //! Return the interpolated parameters of this Partial at ! //! the specified time, same as building a Breakpoint from ! //! the results of frequencyAt, ampitudeAt, bandwidthAt, and ! //! phaseAt, but performs only one Breakpoint envelope search. ! //! Throw an InvalidPartial exception if this Partial has no ! //! Breakpoints. If non-zero fadeTime is specified, then the //! amplitude at the ends of the Partial is coomputed using a //! linear fade. The default fadeTime is ShortestSafeFadeTime. // Breakpoint --- 749,757 ---- // --------------------------------------------------------------------------- //! Return the interpolated parameters of this Partial at ! //! the specified time. If non-zero fadeTime is specified, then the //! amplitude at the ends of the Partial is coomputed using a //! linear fade. The default fadeTime is ShortestSafeFadeTime. + //! Throw an InvalidPartial exception if this Partial has no + //! Breakpoints. // Breakpoint *************** *** 905,914 **** } ! // findAfter returns the position of the earliest ! // Breakpoint later than time, or the end ! // position if no such Breakpoint exists: ! Partial::const_iterator it = findAfter( time ); ! ! if ( it == begin() ) { // time is before the onset of the Partial: --- 763,768 ---- } ! double freq, amp, bw, ph; ! if ( startTime() >= time ) { // time is before the onset of the Partial: *************** *** 916,934 **** // amplitude is 0 (or fading), bandwidth is starting // bandwidth, and phase is rolled back. ! double alpha = (time < it.time()) ? 0. : 1.; ! if ( fadeTime > 0 ) { // fade in ampltude if time is before the onset of the Partial: ! alpha = std::max(0., 1. - ((it.time() - time) / fadeTime) ); } - double amp = alpha * it.breakpoint().amplitude(); - - double dp = 2. * Pi * (it.time() - time) * it.breakpoint().frequency(); - double ph = wrapPi( it.breakpoint().phase() - dp ); ! return Breakpoint( it.breakpoint().frequency(), amp, ! it.breakpoint().bandwidth(), ph ); } ! else if (it == end() ) { // time is past the end of the Partial: --- 770,798 ---- // amplitude is 0 (or fading), bandwidth is starting // bandwidth, and phase is rolled back. ! ! const Breakpoint & bp = first(); ! double tstart = startTime(); ! ! // frequency: ! freq = bp.frequency(); ! ! // amplitude: ! amp = 0; ! if ( (fadeTime > 0) && ((tstart - time) < fadeTime) ) { // fade in ampltude if time is before the onset of the Partial: ! double alpha = 1. - ((tstart - time) / fadeTime); ! amp = alpha * bp.amplitude(); } ! // bandwidth: ! bw = bp.bandwidth(); ! ! // phase: ! double dp = 2. * Pi * (startTime() - time) * bp.frequency(); ! ph = wrapPi( bp.phase() - dp ); ! } ! else if ( endTime() <= time ) { // time is past the end of the Partial: *************** *** 936,991 **** // amplitude is 0 (or fading), bandwidth is ending // bandwidth, and phase is rolled forward. ! --it; ! double alpha = (time > it.time()) ? 0. : 1.; ! if ( fadeTime > 0 ) { // fade out ampltude if time is past the end of the Partial: ! alpha = std::max(0., 1. - ((time - it.time()) / fadeTime) ); } - double amp = alpha * it.breakpoint().amplitude(); - - double dp = 2. * Pi * (time - it.time()) * it.breakpoint().frequency(); - double ph = wrapPi( it.breakpoint().phase() + dp ); ! return Breakpoint( it.breakpoint().frequency(), amp, ! it.breakpoint().bandwidth(), ph ); } else { ! // interpolate between it and its predeccessor ! // (we checked already that it is not begin): ! const Breakpoint & hi = it.breakpoint(); double hitime = it.time(); ! const Breakpoint & lo = (--it).breakpoint(); ! double lotime = it.time(); ! double alpha = (time - lotime) / (hitime - lotime); ! ! double finterp = ( alpha * hi.frequency() ) + ! ( ( 1. - alpha ) * lo.frequency() ); ! ! // need to keep fmod in here because other stuff ! // (Spc export and sdif export, for example) rely ! // on it: ! double ph = 0; ! if ( alpha < 0.5 ) ! { ! double favg = 0.5 * ( lo.frequency() + finterp ); ! double dp = 2. * Pi * (time - lotime) * favg; ! ph = wrapPi( lo.phase() + dp ); ! } ! else ! { ! double favg = 0.5 * ( hi.frequency() + finterp ); ! double dp = 2. * Pi * (hitime - time) * favg; ! ph = wrapPi( hi.phase() - dp ); ! } ! return Breakpoint( (alpha * hi.frequency()) + ((1. - alpha) * lo.frequency()), ! (alpha * hi.amplitude()) + ((1. - alpha) * lo.amplitude()), ! (alpha * hi.bandwidth()) + ((1. - alpha) * lo.bandwidth()), ! ph ); ! } } --- 800,859 ---- // amplitude is 0 (or fading), bandwidth is ending // bandwidth, and phase is rolled forward. ! const Breakpoint & bp = last(); ! double tend = endTime(); ! ! // frequency: ! freq = bp.frequency(); ! // amplitude: ! amp = 0; ! if ( (fadeTime > 0) && ((time - tend) < fadeTime) ) { // fade out ampltude if time is past the end of the Partial: ! double alpha = 1. - ((time - tend) / fadeTime); ! amp = alpha * bp.amplitude(); } ! // bandwidth: ! bw = bp.bandwidth(); ! ! // phase: ! double dp = 2. * Pi * (time - endTime()) * bp.frequency(); ! ph = wrapPi( bp.phase() + dp ); } else { ! // findAfter returns the position of the earliest ! // Breakpoint later than time, or the end ! // position if no such Breakpoint exists: ! Partial::const_iterator it = findAfter( time ); ! ! // interpolate between it and its predeccessor ! // (we checked already that it is not begin or end): ! const Breakpoint & hi = it.breakpoint(); double hitime = it.time(); ! const Breakpoint & lo = (--it).breakpoint(); ! double lotime = it.time(); ! ! double alpha = (time - lotime) / (hitime - lotime); ! ! // frequency: ! freq = (alpha * hi.frequency()) + ((1. - alpha) * lo.frequency()); ! ! // amplitude: ! amp = (alpha * hi.amplitude()) + ((1. - alpha) * lo.amplitude()); ! // bandwidth: ! bw = (alpha * hi.bandwidth()) + ((1. - alpha) * lo.bandwidth()); ! ! // phase: ! // interpolated phase is computed from the interpolated frequency ! // and offset from the phase of the preceding Breakpoint: ! double favg = 0.5 * ( lo.frequency() + freq ); // + hi.frequency() ); ! double dp = 2. * Pi * (time - lotime) * favg; ! ph = wrapPi( lo.phase() + dp ); } + + return Breakpoint( freq, amp, bw, ph ); } Index: phasefix.C =================================================================== RCS file: /cvsroot/loris/Loris/src/phasefix.C,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** phasefix.C 10 Jan 2010 06:26:23 -0000 1.16 --- phasefix.C 17 Jan 2010 07:28:26 -0000 1.17 *************** *** 57,71 **** #endif - // Define for special Loris treatment of Null Breakpoints, - // to treat all Breakpoints the same, do NOT define this. - // (See fixPhaseForward and fixPhaseBackward.) - #if !defined(NULLS_ARE_SPECIAL) - #define NULLS_ARE_SPECIAL 1 - #endif - #if defined(NULLS_ARE_SPECIAL) && NULLS_ARE_SPECIAL - static const bool NoNulls = false; - #else - static const bool NoNulls = true; - #endif // begin namespace --- 57,60 ---- *************** *** 115,127 **** return phaseTravel( bp0.breakpoint(), bp1.breakpoint(), bp1.time() - bp0.time() ); - /* - double f0 = bp0->frequency(); - double t0 = bp0.time(); - double f1 = bp1->frequency(); - double t1 = bp1.time(); - double favg = .5 * ( f0 + f1 ); - double dt = t1 - t0; - return 2 * Pi * favg * dt; - */ } --- 104,107 ---- *************** *** 157,161 **** { while ( pos != stopHere && ! ( NoNulls || BreakpointUtils::isNonNull( pos.breakpoint() ) ) ) { // pos is not the first Breakpoint in the Partial, --- 137,141 ---- { while ( pos != stopHere && ! BreakpointUtils::isNonNull( pos.breakpoint() ) ) { // pos is not the first Breakpoint in the Partial, *************** *** 187,191 **** } ! // --------------------------------------------------------------------------- // fixPhaseForward // --- 167,171 ---- } ! // ----------------------------------------------------------------------- ---- // fixPhaseForward // *************** *** 216,225 **** { Partial::iterator posPrev = pos++; ! if ( NoNulls || BreakpointUtils::isNonNull( pos.breakpoint() ) ) { ! // pos is the position of a non-Null Breakpoint double travel = phaseTravel( posPrev, pos ); ! if ( NoNulls || BreakpointUtils::isNonNull( posPrev.breakpoint() ) ) { // if its predecessor of pos is non-Null, then fix --- 196,209 ---- { Partial::iterator posPrev = pos++; ! ! // update phase based on the phase travel between ! // posPrev and pos UNLESS pos is Null: ! if ( BreakpointUtils::isNonNull( pos.breakpoint() ) ) { ! // pos is the position of a non-Null Breakpoint, ! // posPrev is its predecessor: double travel = phaseTravel( posPrev, pos ); ! if ( BreakpointUtils::isNonNull( posPrev.breakpoint() ) ) { // if its predecessor of pos is non-Null, then fix *************** *** 385,391 **** if ( ! BreakpointUtils::isNonNull( bp1 ) ) { ! // if bp1 is null, just compute a new phase, ! // no need to match it. ! bp1.setPhase( wrapPi( bp0.phase() + travel ) ); } else if ( ! BreakpointUtils::isNonNull( bp0 ) ) --- 369,376 ---- if ( ! BreakpointUtils::isNonNull( bp1 ) ) { ! // if bp1 is null, DON'T compute a new phase, ! // because Nulls are phase reset points. ! ! // bp1.setPhase( wrapPi( bp0.phase() + travel ) ); } else if ( ! BreakpointUtils::isNonNull( bp0 ) ) *************** *** 425,447 **** // If the target is not a null breakpoint, may need to // clamp the amount of frequency modification. ! // ! // Actually, should probably always clamp the amount ! // of modulation, should never have arbitrarily large ! // frequency adjustments. ! // ! // Really, should never call this function if bp1 ! // is a null Breakpoint, because we don't care about ! // those phases in Loris. ! if ( true ) // bp1.amplitude() != 0. ) ! { ! if ( ftgt > bp1.frequency() * ( 1 + (maxFixPct*.01) ) ) ! { ! ftgt = bp1.frequency() * ( 1 + (maxFixPct*.01) ); ! } ! else if ( ftgt < bp1.frequency() * ( 1 - (maxFixPct*.01) ) ) ! { ! ftgt = bp1.frequency() * ( 1 - (maxFixPct*.01) ); ! } } bp1.setFrequency( ftgt ); --- 410,422 ---- // If the target is not a null breakpoint, may need to // clamp the amount of frequency modification. ! if ( ftgt > bp1.frequency() * ( 1 + (maxFixPct*.01) ) ) ! { ! ftgt = bp1.frequency() * ( 1 + (maxFixPct*.01) ); ! } ! else if ( ftgt < bp1.frequency() * ( 1 - (maxFixPct*.01) ) ) ! { ! ftgt = bp1.frequency() * ( 1 - (maxFixPct*.01) ); } + bp1.setFrequency( ftgt ); *************** *** 483,488 **** while ( next != partial.end() ) { ! matchPhaseFwd( prev.breakpoint(), next.breakpoint(), ! next.time() - prev.time(), 0.5, maxFixPct ); prev = next++; } --- 458,466 ---- while ( next != partial.end() ) { ! if ( BreakpointUtils::isNonNull( next.breakpoint() ) ) ! { ! matchPhaseFwd( prev.breakpoint(), next.breakpoint(), ! next.time() - prev.time(), 0.5, maxFixPct ); ! } prev = next++; } Index: Resampler.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Resampler.C,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Resampler.C 11 Jan 2010 03:50:25 -0000 1.22 --- Resampler.C 17 Jan 2010 07:28:26 -0000 1.23 *************** *** 57,62 **** static void resample_dense( Partial & p, const LinearEnvelope & env, double interval ); static void resample_sparse( Partial & p, const LinearEnvelope & env ); ! static void insert_resampled_at( Partial & newp, const Partial & p, ! double sampleTime, double insertTime ); /* --- 57,62 ---- static void resample_dense( Partial & p, const LinearEnvelope & env, double interval ); static void resample_sparse( Partial & p, const LinearEnvelope & env ); ! static Partial::iterator insert_resampled_at( Partial & newp, const Partial & p, ! double sampleTime, double insertTime ); /* *************** *** 379,383 **** // for phase-correct quantization, first make the phases correct by ! // fixing them from the initial phase, then quantize the Breakpoint // times, then afterwards, adjust the frequencies to match // the interpolated phases: --- 379,385 ---- // for phase-correct quantization, first make the phases correct by ! // fixing them from the initial phase (ideally this should have ! // no effect but there's no way to be phase-correct after quantization ! // unless the phases start correct), then quantize the Breakpoint // times, then afterwards, adjust the frequencies to match // the interpolated phases: *************** *** 391,420 **** newp.setLabel( p.label() ); ! // resample: ! double curtime = 0; ! double halfstep = .5 * interval_; ! Partial::const_iterator iter = p.begin(); ! while( iter != p.end() ) { double bpt = iter.time(); ! if ( bpt < curtime - halfstep ) ! { ! // advance Breakpoint iterator, no new Breakpoint: ! ++iter; ! } ! else if (curtime < bpt - halfstep) { ! // advance current time, no new Breakpoint: ! curtime += interval_; } ! else ! { ! // insert another Breakpoints and advance the Breakpoint // iterator and the current time: ! insert_resampled_at( newp, p, curtime, curtime ); ! ++iter; ! curtime += interval_; } } --- 393,447 ---- newp.setLabel( p.label() ); ! Partial::const_iterator iter = p.begin(); while( iter != p.end() ) { + const Breakpoint & bp = iter.breakpoint(); double bpt = iter.time(); ! ! // find the nearest multiple of the quantization interval: ! long qstep = 0.5 + ( bpt / interval_ ); ! ! long endstep = qstep-1; // guarantee first insertion ! if ( newp.numBreakpoints() != 0 ) { ! endstep = 0.5 + ( newp.endTime() / interval_ ); } ! ! // insert a new Breakpoint if it does not duplicate ! // a previous insertion, or if it is a Null (needed ! // for phase-correction): ! if ( (endstep != qstep) || (0 == bp.amplitude()) ) ! { ! double qt = interval_ * qstep; ! ! // insert another Breakpoint and advance the Breakpoint // iterator and the current time: ! // ! // sample the Partial with a long fade time so that ! // the amplitudes at the ends keep their original values: ! const double a_long_time = 1.; ! Breakpoint newbp = p.parametersAt( qt, a_long_time ); ! Partial::iterator new_pos = newp.insert( qt, newbp ); ! ! // tricky: if the quantized position (iter) is a null Breakpoint, ! // we had better made the new position a null also, very important ! // for making phase resets happen at synthesis time. ! // ! // Also, if new_pos is earlier than iter, the phase should be rolled ! // back from iter, rather than interpolated. If new_pos is later ! // than iter, then its phase will have been correctly interpolated. ! if ( 0 == bp.amplitude() ) ! { ! new_pos.breakpoint().setAmplitude( 0 ); ! ! if ( new_pos.time() < bpt ) ! { ! double dp = phaseTravel( new_pos.breakpoint(), bp, ! bpt - new_pos.time() ); ! new_pos.breakpoint().setPhase( bp.phase() - dp ); ! } ! } } + ++iter; } *************** *** 423,427 **** if ( phaseCorrect_ ) { ! fixFrequency( newp, 1 ); } --- 450,454 ---- if ( phaseCorrect_ ) { ! fixFrequency( newp, 5 ); } *************** *** 437,443 **** // insert_resampled_at (helper) // --------------------------------------------------------------------------- - // Sparse resampling helper for inserting a resampled Breakpoint. // ! static void insert_resampled_at( Partial & newp, const Partial & p, double sampleTime, double insertTime ) --- 464,469 ---- // insert_resampled_at (helper) // --------------------------------------------------------------------------- // ! static Partial::iterator insert_resampled_at( Partial & newp, const Partial & p, double sampleTime, double insertTime ) *************** *** 457,464 **** ! newp.insert( insertTime, newbp ); debugger << "inserted Breakpoint having amplitude " << newbp.amplitude() << " at time " << insertTime << endl; } --- 483,492 ---- ! Partial::iterator ret_pos = newp.insert( insertTime, newbp ); debugger << "inserted Breakpoint having amplitude " << newbp.amplitude() << " at time " << insertTime << endl; + + return ret_pos; } |