loris-cvs Mailing List for Loris
C++ class library for sound analysis, synthesis, and morphing
Brought to you by:
kfitz
This list is closed, nobody may subscribe to it.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(10) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(12) |
Feb
(4) |
Mar
(21) |
Apr
|
May
(1) |
Jun
(13) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2009 |
Jan
(24) |
Feb
(3) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(26) |
Oct
(22) |
Nov
(5) |
Dec
(1) |
| 2010 |
Jan
(24) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Kelly F. <kf...@us...> - 2010-01-23 03:39:08
|
Update of /cvsroot/loris/Loris/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21833/src Modified Files: Dilator.C Partial.C Log Message: minor code tidying Index: Dilator.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Dilator.C,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Dilator.C 2 Jan 2010 04:55:12 -0000 1.42 --- Dilator.C 23 Jan 2010 03:38:55 -0000 1.43 *************** *** 176,183 **** Assert( _initial.size() == _target.size() ); ! // don't dilate if there's no time points: ! if ( _initial.size() == 0 ) return; ! // create the new Partial: Partial newp; --- 176,186 ---- Assert( _initial.size() == _target.size() ); ! // don't dilate if there's no time points, or no Breakpoints: ! if ( 0 == _initial.size() || ! 0 == p.numBreakpoints() ) ! { return; ! } ! // create the new Partial: Partial newp; Index: Partial.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Partial.C,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** Partial.C 17 Jan 2010 07:28:26 -0000 1.73 --- Partial.C 23 Jan 2010 03:38:55 -0000 1.74 *************** *** 467,471 **** if ( numBreakpoints() == 0 ) { ! Throw( InvalidPartial, "Tried find start time of a Partial with no Breakpoints." ); } return begin().time(); --- 467,471 ---- if ( numBreakpoints() == 0 ) { ! Throw( InvalidPartial, "Tried to find start time of a Partial with no Breakpoints." ); } return begin().time(); *************** *** 483,487 **** if ( numBreakpoints() == 0 ) { ! Throw( InvalidPartial, "Tried find end time of a Partial with no Breakpoints." ); } return (--end()).time(); --- 483,487 ---- if ( numBreakpoints() == 0 ) { ! Throw( InvalidPartial, "Tried to find end time of a Partial with no Breakpoints." ); } return (--end()).time(); |
|
From: Kelly F. <kf...@us...> - 2010-01-17 16:51:41
|
Update of /cvsroot/loris/farm/morphing In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12057 Modified Files: morph_bass_bassoon.py morph_raga_tbn.py Log Message: updated raga-tbn morphing script to behave like other scripts in the Loris farm, with tags, etc. Index: morph_bass_bassoon.py =================================================================== RCS file: /cvsroot/loris/farm/morphing/morph_bass_bassoon.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** morph_bass_bassoon.py 11 Sep 2007 05:36:02 -0000 1.2 --- morph_bass_bassoon.py 17 Jan 2010 16:51:33 -0000 1.3 *************** *** 14,22 **** has been "improved". ! Last updated: 10 Sep 2007 by Kelly Fitz """ print __doc__ ! import loris, time print """ --- 14,22 ---- has been "improved". ! Last updated: 28 Sep 2009 by Kelly Fitz """ print __doc__ ! import loris, time, os print """ *************** *** 24,88 **** """%loris.version() ! # time points ! tbassbeg = .47 ! tbasspeak = .52 ! tbassend = 4.835 ! ! tsoonbeg = 0.053 ! tsoonend = 2.478 ! ! morphTimes_old = [ tbasspeak, tbasspeak+.8, tbasspeak+1.6 ] ! morphTimes_new = [ tbasspeak+.1, tbasspeak+.8, tbasspeak+1.6 ] ! morphTimes_third = [ tbasspeak+.1, tbasspeak+.85, tbasspeak+1.6 ] ! morphTimes = morphTimes_new ! ! morphMidpoint = 0.5 ! finalMorphVal = 1 ! ! from os import path ! bass_dir = path.join( path.pardir, "bass" ) ! print "--- importing bass from %s ---"%(bass_dir) ! bass = loris.importSdif( path.join( bass_dir, "bass.D2.sdif" ) ) ! ! print "--- cropping and pitch-shifting bass ---" ! loris.crop( bass, tbassbeg, tsoonend ) ! loris.shiftPitch( bass, -(50+11) ) ! # bassoon is 11 cents sharp, and bass is way off ! ! bassoon_dir = path.join( path.pardir, "bassoon" ) ! print "--- importing bassoon from %s ---"%(bassoon_dir) ! bassoon = loris.importSdif( path.join( bassoon_dir, "bassoon.Db2.sdif" ) ) ! print "--- chopping junk off front of bassoon ---" ! loris.crop( bassoon, tsoonbeg, 2*tsoonend ) ! print "--- dilating (shifting start time of) bassoon ---" ! loris.dilate( bassoon, [0], [ tbassbeg - tsoonbeg ] ) ! print "--- morphing ---" ! env = loris.BreakpointEnvelope() ! env.insertBreakpoint( morphTimes[0], 0 ) ! env.insertBreakpoint( morphTimes[1], morphMidpoint*finalMorphVal ) ! env.insertBreakpoint( morphTimes[2], finalMorphVal ) ! # morph using reference partials, sounds much worse without this! ! m = loris.morph( bass, bassoon, 1, 1, env, env, env ) ! print "--- removing noise from morph ---" ! loris.scaleNoiseRatio( m, 0 ) ! print "--- rendering ---" ! fout = loris.AiffFile( m, 44100 ) ! fout.setMidiNoteNumber( 37.11 ) ! fout.write( "bass-oon.morph.aiff" ) ! # export the dilated data as spc files for Kyma morphing. ! print "--- exporting Spc files for Kyma morphing ---" ! ofilebase = "bass.aligned" ! loris.exportSdif( ofilebase + ".sdif", bass ) ! ofilebase = "bassoon.aligned" ! loris.exportSdif( ofilebase + ".sdif", bassoon ) --- 24,121 ---- """%loris.version() + orate = 44100 ! tag = '' ! stuff = {} ! # ---------------------------------------------------------------------------- ! def doBassoonBassMorph( exportDir = '' ): ! # time points ! tbassbeg = .47 ! tbasspeak = .52 ! tbassend = 4.835 ! ! tsoonbeg = 0.053 ! tsoonend = 2.478 ! ! morphTimes_old = [ tbasspeak, tbasspeak+.8, tbasspeak+1.6 ] ! morphTimes_new = [ tbasspeak+.1, tbasspeak+.8, tbasspeak+1.6 ] ! morphTimes_third = [ tbasspeak+.1, tbasspeak+.85, tbasspeak+1.6 ] ! morphTimes = morphTimes_new ! ! morphMidpoint = 0.5 ! finalMorphVal = 1 ! ! from os import path ! bass_dir = path.join( path.pardir, "bass" ) ! print "--- importing bass from %s ---"%(bass_dir) ! bass = loris.importSdif( path.join( bass_dir, "bass.D2.sdif" ) ) ! ! print "--- cropping and pitch-shifting bass ---" ! loris.crop( bass, tbassbeg, tsoonend ) ! loris.shiftPitch( bass, -(50+11) ) ! # bassoon is 11 cents sharp, and bass is way off ! ! bassoon_dir = path.join( path.pardir, "bassoon" ) ! print "--- importing bassoon from %s ---"%(bassoon_dir) ! bassoon = loris.importSdif( path.join( bassoon_dir, "bassoon.Db2.sdif" ) ) ! ! print "--- chopping junk off front of bassoon ---" ! loris.crop( bassoon, tsoonbeg, 2*tsoonend ) ! ! print "--- dilating (shifting start time of) bassoon ---" ! loris.dilate( bassoon, [0], [ tbassbeg - tsoonbeg ] ) ! ! print "--- morphing ---" ! env = loris.BreakpointEnvelope() ! env.insertBreakpoint( morphTimes[0], 0 ) ! env.insertBreakpoint( morphTimes[1], morphMidpoint*finalMorphVal ) ! env.insertBreakpoint( morphTimes[2], finalMorphVal ) ! ! # morph using reference partials, sounds much worse without this! ! m = loris.morph( bass, bassoon, 1, 1, env, env, env ) ! ! print "--- removing noise from morph ---" ! loris.scaleNoiseRatio( m, 0 ) ! if exportDir: ! ! print "--- rendering ---" ! opath = os.path.join( exportDir, 'bass-oon.morph' + tag + '.aiff' ) ! ! fout = loris.AiffFile( m, orate ) ! fout.setMidiNoteNumber( 37.11 ) ! fout.write( opath ) ! ! # export the dilated data as SDIF files. ! print "--- exporting Sdif files ---" ! ! opath = os.path.join( exportDir, 'bass.aligned' + tag + '.sdif' ) ! loris.exportSdif( opath, bass ) ! ! opath = os.path.join( exportDir, 'bassoon.aligned' + tag + '.sdif' ) ! loris.exportSdif( opath, bassoon ) ! stuff[ 'bassoon aligned' ] = bassoon ! stuff[ 'bass aligned' ] = bass ! stuff[ 'morph' ] = m ! stuff[ 'times' ] = morphTimes ! ! print 'Done. (%s)'%(time.ctime(time.time())) ! # ---------------------------------------------------------------------------- ! if __name__ == '__main__': ! print __doc__ ! print 'Using Loris version %s'%( loris.version() ) + import sys + odir = os.curdir + if len( sys.argv ) > 1: + tag = '.' + sys.argv[1] + + doBassoonBassMorph( odir ) \ No newline at end of file Index: morph_raga_tbn.py =================================================================== RCS file: /cvsroot/loris/farm/morphing/morph_raga_tbn.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** morph_raga_tbn.py 11 Sep 2007 05:36:02 -0000 1.2 --- morph_raga_tbn.py 17 Jan 2010 16:51:33 -0000 1.3 *************** *** 7,16 **** Makes a progressive sequence of three morphs. ! Last updated: 10 Sep 2007 by Kelly Fitz """ print __doc__ ! import loris, time print """ --- 7,16 ---- Makes a progressive sequence of three morphs. ! Last updated: 17 Jan 2010 by Kelly Fitz """ print __doc__ ! import loris, time, os print """ *************** *** 18,49 **** """%loris.version() ! from os import path ! dir = path.join( path.pardir, "trombone" ) ! print "--- importing trombone from %s ---"%(dir) ! tbn = loris.importSdif( path.join( dir, "tbnflutter.sdif" ) ) ! dir = path.join( path.pardir, "derbari" ) ! print "--- importing raga singer from %s ---"%(dir) ! raga = loris.importSdif( path.join( dir, "derbari.distill.sdif" ) ) ! print "--- dilating raga singer ---" ! tbntimes = ( 0, 2.39 ) ! ragatimes = ( .124, 1.634 ) ! loris.dilate( raga, ragatimes, tbntimes ) ! print "--- exporting dilated raga singer ---" ! orate = 44100 ! loris.exportAiff( 'raga.dilated.aiff', loris.synthesize( raga, orate ), orate ) ! print "--- preforming sequence of morphs ---" ! outvec = [] ! space = [0] * int(.25*orate) ! for w in (.2, .5, .7 ): ! print "--- morphing with weight %.2f ---"%(w) ! m = loris.morph( tbn, raga, w, w, w ) ! v = loris.synthesize( m, orate ) ! outvec.extend( v ) ! outvec.extend( space ) ! print "--- exporting morph sequence ---" ! loris.exportAiff( "raga-trombone-seq.aiff", outvec, orate ) \ No newline at end of file --- 18,97 ---- """%loris.version() ! orate = 44100 ! tag = '' ! stuff = {} ! # ---------------------------------------------------------------------------- ! def doRagaTbnMorph( exportDir = '' ): ! ! from os import path ! dir = path.join( path.pardir, "trombone" ) ! print "--- importing trombone from %s ---"%(dir) ! tbn = loris.importSdif( path.join( dir, "tbnflutter.sdif" ) ) ! dir = path.join( path.pardir, "derbari" ) ! print "--- importing raga singer from %s ---"%(dir) ! raga = loris.importSdif( path.join( dir, "derbari.distill.sdif" ) ) ! ! print "--- dilating raga singer ---" ! tbntimes = ( 0, 2.39 ) ! ragatimes = ( .124, 1.634 ) ! loris.dilate( raga, ragatimes, tbntimes ) ! ! print "--- preforming sequence of morphs ---" ! morphs = {} ! morph_weights = (.2, .5, .7 ) ! for w in morph_weights: ! print "--- morphing with weight %.2f ---"%(w) ! m = loris.morph( tbn, raga, w, w, w ) ! morphs[w] = m; ! ! if exportDir: ! ! print "--- rendering morph sequence ---" ! opath = os.path.join( exportDir, 'raga-trombone-seq' + tag + '.aiff' ) ! ! outvec = [] ! space = [0] * int(.25*orate) ! for w in morph_weights: ! v = loris.synthesize( morphs[w], orate ) ! outvec.extend( v ) ! outvec.extend( space ) ! ! print "--- exporting morph sequence ---" ! loris.exportAiff( opath, outvec, orate ) ! ! print "--- exporting dilated raga singer ---" ! opath = os.path.join( exportDir, 'raga.dilated' + tag + '.sdif' ) ! loris.exportSdif( opath, raga ) ! ! opath = os.path.join( exportDir, 'raga.dilated' + tag + '.aiff' ) ! loris.exportAiff( opath, raga, orate ) ! ! ! stuff[ 'morphs' ] = morphs ! stuff[ 'morph_weights' ] = morph_weights ! stuff[ 'raga dilated' ] = raga ! stuff[ 'raga times' ] = ragatimes ! stuff[ 'ttbn times' ] = tbntimes ! ! ! print 'Done. (%s)'%(time.ctime(time.time())) ! ! ! # ---------------------------------------------------------------------------- ! ! if __name__ == '__main__': ! print __doc__ ! ! print 'Using Loris version %s'%( loris.version() ) ! ! import sys ! odir = os.curdir ! if len( sys.argv ) > 1: ! tag = '.' + sys.argv[1] ! ! doRagaTbnMorph( odir ) \ No newline at end of file |
|
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; } |
|
From: Kelly F. <kf...@us...> - 2010-01-17 07:28:42
|
Update of /cvsroot/loris/Loris/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11137/test Modified Files: test_Identity.C test_Morpher.C test_Partial.C test_SdifFile.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: test_Morpher.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Morpher.C,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** test_Morpher.C 10 Jan 2010 07:09:27 -0000 1.26 --- test_Morpher.C 17 Jan 2010 07:28:26 -0000 1.27 *************** *** 46,50 **** // define this to see pages and pages of spew ! // #define VERBOSE #ifdef VERBOSE #define TEST(invariant) \ --- 46,50 ---- // define this to see pages and pages of spew ! //#define VERBOSE #ifdef VERBOSE #define TEST(invariant) \ Index: test_Identity.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Identity.C,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_Identity.C 2 Jan 2010 04:55:12 -0000 1.8 --- test_Identity.C 17 Jan 2010 07:28:26 -0000 1.9 *************** *** 1 **** ! /* * This is the Loris C++ Class Library, implementing analysis, * manipulation, and synthesis of digitized sounds using the Reassigned * Bandwidth-Enhanced Additive Sound Model. * * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * test_Identity.C * * Verify that Loris synthesis/analysis is an (nearly) identity * process. Analysis of samples rendered from synthetic Partials * should yield Partials very much like the originals. * The accuracy of the analysis will, of course, depend on the * Analyzer parameters. The ones chosen here should easily pass the * tests given. * * Kelly Fitz, 8 Dec 2004 * lo...@ce... * * http://www.cerlsoundgroup.org/Loris/ * */ #include <algorithm> #include <cmath> #include <iostream> #include <iomanip> #include "Analyzer.h" #include "Breakpoint.h" #include "Channelizer.h" #include "Distiller.h" #include "FrequencyReference.h" #include "Partial.h" #include "PartialList.h" #include "Synthesizer.h" using namespace std; using namespace Loris; const double pi = 3.14159265358979324; // tacky global error variable int ERR = 0; // --- helpers --- // It takes some kludging around to make sure that // phases near 2pi are wrapped down near zero. inline double mpi( double x ) { const double EPS = .01; x += EPS; x = fmod( x, 2*pi ); if ( x < 0 ) x = x + (2*pi); return x - EPS; } inline double env( double tau ) { double t = 2*(tau-.4); return (.1+.3*exp( - pi * t * t ))*min( 500*tau, 1.0 ); } static void float_rel_equal( double x, double y, double pct ) { #ifdef VERBOSE cout << "\t" << x << " == " << y << " ?" << endl; #endif double eps = 0; if ( x != 0. ) { eps = pct * std::fabs(x); } if ( std::fabs(x-y) > eps ) { cout << "\t" << x << " != " << y << " within " << pct*100 << "%" << endl; ERR = 1; } } static void float_abs_equal( double x, double y, double eps ) { #ifdef VERBOSE cout << "\t" << x << " == " << y << " ?" << endl; #endif if ( std::fabs(x-y) > eps ) { cout << "\t" << x << " != " << y << " within " << eps << endl; ERR = 1; } } // ----------- one_partial ----------- // static void one_partial( void ) { cout << "Single-partial analysis/synthesis identity check." << endl; // make a partial with // slowly-varying frequency Partial p1; p1.insert( .1, Breakpoint( 375, .2, 0, 0 ) ); p1.insert( .85, Breakpoint( 425, .2, 0, 0 ) ); p1.insert( .85235, Breakpoint( 426.06, 0, 0, 0 ) ); p1.insert( .899, Breakpoint( 500, 0, 0, pi ) ); p1.insert( .9, Breakpoint( 500, .3, 0, 0 ) ); p1.insert( 1.1, Breakpoint( 520, .3, 0, 0 ) ); PartialList fake; fake.push_back( p1 ); // synthesize the fake partial vector< double > v; Synthesizer synth( 44100, v ); synth.synthesize( fake.begin(), fake.end() ); // analyze the synthesized partial Analyzer anal( 300, 400 ); anal.setAmpFloor( -50 ); anal.setBwRegionWidth( 0 ); cout << "Using analysis window width " << anal.windowWidth() << " Hz" << endl; anal.analyze( v, 44100 ); PartialList & partials = anal.partials(); // need to distill, because the fake partial fades out // and back in again FrequencyReference ref( fake.begin(), fake.end(), 300, 600, 100 ); Channelizer chan( ref, 1 ); chan.channelize( partials.begin(), partials.end() ); Distiller still( 0.001, 0.001 ); // use 1 ms fade time for these tests still.distill( partials ); if ( partials.size() != 1 ) { cout << "ERROR: should find only one Partial" << endl; ERR = 2; return; } Partial a1 = partials.front(); // compare parameters of the original and analyzed partials iostream::fmtflags flags = cout.flags(); fixed( cout ); streamsize prec = cout.precision(); cout << setprecision(3); cout << "START TIMES (p1 a1) (testing within 3ms)" << endl; cout << p1.startTime() << " " << a1.startTime() << endl; float_abs_equal( p1.startTime(), a1.startTime(), 0.003 ); cout << "END TIMES (p1 a1) (testing within 3ms)" << endl; cout << p1.endTime() << " " << a1.endTime() << endl; float_abs_equal( p1.endTime(), a1.endTime(), 0.003 ); cout << "AMPLITUDES (time p1 a1) (testing within 2%)" << endl; const double dt = 0.042; double t = p1.startTime() + dt; while ( t <= p1.endTime() ) { cout << t << "\t" << p1.amplitudeAt(t, 0.01) << " " << a1.amplitudeAt(t,0.01) << endl; float_rel_equal( p1.amplitudeAt(t, 0.01), a1.amplitudeAt(t,0.01), 0.02 ); t = t + dt; } cout << "FREQUENCIES (time p1 a1) (testing within 0.1 Hz)" << endl; t = p1.startTime() + dt; while ( t <= p1.endTime() ) { if ( p1.amplitudeAt(t) > 0 ) { cout << t << "\t" << p1.frequencyAt(t) << " " << a1.frequencyAt(t) << endl; float_abs_equal( p1.frequencyAt(t), a1.frequencyAt(t), 0.1 ); } t = t + dt; } cout << "PHASES / pi (time p1 a1) (testing within 1% of pi)" << endl; t = p1.startTime() + dt; while ( t <= p1.endTime() ) { if ( p1.amplitudeAt(t) > 0 ) { cout << t << "\t" << mpi(p1.phaseAt(t))/pi << " " << mpi(a1.phaseAt(t))/pi << endl; float_abs_equal( mpi(p1.phaseAt(t))/pi, mpi(a1.phaseAt(t))/pi, 0.01*pi ); } t = t + dt; } cout << setprecision(prec); cout.flags( flags ); cout << "Done." << endl; } // ----------- two_partials ----------- // // Note: it takes some planning to ensure that the evaluation // times do not coincide with the beginning and end of either // Partial. Abrupt turn-on and turn-off always corrupt the // frequency and phase estimates at the ends of Partials, so // there is no point in testing the parameters very near the ends. // static void two_partials( void ) { cout << "Two-partial analysis/synthesis identity check." << endl; // make a constant-amplitude partial with // slowly-varying frequency Partial p1; p1.insert( .1, Breakpoint( 375, .2, 0, 0 ) ); p1.insert( .875, Breakpoint( 425, .2, 0, 0 ) ); // make another Partial with fancier envelopes Partial p2; double f = 1000; double phi = 0; double t = 0; p2.insert( t + .225, Breakpoint( f, env( t ), 0, phi ) ); double dt = 0.05; while ( t <= .75 ) { double fprev = f; f = f + (dt * 300); // - (env( t ) * 100) // reassignment does chirps really, really well, // add this extra perturbation to mix things up // a little -- still matches frequencies within // .1 Hz most of the time. double favg = .5 * (f + fprev); phi = phi + (2 * pi * favg * dt); t = t + dt; p2.insert( t + .225, Breakpoint( f, env( t ), 0, phi ) ); } PartialList fake; fake.push_back( p1 ); fake.push_back( p2 ); // synthesize the fake partial vector< double > v; Synthesizer synth( 44100, v ); synth.synthesize( fake.begin(), fake.end() ); // analyze the synthesized partial Analyzer anal( 300, 400 ); anal.setAmpFloor( -50 ); anal.setBwRegionWidth( 0 ); cout << "Using analysis window width " << anal.windowWidth() << " Hz" << endl; anal.analyze( v, 44100 ); PartialList & partials = anal.partials(); /* // no need to distill, these partials should pop right out // of the analysis FrequencyReference ref( fake.begin(), fake.end(), 300, 600, 100 ); Channelizer chan( ref, 1 ); chan.channelize( partials.begin(), partials.end() ); Distiller still; still.distill( partials ); */ if ( partials.size() != 2 ) { cout << "ERROR: should find only two Partials" << endl; ERR = 2; return; } Partial a1 = partials.front(); Partial a2 = partials.back(); // compare parameters of the original and analyzed partials iostream::fmtflags flags = cout.flags(); fixed( cout ); streamsize prec = cout.precision(); cout << setprecision(3); double hop = anal.hopTime() * 2; // turns on too fast for 2.5 ms cout << "START TIMES (p1 a1 p2 a2) (testing within " << hop*1000 << "ms)" << endl; cout << p1.startTime() << " " << a1.startTime() << "\t" << p2.startTime() << " " << a2.startTime() << endl; float_abs_equal( p1.startTime(), a1.startTime(), hop ); float_abs_equal( p2.startTime(), a2.startTime(), hop ); cout << "END TIMES (p1 a1 p2 a2) (testing within " << hop*1000 << "ms)" << endl; cout << p1.endTime() << " " << a1.endTime() << "\t" << p2.endTime() << " " << a2.endTime() << endl; float_abs_equal( p1.endTime(), a1.endTime(), hop ); float_abs_equal( p2.endTime(), a2.endTime(), hop ); const double tmin = min( p1.startTime(), p2.startTime() ); const double tmax = max( p1.endTime(), p2.endTime() ); cout << "AMPLITUDES (time p1 a1 p2 a2) (testing within 2%)" << endl; dt = 0.05; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t" << p1.amplitudeAt(t, 0.01) << " " << a1.amplitudeAt(t,0.01) << "\t" << p2.amplitudeAt(t, 0.01) << " " << a2.amplitudeAt(t,0.01) << endl; float_rel_equal( p1.amplitudeAt(t, 0.01), a1.amplitudeAt(t,0.01), 0.02 ); float_rel_equal( p2.amplitudeAt(t, 0.01), a2.amplitudeAt(t,0.01), 0.02 ); t = t + dt; } cout << "FREQUENCIES (time p1 a1 p2 a2) (testing within 0.1 Hz)" << endl; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t"; if ( p1.amplitudeAt(t) > 0 ) { cout << p1.frequencyAt(t) << " " << a1.frequencyAt(t) << "\t"; float_abs_equal( p1.frequencyAt(t), a1.frequencyAt(t), 0.1 ); } else { cout << "\t\t\t"; } if ( p2.amplitudeAt(t) > 0 ) { cout << p2.frequencyAt(t) << " " << a2.frequencyAt(t); float_abs_equal( p2.frequencyAt(t), a2.frequencyAt(t), 0.1 ); } cout << endl; t = t + dt; } cout << "PHASES / pi (time p1 a1) (testing within 1% of pi)" << endl; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t"; if ( p1.amplitudeAt(t) > 0 ) { cout << mpi(p1.phaseAt(t))/pi << " " << mpi(a1.phaseAt(t))/pi << "\t"; float_abs_equal( mpi(p1.phaseAt(t))/pi, mpi(a1.phaseAt(t))/pi, 0.01*pi ); } else { cout << "\t\t"; } if ( p2.amplitudeAt(t) > 0 ) { cout << mpi(p2.phaseAt(t))/pi << " " << mpi(a2.phaseAt(t))/pi; float_abs_equal( mpi(p2.phaseAt(t))/pi, mpi(a2.phaseAt(t))/pi, 0.01*pi ); } cout << endl; t = t + dt; } cout << setprecision(prec); cout.flags( flags ); cout << "Done." << endl; } // ----------- main ----------- // int main( void ) { std::cout << "Identity test for Loris analysis and synthesis." << endl; std::cout << "Renders synthetic Partials, analyzes the samples," << endl; std::cout << "and compares the analyzed Partials to the originals." << endl << endl; std::cout << "Built: " << __DATE__ << endl << endl; try { one_partial(); two_partials(); } catch( Exception & ex ) { cout << "Caught Loris exception: " << ex.what() << endl; return 1; } catch( std::exception & ex ) { cout << "Caught std C++ exception: " << ex.what() << endl; return 1; } if ( 0 == ERR ) { cout << "Passed identity tests." << endl; } else { cout << "FAILED identity tests." << endl; } return ERR; } \ No newline at end of file --- 1 ---- ! /* * This is the Loris C++ Class Library, implementing analysis, * manipulation, and synthesis of digitized sounds using the Reassigned * Bandwidth-Enhanced Additive Sound Model. * * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * test_Identity.C * * Verify that Loris synthesis/analysis is an (nearly) identity * process. Analysis of samples rendered from synthetic Partials * should yield Partials very much like the originals. * The accuracy of the analysis will, of course, depend on the * Analyzer parameters. The ones chosen here should easily pass the * tests given. * * Kelly Fitz, 8 Dec 2004 * lo...@ce... * * http://www.cerlsoundgroup.org/Loris/ * */ #include <algorithm> #include <cmath> #include <iostream> #include <iomanip> #include "Analyzer.h" #include "Breakpoint.h" #include "Channelizer.h" #include "Distiller.h" #include "FrequencyReference.h" #include "Partial.h" #include "PartialUtils.h" #include "PartialList.h" #include "Synthesizer.h" #include "Exception.h" using namespace std; using namespace Loris; const double pi = 3.14159265358979324; // tacky global error variable int ERR = 0; // #define VERBOSE // #define FAIL_ON_ERROR // --- helpers --- // It takes some kludging around to make sure that // phases near 2pi are wrapped down near zero. inline double mpi( double x ) { const double EPS = .01; x += EPS; x = fmod( x, 2*pi ); if ( x < 0 ) x = x + (2*pi); return x - EPS; } inline double env( double tau ) { double t = 2*(tau-.4); return (.1+.3*exp( - pi * t * t ))*min( 500*tau, 1.0 ); } static void float_rel_equal( double x, double y, double pct ) { #ifdef VERBOSE cout << "\t" << x << " == " << y << " ?" << endl; #endif double eps = 0; if ( x != 0. ) { eps = pct * std::fabs(x); } if ( std::fabs(x-y) > eps ) { cout << "\t" << x << " != " << y << " within " << pct*100 << "%" << endl; ERR = 1; } #ifdef FAIL_ON_ERROR Assert( 0 == ERR ); #endif } static void float_abs_equal( double x, double y, double eps ) { #ifdef VERBOSE cout << "\t" << x << " == " << y << " ?" << endl; #endif if ( std::fabs(x-y) > eps ) { cout << "\t" << x << " != " << y << " within " << eps << endl; ERR = 1; } #ifdef FAIL_ON_ERROR Assert( 0 == ERR ); #endif } // ----------- one_partial ----------- // static void one_partial( void ) { cout << "Single-partial analysis/synthesis identity check." << endl; // make a partial with // slowly-varying frequency Partial p1; p1.insert( .1, Breakpoint( 375, .2, 0, 0 ) ); p1.insert( .85, Breakpoint( 425, .2, 0, 0 ) ); p1.insert( .85235, Breakpoint( 426.06, 0, 0, 0 ) ); p1.insert( .899, Breakpoint( 500, 0, 0, pi ) ); p1.insert( .9, Breakpoint( 500, .3, 0, 0 ) ); p1.insert( 1.1, Breakpoint( 520, .3, 0, 0 ) ); PartialUtils::fixPhaseAfter( p1, 0 ); // synthesize the fake partial vector< double > v; Synthesizer synth( 44100, v ); synth.synthesize( p1 ); // analyze the synthesized partial Analyzer anal( 300, 400 ); anal.setAmpFloor( -50 ); anal.setBwRegionWidth( 0 ); cout << "Using analysis window width " << anal.windowWidth() << " Hz" << endl; anal.analyze( v, 44100 ); PartialList & partials = anal.partials(); // need to distill, because the fake partial fades out // and back in again PartialList fake; fake.push_back( p1 ); FrequencyReference ref( fake.begin(), fake.end(), 300, 600, 100 ); Channelizer chan( ref, 1 ); chan.channelize( partials.begin(), partials.end() ); Distiller still( 0.001, 0.001 ); // use 1 ms fade time for these tests still.distill( partials ); if ( partials.size() != 1 ) { cout << "ERROR: should find only one Partial" << endl; ERR = 2; return; } Partial a1 = partials.front(); // compare parameters of the original and analyzed partials iostream::fmtflags flags = cout.flags(); fixed( cout ); streamsize prec = cout.precision(); cout << setprecision(3); cout << "START TIMES (p1 a1) (testing within 3ms)" << endl; cout << p1.startTime() << " " << a1.startTime() << endl; float_abs_equal( p1.startTime(), a1.startTime(), 0.003 ); cout << "END TIMES (p1 a1) (testing within 3ms)" << endl; cout << p1.endTime() << " " << a1.endTime() << endl; float_abs_equal( p1.endTime(), a1.endTime(), 0.003 ); cout << "AMPLITUDES (time p1 a1) (testing within 2%)" << endl; const double dt = 0.042; double t = p1.startTime() + dt; while ( t <= p1.endTime() ) { cout << t << "\t" << p1.amplitudeAt(t, 0.01) << " " << a1.amplitudeAt(t,0.01) << endl; float_rel_equal( p1.amplitudeAt(t, 0.01), a1.amplitudeAt(t,0.01), 0.02 ); t = t + dt; } cout << "FREQUENCIES (time p1 a1) (testing within 0.1 Hz)" << endl; t = p1.startTime() + dt; while ( t <= p1.endTime() ) { if ( p1.amplitudeAt(t) > 0 ) { cout << t << "\t" << p1.frequencyAt(t) << " " << a1.frequencyAt(t) << endl; float_abs_equal( p1.frequencyAt(t), a1.frequencyAt(t), 0.1 ); } t = t + dt; } cout << "PHASES / pi (time p1 a1) (testing within 1% of pi)" << endl; t = p1.startTime() + dt; while ( t <= p1.endTime() ) { if ( p1.amplitudeAt(t) > 0 ) { cout << t << "\t" << mpi(p1.phaseAt(t))/pi << " " << mpi(a1.phaseAt(t))/pi << endl; float_abs_equal( mpi(p1.phaseAt(t))/pi, mpi(a1.phaseAt(t))/pi, 0.01*pi ); } t = t + dt; } cout << setprecision(prec); cout.flags( flags ); cout << "Done." << endl; } // ----------- two_partials ----------- // // Note: it takes some planning to ensure that the evaluation // times do not coincide with the beginning and end of either // Partial. Abrupt turn-on and turn-off always corrupt the // frequency and phase estimates at the ends of Partials, so // there is no point in testing the parameters very near the ends. // static void two_partials( void ) { cout << "Two-partial analysis/synthesis identity check." << endl; // make a constant-amplitude partial with // slowly-varying frequency Partial p1; p1.insert( .1, Breakpoint( 375, .2, 0, 0 ) ); p1.insert( .875, Breakpoint( 425, .2, 0, 0 ) ); // make another Partial with fancier envelopes Partial p2; double f = 1000; double phi = 0; double t = 0; p2.insert( t + .225, Breakpoint( f, env( t ), 0, phi ) ); double dt = 0.05; while ( t <= .75 ) { double fprev = f; f = f + (dt * 300); // - (env( t ) * 100) // reassignment does chirps really, really well, // add this extra perturbation to mix things up // a little -- still matches frequencies within // .1 Hz most of the time. double favg = .5 * (f + fprev); phi = phi + (2 * pi * favg * dt); t = t + dt; p2.insert( t + .225, Breakpoint( f, env( t ), 0, phi ) ); } PartialList fake; fake.push_back( p1 ); fake.push_back( p2 ); // synthesize the fake partial vector< double > v; Synthesizer synth( 44100, v ); synth.synthesize( fake.begin(), fake.end() ); // analyze the synthesized partial Analyzer anal( 300, 400 ); anal.setAmpFloor( -50 ); anal.setBwRegionWidth( 0 ); cout << "Using analysis window width " << anal.windowWidth() << " Hz" << endl; anal.analyze( v, 44100 ); PartialList & partials = anal.partials(); /* // no need to distill, these partials should pop right out // of the analysis FrequencyReference ref( fake.begin(), fake.end(), 300, 600, 100 ); Channelizer chan( ref, 1 ); chan.channelize( partials.begin(), partials.end() ); Distiller still; still.distill( partials ); */ if ( partials.size() != 2 ) { cout << "ERROR: should find only two Partials" << endl; ERR = 2; return; } Partial a1 = partials.front(); Partial a2 = partials.back(); // compare parameters of the original and analyzed partials iostream::fmtflags flags = cout.flags(); fixed( cout ); streamsize prec = cout.precision(); cout << setprecision(3); double hop = anal.hopTime() * 2; // turns on too fast for 2.5 ms cout << "START TIMES (p1 a1 p2 a2) (testing within " << hop*1000 << "ms)" << endl; cout << p1.startTime() << " " << a1.startTime() << "\t" << p2.startTime() << " " << a2.startTime() << endl; float_abs_equal( p1.startTime(), a1.startTime(), hop ); float_abs_equal( p2.startTime(), a2.startTime(), hop ); cout << "END TIMES (p1 a1 p2 a2) (testing within " << hop*1000 << "ms)" << endl; cout << p1.endTime() << " " << a1.endTime() << "\t" << p2.endTime() << " " << a2.endTime() << endl; float_abs_equal( p1.endTime(), a1.endTime(), hop ); float_abs_equal( p2.endTime(), a2.endTime(), hop ); const double tmin = min( p1.startTime(), p2.startTime() ); const double tmax = max( p1.endTime(), p2.endTime() ); cout << "AMPLITUDES (time p1 a1 p2 a2) (testing within 2%)" << endl; dt = 0.05; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t" << p1.amplitudeAt(t, 0.01) << " " << a1.amplitudeAt(t,0.01) << "\t" << p2.amplitudeAt(t, 0.01) << " " << a2.amplitudeAt(t,0.01) << endl; float_rel_equal( p1.amplitudeAt(t, 0.01), a1.amplitudeAt(t,0.01), 0.02 ); float_rel_equal( p2.amplitudeAt(t, 0.01), a2.amplitudeAt(t,0.01), 0.02 ); t = t + dt; } cout << "FREQUENCIES (time p1 a1 p2 a2) (testing within 0.1 Hz)" << endl; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t"; if ( p1.amplitudeAt(t) > 0 ) { cout << p1.frequencyAt(t) << " " << a1.frequencyAt(t) << "\t"; float_abs_equal( p1.frequencyAt(t), a1.frequencyAt(t), 0.1 ); } else { cout << "\t\t\t"; } if ( p2.amplitudeAt(t) > 0 ) { cout << p2.frequencyAt(t) << " " << a2.frequencyAt(t); float_abs_equal( p2.frequencyAt(t), a2.frequencyAt(t), 0.1 ); } cout << endl; t = t + dt; } cout << "PHASES / pi (time p1 a1) (testing within 1% of pi)" << endl; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t"; if ( p1.amplitudeAt(t) > 0 ) { cout << mpi(p1.phaseAt(t))/pi << " " << mpi(a1.phaseAt(t))/pi << "\t"; float_abs_equal( mpi(p1.phaseAt(t))/pi, mpi(a1.phaseAt(t))/pi, 0.01*pi ); } else { cout << "\t\t"; } if ( p2.amplitudeAt(t) > 0 ) { cout << mpi(p2.phaseAt(t))/pi << " " << mpi(a2.phaseAt(t))/pi; float_abs_equal( mpi(p2.phaseAt(t))/pi, mpi(a2.phaseAt(t))/pi, 0.01*pi ); } cout << endl; t = t + dt; } cout << setprecision(prec); cout.flags( flags ); cout << "Done." << endl; } // ----------- main ----------- // int main( void ) { std::cout << "Identity test for Loris analysis and synthesis." << endl; std::cout << "Renders synthetic Partials, analyzes the samples," << endl; std::cout << "and compares the analyzed Partials to the originals." << endl << endl; std::cout << "Built: " << __DATE__ << endl << endl; try { one_partial(); two_partials(); } catch( Exception & ex ) { cout << "Caught Loris exception: " << ex.what() << endl; return 1; } catch( std::exception & ex ) { cout << "Caught std C++ exception: " << ex.what() << endl; return 1; } if ( 0 == ERR ) { cout << "Passed identity tests." << endl; } else { cout << "FAILED identity tests." << endl; } return ERR; } \ No newline at end of file Index: test_Partial.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Partial.C,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_Partial.C 10 Jan 2010 07:09:27 -0000 1.16 --- test_Partial.C 17 Jan 2010 07:28:26 -0000 1.17 *************** *** 91,94 **** --- 91,106 ---- #define SAME_PARAM_VALUES(x,y) TEST( float_equal((x),(y)) ) + inline double m2pi( double x ) + { + const double EPS = .01; + x += EPS; + x = fmod( x, 2*Pi ); + if ( x < 0 ) + x = x + (2*Pi); + return x - EPS; + } + + #define SAME_PHASE_VALUES(x,y) SAME_PARAM_VALUES(m2pi(x),m2pi(y)) + // ----------- test_parametersAt ----------- // *************** *** 116,124 **** SAME_PARAM_VALUES( p1.amplitudeAt(t), P1_AMPS[0] ); SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[0] ); ! SAME_PARAM_VALUES( p1.phaseAt(t), P1_PHS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), P1_AMPS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[0] ); ! SAME_PARAM_VALUES( p1.parametersAt(t).phase(), P1_PHS[0] ); // check parameters at t = 0.8 --- 128,136 ---- SAME_PARAM_VALUES( p1.amplitudeAt(t), P1_AMPS[0] ); SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[0] ); ! SAME_PHASE_VALUES( p1.phaseAt(t), P1_PHS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), P1_AMPS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[0] ); ! SAME_PHASE_VALUES( p1.parametersAt(t).phase(), P1_PHS[0] ); // check parameters at t = 0.8 *************** *** 127,135 **** SAME_PARAM_VALUES( p1.amplitudeAt(t), P1_AMPS[1] ); SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[1] ); ! SAME_PARAM_VALUES( p1.phaseAt(t), P1_PHS[1] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[1] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), P1_AMPS[1] ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[1] ); ! SAME_PARAM_VALUES( p1.parametersAt(t).phase(), P1_PHS[1] ); // check parameters at t = 1.0 --- 139,147 ---- SAME_PARAM_VALUES( p1.amplitudeAt(t), P1_AMPS[1] ); SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[1] ); ! SAME_PHASE_VALUES( p1.phaseAt(t), P1_PHS[1] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[1] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), P1_AMPS[1] ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[1] ); ! SAME_PHASE_VALUES( p1.parametersAt(t).phase(), P1_PHS[1] ); // check parameters at t = 1.0 *************** *** 138,146 **** SAME_PARAM_VALUES( p1.amplitudeAt(t), P1_AMPS[2] ); SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[2] ); ! SAME_PARAM_VALUES( p1.phaseAt(t), P1_PHS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), P1_AMPS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[2] ); ! SAME_PARAM_VALUES( p1.parametersAt(t).phase(), P1_PHS[2] ); // check parameters at t = 0.1 --- 150,158 ---- SAME_PARAM_VALUES( p1.amplitudeAt(t), P1_AMPS[2] ); SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[2] ); ! SAME_PHASE_VALUES( p1.phaseAt(t), P1_PHS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), P1_AMPS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[2] ); ! SAME_PHASE_VALUES( p1.parametersAt(t).phase(), P1_PHS[2] ); // check parameters at t = 0.1 *************** *** 150,158 **** SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[0] ); // no phase change, exactly ten periods ! SAME_PARAM_VALUES( p1.phaseAt(t), P1_PHS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), 0 ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[0] ); ! SAME_PARAM_VALUES( p1.parametersAt(t).phase(), P1_PHS[0] ); // check parameters at t = 0.9 --- 162,170 ---- SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[0] ); // no phase change, exactly ten periods ! SAME_PHASE_VALUES( p1.phaseAt(t), P1_PHS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[0] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), 0 ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[0] ); ! SAME_PHASE_VALUES( p1.parametersAt(t).phase(), P1_PHS[0] ); // check parameters at t = 0.9 *************** *** 161,172 **** SAME_PARAM_VALUES( p1.amplitudeAt(t), .5 * (P1_AMPS[1] + P1_AMPS[2]) ); SAME_PARAM_VALUES( p1.bandwidthAt(t), .5 * (P1_BWS[1] + P1_BWS[2]) ); - // no phase change, exactly eleven periods (off by Pi? Why?) // .1 s at avg 105 Hz equals 10.5 periods, half a period (Pi) // different from phase at 0.8 ! SAME_PARAM_VALUES( p1.phaseAt(t), P1_PHS[1] - Pi ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), .5 * (P1_FREQS[1] + P1_FREQS[2]) ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), .5 * (P1_AMPS[1] + P1_AMPS[2]) ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), .5 * (P1_BWS[1] + P1_BWS[2]) ); ! SAME_PARAM_VALUES( p1.parametersAt(t).phase(), P1_PHS[1] - Pi ); // check parameters at t = 1.1 --- 173,183 ---- SAME_PARAM_VALUES( p1.amplitudeAt(t), .5 * (P1_AMPS[1] + P1_AMPS[2]) ); SAME_PARAM_VALUES( p1.bandwidthAt(t), .5 * (P1_BWS[1] + P1_BWS[2]) ); // .1 s at avg 105 Hz equals 10.5 periods, half a period (Pi) // different from phase at 0.8 ! SAME_PHASE_VALUES( p1.phaseAt(t), P1_PHS[1] + Pi ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), .5 * (P1_FREQS[1] + P1_FREQS[2]) ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), .5 * (P1_AMPS[1] + P1_AMPS[2]) ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), .5 * (P1_BWS[1] + P1_BWS[2]) ); ! SAME_PHASE_VALUES( p1.parametersAt(t).phase(), P1_PHS[1] + Pi ); // check parameters at t = 1.1 *************** *** 176,184 **** SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[2] ); // no phase change, exactly eleven periods ! SAME_PARAM_VALUES( p1.phaseAt(t), P1_PHS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), 0 ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[2] ); ! SAME_PARAM_VALUES( p1.parametersAt(t).phase(), P1_PHS[2] ); } --- 187,195 ---- SAME_PARAM_VALUES( p1.bandwidthAt(t), P1_BWS[2] ); // no phase change, exactly eleven periods ! SAME_PHASE_VALUES( p1.phaseAt(t), P1_PHS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).frequency(), P1_FREQS[2] ); SAME_PARAM_VALUES( p1.parametersAt(t).amplitude(), 0 ); SAME_PARAM_VALUES( p1.parametersAt(t).bandwidth(), P1_BWS[2] ); ! SAME_PHASE_VALUES( p1.parametersAt(t).phase(), P1_PHS[2] ); } Index: test_SdifFile.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_SdifFile.C,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_SdifFile.C 10 Jan 2010 07:09:27 -0000 1.13 --- test_SdifFile.C 17 Jan 2010 07:28:26 -0000 1.14 *************** *** 158,164 **** --- 158,168 ---- // create a SdifFile and add Markers to it: SdifFile fout( l.begin(), l.end() ); + #ifdef VERBOSE std::cout << "adding Marker \"Marker 1\" at time .2\n"; + #endif fout.markers().push_back( Marker( .2, "Marker 1" ) ); + #ifdef VERBOSE std::cout << "adding Marker \"Marker2\" at time .1\n"; + #endif fout.markers().push_back( Marker( .1, "Marker2" ) ); *************** *** 173,180 **** int k = 0; PartialList::iterator it; ! std::cout << "start times:\n"; for ( it = f.partials().begin(); it != f.partials().end(); ++it ) { std::cout << it->startTime() << "\n"; SAME_PARAM_VALUES( it->startTime(), times[0] + (k*0.1) ); ++k; --- 177,186 ---- int k = 0; PartialList::iterator it; ! std::cout << "checking start times:\n"; for ( it = f.partials().begin(); it != f.partials().end(); ++it ) { + #ifdef VERBOSE std::cout << it->startTime() << "\n"; + #endif SAME_PARAM_VALUES( it->startTime(), times[0] + (k*0.1) ); ++k; *************** *** 187,191 **** --- 193,199 ---- { Marker & m = *it; + #ifdef VERBOSE std::cout << m.name() << " at time " << m.time() << "\n"; + #endif } } |
|
From: Kelly F. <kf...@us...> - 2010-01-17 07:28:42
|
Update of /cvsroot/loris/Loris/scripting In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11137/scripting Modified Files: loris.i Log Message: Fixed several phase errors and cleaned up parameter interpolation in the Partial class. Phase interpolation is now consistent with synthesized phases. Index: loris.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/loris.i,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** loris.i 11 Jan 2010 03:50:25 -0000 1.144 --- loris.i 17 Jan 2010 07:28:26 -0000 1.145 *************** *** 962,966 **** } ! void quantizeBreakpointTimes( PartialList * partials, double interval ) { --- 962,966 ---- } ! */ void quantizeBreakpointTimes( PartialList * partials, double interval ) { *************** *** 969,973 **** r.quantize( partials->begin(), partials->end() ); } ! */ %} --- 969,973 ---- r.quantize( partials->begin(), partials->end() ); } ! %} |
|
From: Kelly F. <kf...@us...> - 2010-01-17 07:28:41
|
Update of /cvsroot/loris/Loris In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11137 Modified Files: NEWS Log Message: Fixed several phase errors and cleaned up parameter interpolation in the Partial class. Phase interpolation is now consistent with synthesized phases. Index: NEWS =================================================================== RCS file: /cvsroot/loris/Loris/NEWS,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** NEWS 11 Jan 2010 03:50:25 -0000 1.93 --- NEWS 17 Jan 2010 07:28:25 -0000 1.94 *************** *** 26,30 **** changes since 1.5.4 release: ! - Corrected several sources of phase errors in synthesis. - Improved the Resampler implementation of Breakpoint time --- 26,31 ---- changes since 1.5.4 release: ! - Corrected several sources of significant phase errors in ! synthesis, and in phase reporting from analysis data. - Improved the Resampler implementation of Breakpoint time |
|
From: Kelly F. <kf...@us...> - 2010-01-11 03:50:38
|
Update of /cvsroot/loris/Loris/scripting In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv460/scripting Modified Files: loris.i Log Message: Removed resampling capabilties with timing envelope. These are not ready for prime time yet, and will be introduced in the next release version of Loris. Index: loris.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/loris.i,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** loris.i 10 Jan 2010 07:04:17 -0000 1.143 --- loris.i 11 Jan 2010 03:50:25 -0000 1.144 *************** *** 858,873 **** "Resample all Partials in a PartialList using the specified sampling interval, so that the Breakpoints in the Partial ! envelopes will all lie on a common temporal grid. The Breakpoint ! times in resampled Partials will comprise a contiguous sequence of ! integer multiples of the sampling interval, beginning with the ! multiple nearest to the Partial's start time and ending with the ! multiple nearest to the Partial's end time. Resampling is ! performed in-place. The Breakpoint times in densely resampled Partials will comprise a contiguous sequence of ALL integer multiples of the sampling interval (very large, but useful for some third-party tools, like the CNMAT ! sinusoids~ external for Max/MSP). Default is sparse (not dense) ! resampling. If phase correct resampling is selected, Partial frequencies are --- 858,872 ---- "Resample all Partials in a PartialList using the specified sampling interval, so that the Breakpoints in the Partial ! envelopes will all lie on a common temporal grid. The Breakpoint times in densely resampled Partials will comprise a contiguous sequence of ALL integer multiples of the sampling interval (very large, but useful for some third-party tools, like the CNMAT ! sinusoids~ external for Max/MSP). ! ! The Breakpoint times in sparsely resampled Partials are simply quantized ! to integer multiples of the of the sampling interval. ! ! Default is sparse (not dense) resampling. If phase correct resampling is selected, Partial frequencies are *************** *** 879,887 **** %rename( resample ) wrap_resample; %feature("docstring", "Quantize the breakpoint times in the specified Partials. In previous versions of Loris, this was called sparse resampling. DOCUMENT ME.") quantizeBreakpointTimes; ! %{ --- 878,887 ---- %rename( resample ) wrap_resample; + /* %feature("docstring", "Quantize the breakpoint times in the specified Partials. In previous versions of Loris, this was called sparse resampling. DOCUMENT ME.") quantizeBreakpointTimes; ! */ %{ *************** *** 891,894 **** --- 891,920 ---- %inline %{ + + void wrap_resample( PartialList * partials, double interval, + bool denseResampling = false, + bool phaseCorrect = true ) + { + + try + { + Resampler r( interval ); + r.setPhaseCorrect( phaseCorrect ); + if ( denseResampling ) + { + r.resample( partials->begin(), partials->end() ); + } + else + { + r.quantize( partials->begin(), partials->end() ); + } + } + catch ( std::exception & ex ) + { + throw_exception( ex.what() ); + } + } + + /* void wrap_resample( PartialList * partials, double interval, bool phaseCorrect = true ) *************** *** 943,946 **** --- 969,973 ---- r.quantize( partials->begin(), partials->end() ); } + */ %} |
|
From: Kelly F. <kf...@us...> - 2010-01-11 03:50:33
|
Update of /cvsroot/loris/Loris In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv460 Modified Files: NEWS Log Message: Removed resampling capabilties with timing envelope. These are not ready for prime time yet, and will be introduced in the next release version of Loris. Index: NEWS =================================================================== RCS file: /cvsroot/loris/Loris/NEWS,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** NEWS 10 Jan 2010 07:09:27 -0000 1.92 --- NEWS 11 Jan 2010 03:50:25 -0000 1.93 *************** *** 4,9 **** Python module, a C-linkable interface, and documentation. ! Loris 1.6 fixes long-standing phase errors in synthesis, improves ! the Resampler, and enhances the Python interface. Loris can be downloaded from http://sourceforge.net/projects/loris --- 4,10 ---- Python module, a C-linkable interface, and documentation. ! Loris 1.6 fixes long-standing phase errors in synthesis and enhances ! the Python interface. A detailed list of major changes is given in ! the change history, below. Loris can be downloaded from http://sourceforge.net/projects/loris *************** *** 20,24 **** ! History of visible changes, organized by relase number: ------------------------------------------------------- --- 21,25 ---- ! History of visible changes, organized by release number: ------------------------------------------------------- *************** *** 27,31 **** - Corrected several sources of phase errors in synthesis. ! - Improved the Resampler interface and functionality. - Added capability to perform logarithmic frequency morphing -- --- 28,35 ---- - Corrected several sources of phase errors in synthesis. ! - Improved the Resampler implementation of Breakpoint time ! quantization (previously called "sparse resampling"), no longer ! adding extra Breakpoints unpredictably to lessen differences ! between the original and resampled envelopes. - Added capability to perform logarithmic frequency morphing -- |
|
From: Kelly F. <kf...@us...> - 2010-01-11 03:50:33
|
Update of /cvsroot/loris/Loris/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv460/src Modified Files: Makefile.am Resampler.C Resampler.h Log Message: Removed resampling capabilties with timing envelope. These are not ready for prime time yet, and will be introduced in the next release version of Loris. Index: Makefile.am =================================================================== RCS file: /cvsroot/loris/Loris/src/Makefile.am,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Makefile.am 2 Jan 2010 04:55:12 -0000 1.58 --- Makefile.am 11 Jan 2010 03:50:25 -0000 1.59 *************** *** 113,120 **** libloris_la_LIBADD = $(LINK_FFTW) $(CSOUND_LIB) ! # the library version for Loris 1.5.5 is 11:0:0 # it is incompatible with the Loris 1.5.4 interface ! # (changed NoiseGenerator interface) ! libloris_la_LDFLAGS = -version-info 10:0:0 $(EXTRA_LD_FLAGS) # loris.h is generated automatically from loris.h.in --- 113,120 ---- libloris_la_LIBADD = $(LINK_FFTW) $(CSOUND_LIB) ! # the library version for Loris 1.6 is 11:0:0 # it is incompatible with the Loris 1.5.4 interface ! # (changed NoiseGenerator and Resampler interface) ! libloris_la_LDFLAGS = -version-info 11:0:0 $(EXTRA_LD_FLAGS) # loris.h is generated automatically from loris.h.in Index: Resampler.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Resampler.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Resampler.h 10 Jan 2010 07:09:27 -0000 1.14 --- Resampler.h 11 Jan 2010 03:50:25 -0000 1.15 *************** *** 82,85 **** --- 82,86 ---- explicit Resampler( double sampleInterval ); + /* //! Initialize a Resampler having the specified timing envelope. //! The timing envelope represents a map of Breakpoint times in *************** *** 125,129 **** Resampler( const LinearEnvelope & timingEnv, double sampleInterval ); ! // --- use compiler-generated copy/assign/destroy --- --- 126,130 ---- Resampler( const LinearEnvelope & timingEnv, double sampleInterval ); ! */ // --- use compiler-generated copy/assign/destroy --- Index: Resampler.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Resampler.C,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Resampler.C 10 Jan 2010 07:09:27 -0000 1.21 --- Resampler.C 11 Jan 2010 03:50:25 -0000 1.22 *************** *** 81,84 **** --- 81,89 ---- Revisit the default values for parameters, and define necessary constructors and members related to the timing envelope. + + + version 1.6 - the timing envelope implementation is not yet ready + for prime time, delay until after this release, which focusses on + the phase-correct synthesis bugs */ *************** *** 114,117 **** --- 119,124 ---- } + #if 0 + // --------------------------------------------------------------------------- // constructor - timing envelope *************** *** 186,189 **** --- 193,197 ---- } + #endif // --------------------------------------------------------------------------- *************** *** 271,281 **** // find time of first and last breakpoint for the resampled envelope: ! double firstTime = interval * int( 0.5 + p.startTime() / interval ); ! double stopTime = p.endTime() + ( 0.5 * interval ); // resample: ! for ( double tins = firstTime; tins < stopTime; tins += interval ) { double tsamp = tins; if ( 0 != env.size() ) --- 279,300 ---- // find time of first and last breakpoint for the resampled envelope: ! double firstSampleTime = interval * int( 0.5 + p.startTime() / interval ); ! double lastSampleTime = p.endTime() + ( 0.5 * interval ); + // find the extent of the timing envelope, if specified, otherwise + // the insert time range is the same as the sample time range: + double firstInsertTime = firstSampleTime; + double lastInsertTime = lastSampleTime; + if ( 0 != env.size() ) + { + firstInsertTime = interval * int( 0.5 + env.begin()->first / interval ); + lastInsertTime = (--env.end())->first + ( 0.5 * interval ); + } // resample: ! for ( double tins = firstInsertTime; tins <= lastInsertTime; tins += interval ) { + // sample time is obtained from the timing envelope, if specified, + // otherwise same as the insert time: double tsamp = tins; if ( 0 != env.size() ) *************** *** 283,286 **** --- 302,306 ---- tsamp = env.valueAt( tins ); } + insert_resampled_at( newp, p, tsamp, tins ); } |
|
From: Kelly F. <kf...@us...> - 2010-01-10 07:09:40
|
Update of /cvsroot/loris/Loris In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16228 Modified Files: NEWS configure.ac Log Message: Fixed several sources of phase errors in synthesis. Use Breakpoint time quantizing (in Resampler) to correctly move Breakpoints to sample instants before synthesizing each Partial, and use fixFrequency to correct the frequency envelopes after quanitizing the times. Synthesis accuracy is much improved, residuals are smaller. Also changed the behavior of Partial::phaseAt to return the synthesized phase, that is, the phase computed forward from the preceeding Breakpoint, as would be synthesized. Fixed a bug in SDIF export that was triggered by this phaseAt change, now export Breakpoint data exactly, instead of using parametersAt data. Index: NEWS =================================================================== RCS file: /cvsroot/loris/Loris/NEWS,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** NEWS 2 Jan 2010 04:55:12 -0000 1.91 --- NEWS 10 Jan 2010 07:09:27 -0000 1.92 *************** *** 4,13 **** Python module, a C-linkable interface, and documentation. ! Loris 1.5.4 is a minor upgrade to Loris 1.5.3, offering enhancements ! to the LinearEnvelope class and minor bug fixes. ! ! The changes in Loris 1.5.4 are fully backwards-compatible with Loris ! 1.5.3 but some changes in Loris 1.5.3 are incompatible with older Loris ! versions, and may require changes to existing program code. Loris can be downloaded from http://sourceforge.net/projects/loris --- 4,9 ---- Python module, a C-linkable interface, and documentation. ! Loris 1.6 fixes long-standing phase errors in synthesis, improves ! the Resampler, and enhances the Python interface. Loris can be downloaded from http://sourceforge.net/projects/loris *************** *** 29,32 **** --- 25,32 ---- changes since 1.5.4 release: + - Corrected several sources of phase errors in synthesis. + + - Improved the Resampler interface and functionality. + - Added capability to perform logarithmic frequency morphing -- log or linear morphing can be selected independently for both Index: configure.ac =================================================================== RCS file: /cvsroot/loris/Loris/configure.ac,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** configure.ac 2 Jan 2010 04:55:12 -0000 1.69 --- configure.ac 10 Jan 2010 07:09:27 -0000 1.70 *************** *** 39,43 **** LORIS_MINOR_VERSION=6 LORIS_SUBMINOR_VERSION= ! LORIS_PRERELEASE_STR="dev" LORIS_VERSION_STR="$PACKAGE_STRING$LORIS_PRERELEASE_STR" AC_SUBST(LORIS_MAJOR_VERSION) --- 39,43 ---- LORIS_MINOR_VERSION=6 LORIS_SUBMINOR_VERSION= ! LORIS_PRERELEASE_STR= LORIS_VERSION_STR="$PACKAGE_STRING$LORIS_PRERELEASE_STR" AC_SUBST(LORIS_MAJOR_VERSION) |
|
From: Kelly F. <kf...@us...> - 2010-01-10 07:09:40
|
Update of /cvsroot/loris/Loris/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16228/test Modified Files: test_Distiller.C test_Morpher.C test_Partial.C test_SdifFile.C Log Message: Fixed several sources of phase errors in synthesis. Use Breakpoint time quantizing (in Resampler) to correctly move Breakpoints to sample instants before synthesizing each Partial, and use fixFrequency to correct the frequency envelopes after quanitizing the times. Synthesis accuracy is much improved, residuals are smaller. Also changed the behavior of Partial::phaseAt to return the synthesized phase, that is, the phase computed forward from the preceeding Breakpoint, as would be synthesized. Fixed a bug in SDIF export that was triggered by this phaseAt change, now export Breakpoint data exactly, instead of using parametersAt data. Index: test_Morpher.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Morpher.C,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_Morpher.C 2 Jan 2010 04:55:12 -0000 1.25 --- test_Morpher.C 10 Jan 2010 07:09:27 -0000 1.26 *************** *** 80,84 **** #define EPSILON .01 // VERY lax with morphing, should be more rigorous bool ret = false; ! if ( std::fabs(x) > 0. ) { ret = std::fabs((x-y)/x) < EPSILON; --- 80,84 ---- #define EPSILON .01 // VERY lax with morphing, should be more rigorous bool ret = false; ! if ( std::fabs(x) > EPSILON ) { ret = std::fabs((x-y)/x) < EPSILON; Index: test_Distiller.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Distiller.C,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_Distiller.C 2 Jan 2010 04:55:12 -0000 1.20 --- test_Distiller.C 10 Jan 2010 07:09:27 -0000 1.21 *************** *** 46,53 **** using namespace std; // --- macros --- // define this to see pages and pages of spew ! // #define VERBOSE #ifdef VERBOSE #define TEST(invariant) \ --- 46,60 ---- using namespace std; + + #if defined(HAVE_M_PI) && (HAVE_M_PI) + const double Pi = M_PI; + #else + const double Pi = 3.14159265358979324; + #endif + // --- macros --- // define this to see pages and pages of spew ! //#define VERBOSE #ifdef VERBOSE #define TEST(invariant) \ *************** *** 90,93 **** --- 97,114 ---- #define SAME_PARAM_VALUES(x,y) TEST( float_equal((x),(y)) ) + // --------------------------------------------------------------------------- + // 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) ); + } + + // ----------- test_distill_manylabels ----------- // *************** *** 423,427 **** SAME_PARAM_VALUES( distit->amplitude(), compareit->amplitude() ); SAME_PARAM_VALUES( distit->bandwidth(), compareit->bandwidth() ); ! SAME_PARAM_VALUES( distit->phase(), compareit->phase() ); ++compareit; --- 444,448 ---- SAME_PARAM_VALUES( distit->amplitude(), compareit->amplitude() ); SAME_PARAM_VALUES( distit->bandwidth(), compareit->bandwidth() ); ! SAME_PARAM_VALUES( wrapPi( distit->phase() ), wrapPi( compareit->phase() ) ); ++compareit; Index: test_Partial.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Partial.C,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_Partial.C 2 Jan 2010 04:55:12 -0000 1.15 --- test_Partial.C 10 Jan 2010 07:09:27 -0000 1.16 *************** *** 104,108 **** const double P1_AMPS[] = {.2, .2, .4}; const double P1_BWS[] = {0, 0, .2}; ! const double P1_PHS[] = {-.8, .8, .8}; // std::fmod( .8 + (2 * Pi * (0.2*110)), 2. * Pi )}; for (int i = 0; i < NUM_BPTS; ++i ) --- 104,108 ---- const double P1_AMPS[] = {.2, .2, .4}; const double P1_BWS[] = {0, 0, .2}; ! const double P1_PHS[] = {.8, .8, .8}; // std::fmod( .8 + (2 * Pi * (0.2*110)), 2. * Pi )}; for (int i = 0; i < NUM_BPTS; ++i ) *************** *** 197,201 **** const double P1_AMPS[] = {.2, .2, .4}; const double P1_BWS[] = {0, 0, .2}; ! const double P1_PHS[] = {-.8, .8, -1.2}; for (int i = 0; i < NUM_BPTS; ++i ) --- 197,201 ---- const double P1_AMPS[] = {.2, .2, .4}; const double P1_BWS[] = {0, 0, .2}; ! const double P1_PHS[] = {.8, .8, -1.2}; for (int i = 0; i < NUM_BPTS; ++i ) Index: test_SdifFile.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_SdifFile.C,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_SdifFile.C 2 Jan 2010 04:55:12 -0000 1.12 --- test_SdifFile.C 10 Jan 2010 07:09:27 -0000 1.13 *************** *** 50,54 **** // define this to see pages and pages of spew ! // #define VERBOSE #ifdef VERBOSE #define TEST(invariant) \ --- 50,54 ---- // define this to see pages and pages of spew ! //#define VERBOSE #ifdef VERBOSE #define TEST(invariant) \ |
|
From: Kelly F. <kf...@us...> - 2010-01-10 07:09:35
|
Update of /cvsroot/loris/Loris/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16228/src Modified Files: BreakpointUtils.C Partial.C Resampler.C Resampler.h SdifFile.C Synthesizer.C Synthesizer.h Log Message: Fixed several sources of phase errors in synthesis. Use Breakpoint time quantizing (in Resampler) to correctly move Breakpoints to sample instants before synthesizing each Partial, and use fixFrequency to correct the frequency envelopes after quanitizing the times. Synthesis accuracy is much improved, residuals are smaller. Also changed the behavior of Partial::phaseAt to return the synthesized phase, that is, the phase computed forward from the preceeding Breakpoint, as would be synthesized. Fixed a bug in SDIF export that was triggered by this phaseAt change, now export Breakpoint data exactly, instead of using parametersAt data. Index: Synthesizer.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Synthesizer.h,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Synthesizer.h 2 Jan 2010 04:55:12 -0000 1.50 --- Synthesizer.h 10 Jan 2010 07:09:27 -0000 1.51 *************** *** 160,164 **** //! Partial, p, including fade out at the end. //! \throw InvalidPartial if the Partial has negative start time. ! void synthesize( const Partial & p ); //! Function call operator: same as synthesize( p ). --- 160,164 ---- //! Partial, p, including fade out at the end. //! \throw InvalidPartial if the Partial has negative start time. ! void synthesize( Partial p ); //! Function call operator: same as synthesize( p ). Index: SdifFile.C =================================================================== RCS file: /cvsroot/loris/Loris/src/SdifFile.C,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** SdifFile.C 2 Jan 2010 04:55:12 -0000 1.56 --- SdifFile.C 10 Jan 2010 07:09:27 -0000 1.57 *************** *** 1914,1923 **** // For enhanced format we use exact timing; the activeIndices only includes // partials that have breakpoints in this frame. ! // For sine-only format we resample at frame times. Assert( par->endTime() >= frameTime ); ! double tim = enhanced ? par->findAfter( frameTime ).time() : frameTime; ! // Must have phase between 0 and 2*Pi. ! double phas = par->phaseAt( tim ); if (phas < 0) { --- 1914,1935 ---- // For enhanced format we use exact timing; the activeIndices only includes // partials that have breakpoints in this frame. ! // For sine-only format we resample at frame times, for enhanced, use ! // the Breakpoints themselves. Assert( par->endTime() >= frameTime ); ! double tim = frameTime; ! Breakpoint params; ! if ( enhanced ) ! { ! Partial::const_iterator pos = par->findAfter( frameTime ); ! tim = pos.time(); ! params = pos.breakpoint(); ! } ! else ! { ! params = par->parametersAt( frameTime ); ! } ! // Must have phase between 0 and 2*Pi. ! double phas = params.phase(); if (phas < 0) { *************** *** 1927,1936 **** // Fill in values for this row of matrix data. *rowDataPtr++ = index; // first row of matrix (standard) ! *rowDataPtr++ = par->frequencyAt( tim ); // second row of matrix (standard) ! *rowDataPtr++ = par->amplitudeAt( tim ); // third row of matrix (standard) *rowDataPtr++ = phas; // fourth row of matrix (standard) if (enhanced) { ! *rowDataPtr++ = par->bandwidthAt( tim ); // fifth row of matrix (loris) *rowDataPtr++ = tim - frameTime; // sixth row of matrix (loris) } --- 1939,1948 ---- // Fill in values for this row of matrix data. *rowDataPtr++ = index; // first row of matrix (standard) ! *rowDataPtr++ = params.frequency(); // second row of matrix (standard) ! *rowDataPtr++ = params.amplitude(); // third row of matrix (standard) *rowDataPtr++ = phas; // fourth row of matrix (standard) if (enhanced) { ! *rowDataPtr++ = params.bandwidth(); // fifth row of matrix (loris) *rowDataPtr++ = tim - frameTime; // sixth row of matrix (loris) } Index: Synthesizer.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Synthesizer.C,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** Synthesizer.C 2 Jan 2010 04:55:12 -0000 1.69 --- Synthesizer.C 10 Jan 2010 07:09:27 -0000 1.70 *************** *** 45,48 **** --- 45,50 ---- #include "Notifier.h" #include "Partial.h" + #include "Resampler.h" + #include "phaseFix.h" #include <algorithm> *************** *** 210,214 **** // void ! Synthesizer::synthesize( const Partial & p ) { if ( p.numBreakpoints() == 0 ) --- 212,216 ---- // void ! Synthesizer::synthesize( Partial p ) { if ( p.numBreakpoints() == 0 ) *************** *** 227,230 **** --- 229,243 ---- << p.initialPhase() << " starting frequency " << p.first().frequency() << endl; + + // better to compute this only once: + const double OneOverSrate = 1. / m_srateHz; + + + // use a Resampler to quantize the Breakpoint times and + // correct the phases: + Resampler quantizer( OneOverSrate ); + quantizer.setPhaseCorrect( true ); + quantizer.quantize( p ); + // resize the sample buffer if necessary: *************** *** 240,246 **** // m_fadeTimeSec before the Partial's startTime, but not before 0: double itime = ( m_fadeTimeSec < p.startTime() ) ? ( p.startTime() - m_fadeTimeSec ) : 0.; ! index_type currentSamp = index_type( itime * m_srateHz ); // reset the oscillator: m_osc.resetEnvelopes( BreakpointUtils::makeNullBefore( p.first(), p.startTime() - itime ), m_srateHz ); --- 253,262 ---- // m_fadeTimeSec before the Partial's startTime, but not before 0: double itime = ( m_fadeTimeSec < p.startTime() ) ? ( p.startTime() - m_fadeTimeSec ) : 0.; ! index_type currentSamp = index_type( (itime * m_srateHz) + 0.5 ); // cheap rounding // reset the oscillator: + // all that really needs to happen here is setting the frequency + // correctly, the phase will be reset again in the loop over + // Breakpoints below, and the amp and bw can start at 0. m_osc.resetEnvelopes( BreakpointUtils::makeNullBefore( p.first(), p.startTime() - itime ), m_srateHz ); *************** *** 252,258 **** double prevFrequency = p.first().frequency(); - // better to compute this only once: - const double OneOverSrate = 1. / m_srateHz; - // synthesize linear-frequency segments until // there aren't any more Breakpoints to make segments: --- 268,271 ---- *************** *** 260,264 **** for ( Partial::const_iterator it = p.begin(); it != p.end(); ++it ) { ! index_type tgtSamp = index_type( it.time() * m_srateHz ); Assert( tgtSamp >= currentSamp ); --- 273,277 ---- for ( Partial::const_iterator it = p.begin(); it != p.end(); ++it ) { ! index_type tgtSamp = index_type( (it.time() * m_srateHz) + 0.5 ); // cheap rounding Assert( tgtSamp >= currentSamp ); *************** *** 285,291 **** m_osc.oscillate( bufferBegin + currentSamp, bufferBegin + tgtSamp, ! it.breakpoint(), m_srateHz ); currentSamp = tgtSamp; prevFrequency = it.breakpoint().frequency(); } --- 298,307 ---- m_osc.oscillate( bufferBegin + currentSamp, bufferBegin + tgtSamp, ! it.breakpoint(), m_srateHz ); currentSamp = tgtSamp; + + // remember the frequency, may need it to reset the + // phase if a Null Breakpoint is encountered: prevFrequency = it.breakpoint().frequency(); } *************** *** 293,297 **** // render a fade out segment: m_osc.oscillate( bufferBegin + currentSamp, bufferBegin + endSamp, ! BreakpointUtils::makeNullAfter( p.last(), m_fadeTimeSec ), m_srateHz ); } --- 309,313 ---- // render a fade out segment: m_osc.oscillate( bufferBegin + currentSamp, bufferBegin + endSamp, ! BreakpointUtils::makeNullAfter( p.last(), m_fadeTimeSec ), m_srateHz ); } Index: Resampler.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Resampler.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Resampler.h 2 Jan 2010 04:55:12 -0000 1.13 --- Resampler.h 10 Jan 2010 07:09:27 -0000 1.14 *************** *** 39,42 **** --- 39,43 ---- #include "PartialList.h" + #include "LinearEnvelope.h" // begin namespace *************** *** 62,88 **** // --- lifecycle --- ! //! Construct a new Resampler using the specified sampling ! //! interval and sparse resampling. //! //! \param sampleInterval is the resampling interval in seconds, //! Breakpoint data is computed at integer multiples of //! sampleInterval seconds. //! \throw InvalidArgument if sampleInterval is not positive. explicit Resampler( double sampleInterval ); ! // use compiler-generated copy/assign/destroy ! ! // --- parameters --- ! //! Select dense or sparse resampling. //! ! //! \param useDense is a boolean flag indicating that dense ! //! resamping (Breakpoint at every integer multiple of the ! //! resampling interval) should be performed. If false (the ! //! default), sparse resampling (Breakpoints only at multiples ! //! of the resampling interval near Breakpoint times in the ! //! original Partial) is performed. ! void setDenseResampling( bool useDense ); //! Specify phase-corrected resampling, or not. If phase //! correct, Partial frequencies are altered slightly --- 63,133 ---- // --- lifecycle --- ! //! Initialize a Resampler having the specified uniform sampling ! //! interval. Enable phase-correct resampling, in which frequencies ! //! of resampled Partials are modified (using fixFrequency) such ! //! that the resampled phases are achieved in synthesis. Phase- ! //! correct resampling can be disabled using setPhaseCorrect. ! //! ! //! Resampled Partials will be composed of Breakpoints at every ! //! integer multiple of the resampling interval. ! //! ! //! \sa setPhaseCorrect ! //! \sa fixFrequency //! //! \param sampleInterval is the resampling interval in seconds, //! Breakpoint data is computed at integer multiples of //! sampleInterval seconds. + //! //! \throw InvalidArgument if sampleInterval is not positive. explicit Resampler( double sampleInterval ); ! //! Initialize a Resampler having the specified timing envelope. ! //! The timing envelope represents a map of Breakpoint times in ! //! resampled Partials onto parameter sampling instants in the ! //! original Partials. Phase-correct resampling is not generally ! //! possible using a nontrivial timing envelope, use the functions ! //! declared in phasefix.h to correct the phases and frequencies ! //! of resampled Partials. ! //! ! //! Resampled Partials will be composed of Breakpoints at times ! //! corresponding to the timing envelope breakpoints. ! //! ! //! \param timingEnv is the timing envelope, a map of Breakpoint ! //! times in resampled Partials onto parameter sampling ! //! instants in the original Partials. ! //! ! //! \throw InvalidArgument if timingEnv has any negative breakpoint ! //! times or values. ! explicit Resampler( const LinearEnvelope & timingEnv ); ! //! Initialize a Resampler having the specified timing envelope, ! //! uniformly sampled at the sampling interval. ! //! The timing envelope represents a map of Breakpoint times in ! //! resampled Partials onto parameter sampling instants in the ! //! original Partials. Phase-correct resampling is not generally ! //! possible using a nontrivial timing envelope, use the functions ! //! declared in phasefix.h to correct the phases and frequencies ! //! of resampled Partials. //! ! //! Resampled Partials will be composed of Breakpoints at every ! //! integer multiple of the resampling interval. ! //! ! //! \param timingEnv is the timing envelope, a map of Breakpoint ! //! times in resampled Partials onto parameter sampling ! //! instants in the original Partials. ! //! \param sampleInterval is the resampling interval in seconds, ! //! Breakpoint data is computed at integer multiples of ! //! sampleInterval seconds. ! //! ! //! \throw InvalidArgument if sampleInterval is not positive. ! //! \throw InvalidArgument if timingEnv has any negative breakpoint ! //! times or values. ! Resampler( const LinearEnvelope & timingEnv, double sampleInterval ); ! ! ! // --- use compiler-generated copy/assign/destroy --- + // --- parameters --- + //! Specify phase-corrected resampling, or not. If phase //! correct, Partial frequencies are altered slightly *************** *** 118,121 **** --- 163,179 ---- resample( p ); } + + + //! DCUMENT ME + //! The Breakpoint times in the resampled Partial will comprise a + //! sparse sequence of integer multiples of the sampling interval, + //! beginning with the multiple nearest to the Partial's start time and + //! ending with the multiple nearest to the Partial's end time, and including + //! only multiples that are near to Breakpoint times in the original Partial. + //! Resampling is performed in-place. + //! + //! \param p is the Partial to resample + void quantize( Partial & p ) const; + //! Resample all Partials in the specified (half-open) range using this *************** *** 155,159 **** resample( begin, end ); } ! // -- static members -- --- 213,242 ---- resample( begin, end ); } ! ! ! //! DOCUMENT ME ! //! Quantize all Partials in the specified (half-open) range using this ! //! Resampler's stored sampling interval, ! //! The Breakpoint times in the resampled Partial will comprise a ! //! sparse sequence of integer multiples of the sampling interval, ! //! beginning with the multiple nearest to the Partial's start time and ! //! ending with the multiple nearest to the Partial's end time, and including ! //! only multiples that are near to Breakpoint times in the original Partial. ! //! Resampling is performed in-place. ! //! ! //! \param begin is the beginning of the range of Partials to quantize ! //! \param end is (one-past) the end of the range of Partials to quantize ! //! ! //! If compiled with NO_TEMPLATE_MEMBERS defined, then begin and end ! //! must be PartialList::iterators, otherwise they can be any type ! //! of iterators over a sequence of Partials. ! #if ! defined(NO_TEMPLATE_MEMBERS) ! template<typename Iter> ! void quantize( Iter begin, Iter end ) const; ! #else ! inline ! void quantize( PartialList::iterator begin, PartialList::iterator end ) const; ! #endif ! // -- static members -- *************** *** 195,204 **** private: //! the resampling interval in seconds double interval_; - - //! boolean selecting dense or sparse resampling - //! (default is false) - bool dense_; //! boolean flag selecting phase-corrected resampling --- 278,286 ---- private: + //! the timing envelope for resampling + LinearEnvelope timing_; + //! the resampling interval in seconds double interval_; //! boolean flag selecting phase-corrected resampling *************** *** 242,245 **** --- 324,362 ---- // --------------------------------------------------------------------------- + // quantize (sequence of Partials) + // --------------------------------------------------------------------------- + //! DOCUMENT ME + //! Quantize all Partials in the specified (half-open) range using this + //! Resampler's stored sampling interval, + //! The Breakpoint times in the resampled Partial will comprise a + //! sparse sequence of integer multiples of the sampling interval, + //! beginning with the multiple nearest to the Partial's start time and + //! ending with the multiple nearest to the Partial's end time, and including + //! only multiples that are near to Breakpoint times in the original Partial. + //! Resampling is performed in-place. + //! + //! \param begin is the beginning of the range of Partials to quantize + //! \param end is (one-past) the end of the range of Partials to quantize + //! + //! If compiled with NO_TEMPLATE_MEMBERS defined, then begin and end + //! must be PartialList::iterators, otherwise they can be any type + //! of iterators over a sequence of Partials. + // + #if ! defined(NO_TEMPLATE_MEMBERS) + template<typename Iter> + void Resampler::quantize( Iter begin, Iter end ) const + #else + inline + void Resampler::quantize( PartialList::iterator begin, PartialList::iterator end ) const + #endif + { + while ( begin != end ) + { + quantize( *begin++ ); + } + } + + + // --------------------------------------------------------------------------- // resample (static) // --------------------------------------------------------------------------- *************** *** 279,284 **** { Resampler instance( sampleInterval ); ! instance.setDenseResampling( denseResampling ); ! instance.resample( begin, end ); } --- 396,408 ---- { Resampler instance( sampleInterval ); ! ! if ( denseResampling ) ! { ! instance.resample( begin, end ); ! } ! else ! { ! instance.quantize( begin, end ); ! } } Index: BreakpointUtils.C =================================================================== RCS file: /cvsroot/loris/Loris/src/BreakpointUtils.C,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** BreakpointUtils.C 2 Jan 2010 04:55:12 -0000 1.13 --- BreakpointUtils.C 10 Jan 2010 07:09:27 -0000 1.14 *************** *** 61,65 **** // adjust phase double dp = 2. * Pi * fadeTime * bp.frequency(); ! ret.setPhase( std::fmod( ret.phase() - dp, 2. * Pi ) ); ret.setAmplitude(0.); ret.setBandwidth(0.); --- 61,65 ---- // adjust phase double dp = 2. * Pi * fadeTime * bp.frequency(); ! ret.setPhase( std::fmod( bp.phase() - dp, 2. * Pi ) ); ret.setAmplitude(0.); ret.setBandwidth(0.); *************** *** 80,84 **** // adjust phase double dp = 2. * Pi * fadeTime * bp.frequency(); ! ret.setPhase( std::fmod( ret.phase() + dp, 2. * Pi ) ); ret.setAmplitude(0.); ret.setBandwidth(0.); --- 80,84 ---- // adjust phase double dp = 2. * Pi * fadeTime * bp.frequency(); ! ret.setPhase( std::fmod( bp.phase() + dp, 2. * Pi ) ); ret.setAmplitude(0.); ret.setBandwidth(0.); Index: Resampler.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Resampler.C,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Resampler.C 2 Jan 2010 04:55:12 -0000 1.20 --- Resampler.C 10 Jan 2010 07:09:27 -0000 1.21 *************** *** 43,46 **** --- 43,47 ---- #include "Resampler.h" #include "Breakpoint.h" + #include "LinearEnvelope.h" #include "LorisExceptions.h" #include "Notifier.h" *************** *** 54,69 **** // helper declarations: ! static void resample_dense( Partial & p, double interval ); ! static void resample_sparse( Partial & p, double interval ); static void insert_resampled_at( Partial & newp, const Partial & p, ! double curtime, double interval ); ! static bool check_error_at( Partial & newp, const Partial & p, ! double time, double interval ); // --------------------------------------------------------------------------- ! // constructor // --------------------------------------------------------------------------- ! //! Construct a new Resampler using the specified sampling ! //! interval and sparse resampling. //! //! \param sampleInterval is the resampling interval in seconds, --- 55,101 ---- // helper declarations: ! 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 ); ! ! /* ! new ideas ! ! use linear envelope to specify timing (possibly warped, line slope 1 ! for plain old uniform resampling) ! ! dense resampling samples then envelope uniformly at the specified interval, ! envelope determines the time at which the original partial is sampled ! ! sparse resampling samples only the breakpoints in the envelope (interval ! is zero in this case) ! ! sparse sampling, by this definition, makes no sense without an envelope ! specification ! ! This is a different definition of sparse resampling from the old one. ! What the hell good was the old one? Could that be useful for anything? ! ! NEXT STEP ! Revisit the default values for parameters, and define necessary ! constructors and members related to the timing envelope. ! */ ! // --------------------------------------------------------------------------- ! // constructor - sampling interval // --------------------------------------------------------------------------- ! //! Initialize a Resampler having the specified uniform sampling ! //! interval. Enable phase-correct resampling, in which frequencies ! //! of resampled Partials are modified (using fixFrequency) such ! //! that the resampled phases are achieved in synthesis. Phase- ! //! correct resampling can be disabled using setPhaseCorrect. ! //! ! //! Resampled Partials will be composed of Breakpoints at every ! //! integer multiple of the resampling interval. ! //! ! //! \sa setPhaseCorrect ! //! \sa fixFrequency //! //! \param sampleInterval is the resampling interval in seconds, *************** *** 73,103 **** // Resampler::Resampler( double sampleInterval ) : ! interval_( sampleInterval ), ! dense_( false ), ! phaseCorrect_( true ) { ! if ( sampleInterval <= 0. ) ! { Throw( InvalidArgument, "Resampler sample interval must be positive." ); ! } } // --------------------------------------------------------------------------- ! // setDenseResampling // --------------------------------------------------------------------------- ! //! Select dense or sparse resampling. //! ! //! \param useDense is a boolean flag indicating that dense ! //! resamping (Breakpoint at every integer multiple of the ! //! resampling interval) should be performed. If false (the ! //! default), sparse resampling (Breakpoints only at multiples ! //! of the resampling interval near Breakpoint times in the ! //! original Partial) is performed. // ! void Resampler::setDenseResampling( bool useDense ) { ! dense_ = useDense; } // --------------------------------------------------------------------------- // setPhaseCorrect --- 105,190 ---- // Resampler::Resampler( double sampleInterval ) : ! interval_( sampleInterval ), ! phaseCorrect_( true ) { ! if ( sampleInterval <= 0. ) ! { Throw( InvalidArgument, "Resampler sample interval must be positive." ); ! } } // --------------------------------------------------------------------------- ! // constructor - timing envelope // --------------------------------------------------------------------------- ! //! Initialize a Resampler having the specified timing envelope. ! //! The timing envelope represents a map of Breakpoint times in ! //! resampled Partials onto parameter sampling instants in the ! //! original Partials. Phase-correct resampling is not generally ! //! possible using a nontrivial timing envelope, use the functions ! //! declared in phasefix.h to correct the phases and frequencies ! //! of resampled Partials. //! ! //! Resampled Partials will be composed of Breakpoints at times ! //! corresponding to the timing envelope breakpoints. ! //! ! //! \param timingEnv is the timing envelope, a map of Breakpoint ! //! times in resampled Partials onto parameter sampling ! //! instants in the original Partials. ! //! \throw InvalidArgument if timingEnv has any negative breakpoint ! //! times or values. // ! Resampler::Resampler( const LinearEnvelope & timingEnv ) : ! timing_( timingEnv ), ! interval_( 0 ), ! phaseCorrect_( false ) { ! // check the timing envelope for negative times or values ! } ! ! // --------------------------------------------------------------------------- ! // constructor - timing envelope and sampling interval ! // --------------------------------------------------------------------------- ! //! Initialize a Resampler having the specified timing envelope, ! //! uniformly sampled at the sampling interval. ! //! The timing envelope represents a map of Breakpoint times in ! //! resampled Partials onto parameter sampling instants in the ! //! original Partials. Phase-correct resampling is not generally ! //! possible using a nontrivial timing envelope, use the functions ! //! declared in phasefix.h to correct the phases and frequencies ! //! of resampled Partials. ! //! ! //! Resampled Partials will be composed of Breakpoints at every ! //! integer multiple of the resampling interval. ! //! ! //! \param timingEnv is the timing envelope, a map of Breakpoint ! //! times in resampled Partials onto parameter sampling ! //! instants in the original Partials. ! //! \param sampleInterval is the resampling interval in seconds, ! //! Breakpoint data is computed at integer multiples of ! //! sampleInterval seconds. ! //! ! //! \throw InvalidArgument if sampleInterval is not positive. ! //! \throw InvalidArgument if timingEnv has any negative breakpoint ! //! times or values. ! Resampler::Resampler( const LinearEnvelope & timingEnv, double sampleInterval ) : ! timing_( timingEnv ), ! interval_( sampleInterval ), ! phaseCorrect_( false ) ! { ! if ( sampleInterval <= 0. ) ! { ! Throw( InvalidArgument, "Resampler sample interval must be positive." ); ! } ! ! // HEY!!! check the timing envelope for negative times or values ! /* ! if ( 0 > timingEnv.begin()->first ) ! { ! Throw( InvalidArgument, "Resampler timing envelope must not have negative." ); ! } ! */ } + // --------------------------------------------------------------------------- // setPhaseCorrect *************** *** 137,172 **** Resampler::resample( Partial & p ) const { ! if ( dense_ ) { ! resample_dense( p, interval_ ); } else { ! resample_sparse( p, interval_ ); } if ( phaseCorrect_ ) { - // To damp or not to damp? - // When correcting phase, use damping if the resampling - // interval is less than the length of a period, otherwise - // don't damp the correction. - // - // No, maybe damping is always needed for small intervals? - // This smooth fade is a kludge that seems to work. - // - // Used to do this each time a Breakpoint was inserted, but - // it amounts to the same thing as just doing it at the end. - // fixFrequency doesn't currently allow specification of - // the damping, may need to add that back later. - /* - double damping = 0.5; - const double MAGICKLUDGE = 0.012; - if ( interval > MAGICKLUDGE ) - { - damping += std::min( 0.5, 100 * (interval - MAGICKLUDGE) ); - } - // debugger << "damping is " << damping << endl; - */ fixFrequency( p ); // use default maxFixPct } --- 224,247 ---- Resampler::resample( Partial & p ) const { ! debugger << "resampling Partial labeled " << p.label() ! << " having " << p.numBreakpoints() ! << " Breakpoints" << endl; ! ! ! if ( 0 != interval_ ) { ! resample_dense( p, timing_, interval_ ); } else { ! resample_sparse( p, timing_ ); } + debugger << "resampled Partial has " << p.numBreakpoints() + << " Breakpoints" << endl; + + if ( phaseCorrect_ ) { fixFrequency( p ); // use default maxFixPct } *************** *** 184,195 **** //! //! \param p is the Partial to resample //! \param interval is the resamping interval in seconds // ! static void resample_dense( Partial & p, double interval ) { - debugger << "resampling Partial labeled " << p.label() - << " having " << p.numBreakpoints() - << " Breakpoints" << endl; - // create the new Partial: Partial newp; --- 259,269 ---- //! //! \param p is the Partial to resample + //! \param env is the timing envelope //! \param interval is the resamping interval in seconds // ! static ! void ! resample_dense( Partial & p, const LinearEnvelope & env, double interval ) { // create the new Partial: Partial newp; *************** *** 202,213 **** // resample: ! for ( double tim = firstTime; tim < stopTime; tim += interval ) { ! insert_resampled_at( newp, p, tim, interval ); } ! ! debugger << "resamplied Partial has " << newp.numBreakpoints() ! << " Breakpoints" << endl; ! // store the new Partial: p = newp; --- 276,289 ---- // resample: ! for ( double tins = firstTime; tins < stopTime; tins += interval ) { ! double tsamp = tins; ! if ( 0 != env.size() ) ! { ! tsamp = env.valueAt( tins ); ! } ! insert_resampled_at( newp, p, tsamp, tins ); } ! // store the new Partial: p = newp; *************** *** 218,221 **** --- 294,346 ---- // --------------------------------------------------------------------------- //! Helper function to perform sparse resampling at a specified interval. + //! Sample the origial Partial only at breakpoints in the timing envelope. + //! \param p is the Partial to resample + //! \param env is the timing envelope + //! \param interval is the resamping interval in seconds + // + static + void + resample_sparse( Partial & p, const LinearEnvelope & env ) + { + if ( 0 == env.size() ) + { + Throw( InvalidArgument, + "Sparse resampling requires a timing envelope specification." ); + } + + // create the new Partial: + Partial newp; + newp.setLabel( p.label() ); + + // find time of first breakpoint for the resampled envelope: + LinearEnvelope::const_iterator it = env.begin(); + while( it->first < p.startTime() ) + { + ++it; + } + + // resample: + while ( it != env.end() ) + { + double tins = it->first; + double tsamp = tins; + if ( 0 != env.size() ) + { + tsamp = env.valueAt( tins ); + } + insert_resampled_at( newp, p, tsamp, tins ); + + ++it; + } + + // store the new Partial: + p = newp; + } + + + + // --------------------------------------------------------------------------- + // quantize + // --------------------------------------------------------------------------- //! The Breakpoint times in the resampled Partial will comprise a //! sparse sequence of integer multiples of the sampling interval, *************** *** 226,237 **** //! //! \param p is the Partial to resample - //! \param interval is the resamping interval in seconds // ! static void resample_sparse( Partial & p, double interval ) { ! debugger << "resampling Partial labeled " << p.label() << " having " << p.numBreakpoints() << " Breakpoints" << endl; // create the new Partial: Partial newp; --- 351,370 ---- //! //! \param p is the Partial to resample // ! void Resampler::quantize( Partial & p ) const { ! debugger << "quantizing Partial labeled " << p.label() << " having " << p.numBreakpoints() << " Breakpoints" << endl; + // 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: + if ( phaseCorrect_ ) + { + fixPhaseForward( p.begin(), --p.end() ); + } + // create the new Partial: Partial newp; *************** *** 240,301 **** // resample: double curtime = 0; ! double halfstep = .5 * interval; Partial::const_iterator iter = p.begin(); ! ! unsigned int countSkippedSteps = 0; ! double prevInsertTime = 0; ! while( iter != p.end() ) { double bpt = iter.time(); - - debugger << " ----------------------- \n" - << "considering bp at time " << bpt - << " and amplitude " << iter->amplitude() - << "\nquanitzation step time is " << curtime - << endl; - if ( bpt < curtime - halfstep ) { ! // advance Breakpoint iterator: ++iter; ! ! debugger << "skipping bp" << endl; ! } else if (curtime < bpt - halfstep) { ! // advance current time: ! curtime += interval; ! ! ++countSkippedSteps; ! ! debugger << "skipping quantization step" << endl; } else { ! insert_resampled_at( newp, p, curtime, interval ); ! ! // check for errors introduced by skippint steps ! if ( ( 0 < countSkippedSteps ) && ! check_error_at( newp, p, curtime-interval, interval ) ) ! { ! insert_resampled_at( newp, p, curtime-interval, interval ); ! } ! if ( ( 1 < countSkippedSteps ) && ! check_error_at( newp, p, prevInsertTime+interval, interval ) ) ! { ! insert_resampled_at( newp, p, prevInsertTime+interval, interval ); ! } ! ! prevInsertTime = curtime; ! countSkippedSteps = 0; ! ! // advance the Breakpoint iterator and the current time: ++iter; ! curtime += interval; } } ! debugger << "resampled Partial has " << newp.numBreakpoints() << " Breakpoints" << endl; --- 373,411 ---- // 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_; } } ! // for phase-correct quantization, adjust the frequencies to match ! // the interpolated phases: ! if ( phaseCorrect_ ) ! { ! fixFrequency( newp, 1 ); ! } ! ! ! debugger << "quantized Partial has " << newp.numBreakpoints() << " Breakpoints" << endl; *************** *** 311,414 **** static void insert_resampled_at( Partial & newp, const Partial & p, ! double curtime, double interval ) { // make a resampled Breakpoint: ! Breakpoint newbp = p.parametersAt( curtime ); // handle end points to reduce error at ends ! if ( curtime < p.startTime() ) { newbp.setAmplitude( p.first().amplitude() ); } ! else if ( curtime > p.endTime() ) { newbp.setAmplitude( p.last().amplitude() ); } ! /* ! double overrideAmp = ! p.findNearest( curtime ).breakpoint().amplitude(); ! newbp.setAmplitude( overrideAmp ); ! */ ! ! /* ! Used to do this here, now do it all at once in resample. ! ! #if defined(PHASE_CORRECT) ! if ( newp.numBreakpoints() != 0 ) ! { ! double dt = curtime - newp.endTime(); ! ! // To damp or not to damp? ! // When correcting phase, use damping if the resampling ! // interval is less than the length of a period, otherwise ! // don't damp the correction. ! // ! // No, maybe damping is always needed for small intervals? ! // This smooth fade is a kludge that seems to work. ! double damping = 0.5; ! const double MAGICKLUDGE = 0.012; ! if ( dt > MAGICKLUDGE ) ! { ! damping += std::min( 0.5, 100 * (dt - MAGICKLUDGE) ); ! } ! ! matchPhaseFwd( newp.last(), newbp, dt, damping ); ! } ! #endif ! */ ! ! newp.insert( curtime, newbp ); debugger << "inserted Breakpoint having amplitude " << newbp.amplitude() ! << " at time " << curtime << endl; ! } ! ! // --------------------------------------------------------------------------- ! // check_error_at (helper) ! // --------------------------------------------------------------------------- ! // Sparse resampling helper for correcting errors introduced by skipping ! // quantization steps. Fix by not skipping so many! ! // ! static bool ! check_error_at( Partial & newp, const Partial & p, ! double time, double interval ) ! { ! // don't insert extra Breakpoints past the ends ! // of the Partial ! if ( time < p.startTime() || time > p.endTime() ) ! { ! return false; ! } ! ! Breakpoint original = p.parametersAt( time, interval ); ! Breakpoint resampled = newp.parametersAt( time ); ! ! // amplitude tolerance is 1% of original ! const double eps = 1E-6; ! double ampErr = std::fabs( original.amplitude() - resampled.amplitude() ) / ! ( original.amplitude() + eps ); ! if ( ampErr > 0.01 ) ! { ! return true; ! } ! ! // frequency tolerance is 1% of original ! double freqErr = std::fabs( original.frequency() - resampled.frequency() ) / ! ( original.frequency() ); ! if ( freqErr > 0.01 ) ! { ! return true; ! } ! ! // bandwidth tolerance is 10% of original ! double bwErr = std::fabs( original.bandwidth() - resampled.bandwidth() ) / ! ( original.bandwidth() + eps ); ! if ( bwErr > 0.1 ) ! { ! return true; ! } ! ! return false; } --- 421,444 ---- static void insert_resampled_at( Partial & newp, const Partial & p, ! double sampleTime, double insertTime ) { // make a resampled Breakpoint: ! Breakpoint newbp = p.parametersAt( sampleTime ); // handle end points to reduce error at ends ! if ( sampleTime < p.startTime() ) { newbp.setAmplitude( p.first().amplitude() ); } ! else if ( sampleTime > p.endTime() ) { newbp.setAmplitude( p.last().amplitude() ); } + ! newp.insert( insertTime, newbp ); debugger << "inserted Breakpoint having amplitude " << newbp.amplitude() ! << " at time " << insertTime << endl; } Index: Partial.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Partial.C,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** Partial.C 2 Jan 2010 04:55:12 -0000 1.71 --- Partial.C 10 Jan 2010 07:09:27 -0000 1.72 *************** *** 274,278 **** /* // this allows Breakpoints to be inserted arbitrarily ! // cloase together, which is no good, can cause trouble later: std::pair< container_type::iterator, bool > result = --- 274,278 ---- /* // this allows Breakpoints to be inserted arbitrarily ! // close together, which is no good, can cause trouble later: std::pair< container_type::iterator, bool > result = *************** *** 764,767 **** --- 764,781 ---- } + + // --------------------------------------------------------------------------- + // 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 *************** *** 790,810 **** if ( it == begin() ) { ! // time is before the onset of the Partial: double dp = 2. * Pi * (it.time() - time) * it.breakpoint().frequency(); ! return std::fmod( it.breakpoint().phase() - dp, 2. * Pi); } 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 std::fmod( it.breakpoint().phase() + dp, 2. * Pi ); } else { ! // interpolate between it and its predeccessor ! // (we checked already that it is not begin): const Breakpoint & hi = it.breakpoint(); double hitime = it.time(); --- 804,824 ---- 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(); *************** *** 815,834 **** ( ( 1. - alpha ) * lo.frequency() ); ! // need to keep fmod in here because other stuff ! // (Spc export and sdif export, for example) rely ! // on it: ! if ( alpha < 0.5 ) ! { ! double favg = 0.5 * ( lo.frequency() + finterp ); ! double dp = 2. * Pi * (time - lotime) * favg; ! return std::fmod( lo.phase() + dp, 2. * Pi ); ! } ! else ! { ! double favg = 0.5 * ( hi.frequency() + finterp ); ! double dp = 2. * Pi * (hitime - time) * favg; ! return std::fmod( hi.phase() - dp, 2. * Pi ); ! } ! } } --- 829,840 ---- ( ( 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 ); } } *************** *** 919,923 **** double dp = 2. * Pi * (it.time() - time) * it.breakpoint().frequency(); ! double ph = std::fmod( it.breakpoint().phase() - dp, 2. * Pi); return Breakpoint( it.breakpoint().frequency(), amp, --- 925,929 ---- double dp = 2. * Pi * (it.time() - time) * it.breakpoint().frequency(); ! double ph = wrapPi( it.breakpoint().phase() - dp ); return Breakpoint( it.breakpoint().frequency(), amp, *************** *** 941,945 **** double dp = 2. * Pi * (time - it.time()) * it.breakpoint().frequency(); ! double ph = std::fmod( it.breakpoint().phase() + dp, 2. * Pi ); return Breakpoint( it.breakpoint().frequency(), amp, --- 947,951 ---- double dp = 2. * Pi * (time - it.time()) * it.breakpoint().frequency(); ! double ph = wrapPi( it.breakpoint().phase() + dp ); return Breakpoint( it.breakpoint().frequency(), amp, *************** *** 967,971 **** double favg = 0.5 * ( lo.frequency() + finterp ); double dp = 2. * Pi * (time - lotime) * favg; ! ph = std::fmod( lo.phase() + dp, 2. * Pi ); } else --- 973,977 ---- double favg = 0.5 * ( lo.frequency() + finterp ); double dp = 2. * Pi * (time - lotime) * favg; ! ph = wrapPi( lo.phase() + dp ); } else *************** *** 973,977 **** double favg = 0.5 * ( hi.frequency() + finterp ); double dp = 2. * Pi * (hitime - time) * favg; ! ph = std::fmod( hi.phase() - dp, 2. * Pi ); } --- 979,983 ---- double favg = 0.5 * ( hi.frequency() + finterp ); double dp = 2. * Pi * (hitime - time) * favg; ! ph = wrapPi( hi.phase() - dp ); } |
|
From: Kelly F. <kf...@us...> - 2010-01-10 07:04:26
|
Update of /cvsroot/loris/Loris/scripting In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16006 Modified Files: loris.i Log Message: Added new versions of resample, and added quantizeBreakpointTimes to the Python interface. Index: loris.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/loris.i,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** loris.i 2 Jan 2010 04:55:12 -0000 1.142 --- loris.i 10 Jan 2010 07:04:17 -0000 1.143 *************** *** 865,873 **** performed in-place. ! If dense resampling is selected, the Breakpoint times in densely ! resampled Partials will comprise a contiguous sequence of ALL ! integer multiples of the sampling interval (very large, but useful ! for some third-party tools, like the CNMAT sinusoids~ external for ! Max/MSP). Default is sparse (not dense) resampling. If phase correct resampling is selected, Partial frequencies are --- 865,873 ---- performed in-place. ! The Breakpoint times in densely resampled Partials will comprise a ! contiguous sequence of ALL integer multiples of the sampling interval ! (very large, but useful for some third-party tools, like the CNMAT ! sinusoids~ external for Max/MSP). Default is sparse (not dense) ! resampling. If phase correct resampling is selected, Partial frequencies are *************** *** 879,882 **** --- 879,887 ---- %rename( resample ) wrap_resample; + %feature("docstring", + "Quantize the breakpoint times in the specified Partials. + In previous versions of Loris, this was called sparse resampling. + DOCUMENT ME.") quantizeBreakpointTimes; + %{ *************** *** 887,898 **** %inline %{ void wrap_resample( PartialList * partials, double interval, - bool denseResampling = false, bool phaseCorrect = true ) ! { ! try { Resampler r( interval ); - r.setDenseResampling( denseResampling ); r.setPhaseCorrect( phaseCorrect ); r.resample( partials->begin(), partials->end() ); --- 892,900 ---- %inline %{ void wrap_resample( PartialList * partials, double interval, bool phaseCorrect = true ) ! { try { Resampler r( interval ); r.setPhaseCorrect( phaseCorrect ); r.resample( partials->begin(), partials->end() ); *************** *** 903,906 **** --- 905,946 ---- } } + + void wrap_resample( PartialList * partials, LinearEnvelope * timing ) + { + try + { + Resampler r( *timing ); + // r.setPhaseCorrect( phaseCorrect ); + r.resample( partials->begin(), partials->end() ); + } + catch ( std::exception & ex ) + { + throw_exception( ex.what() ); + } + } + + + void wrap_resample( PartialList * partials, LinearEnvelope * timing, + double interval ) + { + try + { + Resampler r( *timing, interval ); + // r.setPhaseCorrect( phaseCorrect ); + r.resample( partials->begin(), partials->end() ); + } + catch ( std::exception & ex ) + { + throw_exception( ex.what() ); + } + } + + + void quantizeBreakpointTimes( PartialList * partials, double interval ) + { + Resampler r( interval ); + r.setPhaseCorrect( true ); + r.quantize( partials->begin(), partials->end() ); + } %} *************** *** 1256,1259 **** --- 1296,1318 ---- void fixPhaseForward( PartialList * partials, double tbeg, double tend ); + /* + %feature("docstring", + "Adjust frequencies of the Breakpoints in the + specified Partial such that the rendered Partial + achieves (or matches as nearly as possible, within + the constraint of the maximum allowable frequency + alteration) the analyzed phases. + + partial The Partial whose frequencies, + and possibly phases (if the frequencies + cannot be sufficiently altered to match + the phases), will be recomputed. + + maxFixPct The maximum allowable frequency + alteration, default is 0.2%.") fixFrequency; + + void fixFrequency( Partial & partial, double maxFixPct = 0.2 ); + */ + %feature("docstring", "Return a string describing the Loris version number."); |
|
From: Kelly F. <kf...@us...> - 2010-01-10 06:29:58
|
Update of /cvsroot/loris/Loris/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11840 Modified Files: Oscillator.C Log Message: Corrected phase updates in the main sample generation loop (this has probably always been incorrect). Made synthesis more efficient in the case of bandwidth equal to zero (no noise generated or filtered). Index: Oscillator.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Oscillator.C,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Oscillator.C 2 Jan 2010 04:55:12 -0000 1.53 --- Oscillator.C 10 Jan 2010 06:29:41 -0000 1.54 *************** *** 142,146 **** // --------------------------------------------------------------------------- ! // generateSamples // --------------------------------------------------------------------------- // Accumulate bandwidth-enhanced sinusoidal samples modulating the --- 142,146 ---- // --------------------------------------------------------------------------- ! // oscillate // --------------------------------------------------------------------------- // Accumulate bandwidth-enhanced sinusoidal samples modulating the *************** *** 156,162 **** const Breakpoint & bp, double srate ) { ! double targetFreq = bp.frequency() * TwoPi / srate, ! targetAmp = bp.amplitude(), ! targetBw = bp.bandwidth(); // clamp bandwidth: --- 156,162 ---- const Breakpoint & bp, double srate ) { ! double targetFreq = bp.frequency() * TwoPi / srate; // radians per sample ! double targetAmp = bp.amplitude(); ! double targetBw = bp.bandwidth(); // clamp bandwidth: *************** *** 181,222 **** // compute trajectories: const double dTime = 1. / (end - begin); ! const double dFreq = (targetFreq - m_instfrequency) * dTime; const double dAmp = (targetAmp - m_instamplitude) * dTime; const double dBw = (targetBw - m_instbandwidth) * dTime; ! // could use temporary local variables for speed... nah! ! // Cannot possibly be worth it when I am computing square roots ! // and cosines! ! double am, nz; ! for ( double * putItHere = begin; putItHere != end; ++putItHere ) { ! // use math functions in namespace std: ! using namespace std; ! ! // compute amplitude modulation due to bandwidth: ! // ! // This will give the right amplitude modulation when scaled ! // by the Partial amplitude: ! // ! // carrier amp: sqrt( 1. - bandwidth ) * amp ! // modulation index: sqrt( 2. * bandwidth ) * amp ! // ! nz = m_filter.apply( m_modulator.sample() ); ! am = sqrt( 1. - m_instbandwidth ) + ( nz * sqrt( 2. * m_instbandwidth ) ); ! ! // compute a sample and add it into the buffer: ! *putItHere += am * m_instamplitude * cos( m_determphase ); ! ! // update the instantaneous oscillator state: ! m_determphase += m_instfrequency; // frequency is radians per sample ! m_instfrequency += dFreq; ! m_instamplitude += dAmp; ! m_instbandwidth += dBw; ! if (m_instbandwidth < 0.) ! { ! m_instbandwidth = 0.; ! } ! ! } // end of sample computation loop // wrap phase to prevent eventual loss of precision at --- 181,264 ---- // compute trajectories: const double dTime = 1. / (end - begin); ! const double dFreqOver2 = 0.5 * (targetFreq - m_instfrequency) * dTime; ! // split frequency update in two steps, update phase using average ! // frequency, after adding only half the frequency step ! const double dAmp = (targetAmp - m_instamplitude) * dTime; const double dBw = (targetBw - m_instbandwidth) * dTime; ! // Use temporary local variables for speed. ! // Probably not worth it when I am computing square roots ! // and cosines... ! double ph = m_determphase; ! double f = m_instfrequency; ! double a = m_instamplitude; ! double bw = m_instbandwidth; ! ! // Also use a more efficient sample loop when the bandwidth is zero. ! if ( 0 < bw || 0 < dBw ) { ! double am, nz; ! for ( double * putItHere = begin; putItHere != end; ++putItHere ) ! { ! // use math functions in namespace std: ! using namespace std; ! ! // compute amplitude modulation due to bandwidth: ! // ! // This will give the right amplitude modulation when scaled ! // by the Partial amplitude: ! // ! // carrier amp: sqrt( 1. - bandwidth ) * amp ! // modulation index: sqrt( 2. * bandwidth ) * amp ! // ! nz = m_filter.apply( m_modulator.sample() ); ! am = sqrt( 1. - bw ) + ( nz * sqrt( 2. * bw ) ); ! ! // compute a sample and add it into the buffer: ! *putItHere += am * a * cos( ph ); ! ! // update the instantaneous oscillator state: ! f += dFreqOver2; ! ph += f; // frequency is radians per sample ! f += dFreqOver2; ! a += dAmp; ! bw += dBw; ! if (bw < 0.) ! { ! bw = 0.; ! } ! } // end of sample computation loop ! } ! else ! { ! for ( double * putItHere = begin; putItHere != end; ++putItHere ) ! { ! // use math functions in namespace std: ! using namespace std; ! ! // no modulation when there is no bandwidth ! ! // compute a sample and add it into the buffer: ! *putItHere += a * cos( ph ); ! ! // update the instantaneous oscillator state: ! f += dFreqOver2; ! ph += f; // frequency is radians per sample ! f += dFreqOver2; ! a += dAmp; ! } // end of sample computation loop ! ! } ! ! ! // copy out of the local variables? ! // no need because we are assigning to the target ! // values below: ! /* ! m_instfrequency = f; ! m_instamplitude = a; ! m_instbandwidth = bw; ! */ // wrap phase to prevent eventual loss of precision at *************** *** 224,228 **** // (Doesn't really matter much exactly how we wrap it, // as long as it brings the phase nearer to zero.) ! m_determphase = m2pi( m_determphase ); // set the state variables to their target values, --- 266,270 ---- // (Doesn't really matter much exactly how we wrap it, // as long as it brings the phase nearer to zero.) ! m_determphase = m2pi( ph ); // set the state variables to their target values, |
|
From: Kelly F. <kf...@us...> - 2010-01-10 06:26:37
|
Update of /cvsroot/loris/Loris/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11564 Modified Files: phasefix.C Log Message: Removed some debugging code from phaseFix.C Index: phasefix.C =================================================================== RCS file: /cvsroot/loris/Loris/src/phasefix.C,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** phasefix.C 2 Jan 2010 04:55:12 -0000 1.15 --- phasefix.C 10 Jan 2010 06:26:23 -0000 1.16 *************** *** 74,96 **** // -- local helpers -- // --------------------------------------------------------------------------- ! // wrapPi ! // Wrap an unwrapped phase value to the range (-pi,pi]. // double wrapPi( double x ) { ! x = std::fmod( x, 2*Pi ); ! ! if ( x > Pi ) ! { ! x = x - ( 2*Pi ); ! } ! else if ( x < -Pi ) ! { ! x = x + ( 2*Pi ); ! } ! return x; } // --------------------------------------------------------------------------- // phaseTravel --- 74,93 ---- // -- local helpers -- + // --------------------------------------------------------------------------- ! // wrapPi ! // Wrap an unwrapped phase value to the range [-pi,pi] using ! // O'Donnell's phase wrapping function. // 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) ); } + + // --------------------------------------------------------------------------- // phaseTravel *************** *** 291,302 **** double desired = travel + deviation; - /* - debugger << "---------- fixing breakpoint frequencies over time ( " - << b.time() << " , " << e.time() << " )" << endl; - - debugger << "desired travel: " << desired << endl; - debugger << "actual travel: " << travel << endl; - */ - // Compute the amount by which to perturb the frequencies of // all the null Breakpoints between b and e. --- 288,291 ---- *************** *** 326,355 **** // Perturb the Breakpoint frequencies. - double DEBUGtravel = 0; next = b; Partial::iterator prev = next++; while ( next != e ) { - //debugger << "changing frequency from " << next.breakpoint().frequency(); next.breakpoint().setFrequency( next.breakpoint().frequency() + delta ); - //debugger << " to " << next.breakpoint().frequency() << endl; - - double newtravel = phaseTravel( prev, next ); - DEBUGtravel += newtravel; ! //debugger << "changing phase from " << wrapPi( next.breakpoint().phase() ); next.breakpoint().setPhase( wrapPi( prev.breakpoint().phase() + newtravel ) ); - //debugger << " to " << next.breakpoint().phase() << endl; prev = next++; } - DEBUGtravel += phaseTravel( prev, next ); - /* - debugger << "travel: " << DEBUGtravel << endl; - - debugger << "desired: " << e.breakpoint().phase() << endl; - debugger << "got: " << wrapPi( prev.breakpoint().phase() + phaseTravel( prev, next ) ) << endl; - debugger << "---------- done." << endl; - */ } else --- 315,329 ---- // Perturb the Breakpoint frequencies. next = b; Partial::iterator prev = next++; while ( next != e ) { next.breakpoint().setFrequency( next.breakpoint().frequency() + delta ); ! double newtravel = phaseTravel( prev, next ); next.breakpoint().setPhase( wrapPi( prev.breakpoint().phase() + newtravel ) ); prev = next++; } } else |
Update of /cvsroot/loris/Loris/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992/src Modified Files: AiffData.C AiffData.h AiffFile.C AiffFile.h Analyzer.C Analyzer.h AssociateBandwidth.C AssociateBandwidth.h BigEndian.C BigEndian.h Breakpoint.C Breakpoint.h BreakpointEnvelope.h BreakpointUtils.C BreakpointUtils.h Channelizer.C Channelizer.h Collator.C Collator.h Dilator.C Dilator.h Distiller.C Distiller.h Envelope.C Envelope.h Exception.h F0Estimate.C F0Estimate.h Filter.C Filter.h FourierTransform.C FourierTransform.h FrequencyReference.C FrequencyReference.h Fundamental.C Fundamental.h Harmonifier.C Harmonifier.h ImportLemur.C ImportLemur.h KaiserWindow.C KaiserWindow.h LinearEnvelope.C LinearEnvelope.h LorisExceptions.C LorisExceptions.h Makefile.am Marker.C Marker.h Morpher.C Morpher.h NoiseGenerator.C NoiseGenerator.h Notifier.C Notifier.h Oscillator.C Oscillator.h Partial.C Partial.h PartialBuilder.C PartialBuilder.h PartialList.h PartialPtrs.h PartialUtils.C PartialUtils.h ReassignedSpectrum.C ReassignedSpectrum.h Resampler.C Resampler.h SdifFile.C SdifFile.h Sieve.C Sieve.h SpcFile.C SpcFile.h SpectralPeakSelector.C SpectralPeakSelector.h SpectralPeaks.h SpectralSurface.C SpectralSurface.h Synthesizer.C Synthesizer.h loris.h.in lorisAnalyzer_pi.C lorisBpEnvelope_pi.C lorisException_pi.C lorisException_pi.h lorisNonObj_pi.C lorisPartialList_pi.C lorisUtilities_pi.C phasefix.C phasefix.h Log Message: updated copyright notice Index: SpectralPeaks.h =================================================================== RCS file: /cvsroot/loris/Loris/src/SpectralPeaks.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SpectralPeaks.h 14 Sep 2009 04:37:46 -0000 1.10 --- SpectralPeaks.h 2 Jan 2010 04:55:12 -0000 1.11 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisPartialList_pi.C =================================================================== RCS file: /cvsroot/loris/Loris/src/lorisPartialList_pi.C,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** lorisPartialList_pi.C 14 Jan 2009 06:17:02 -0000 1.15 --- lorisPartialList_pi.C 2 Jan 2010 04:55:12 -0000 1.16 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: LinearEnvelope.C =================================================================== RCS file: /cvsroot/loris/Loris/src/LinearEnvelope.C,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LinearEnvelope.C 14 Jan 2009 06:17:02 -0000 1.6 --- LinearEnvelope.C 2 Jan 2010 04:55:12 -0000 1.7 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: FourierTransform.h =================================================================== RCS file: /cvsroot/loris/Loris/src/FourierTransform.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** FourierTransform.h 14 Jan 2009 06:17:02 -0000 1.31 --- FourierTransform.h 2 Jan 2010 04:55:12 -0000 1.32 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: SpectralSurface.h =================================================================== RCS file: /cvsroot/loris/Loris/src/SpectralSurface.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SpectralSurface.h 14 Jan 2009 06:17:02 -0000 1.8 --- SpectralSurface.h 2 Jan 2010 04:55:12 -0000 1.9 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Marker.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Marker.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Marker.h 14 Jan 2009 06:17:02 -0000 1.10 --- Marker.h 2 Jan 2010 04:55:12 -0000 1.11 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: LinearEnvelope.h =================================================================== RCS file: /cvsroot/loris/Loris/src/LinearEnvelope.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LinearEnvelope.h 16 Sep 2009 03:53:37 -0000 1.9 --- LinearEnvelope.h 2 Jan 2010 04:55:12 -0000 1.10 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Marker.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Marker.C,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Marker.C 14 Jan 2009 06:17:02 -0000 1.8 --- Marker.C 2 Jan 2010 04:55:12 -0000 1.9 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: FourierTransform.C =================================================================== RCS file: /cvsroot/loris/Loris/src/FourierTransform.C,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** FourierTransform.C 22 Jan 2009 05:18:26 -0000 1.52 --- FourierTransform.C 2 Jan 2010 04:55:12 -0000 1.53 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Channelizer.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Channelizer.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Channelizer.h 16 Oct 2009 04:45:41 -0000 1.36 --- Channelizer.h 2 Jan 2010 04:55:12 -0000 1.37 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: KaiserWindow.h =================================================================== RCS file: /cvsroot/loris/Loris/src/KaiserWindow.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** KaiserWindow.h 14 Jan 2009 06:17:02 -0000 1.16 --- KaiserWindow.h 2 Jan 2010 04:55:12 -0000 1.17 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: phasefix.C =================================================================== RCS file: /cvsroot/loris/Loris/src/phasefix.C,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** phasefix.C 14 Jan 2009 06:17:02 -0000 1.14 --- phasefix.C 2 Jan 2010 04:55:12 -0000 1.15 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Fundamental.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Fundamental.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Fundamental.h 14 Jan 2009 06:17:02 -0000 1.11 --- Fundamental.h 2 Jan 2010 04:55:12 -0000 1.12 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Filter.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Filter.C,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Filter.C 14 Oct 2009 04:33:40 -0000 1.28 --- Filter.C 2 Jan 2010 04:55:12 -0000 1.29 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: SpectralPeakSelector.C =================================================================== RCS file: /cvsroot/loris/Loris/src/SpectralPeakSelector.C,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** SpectralPeakSelector.C 14 Sep 2009 04:37:46 -0000 1.20 --- SpectralPeakSelector.C 2 Jan 2010 04:55:12 -0000 1.21 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Filter.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Filter.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Filter.h 14 Oct 2009 04:33:40 -0000 1.26 --- Filter.h 2 Jan 2010 04:55:12 -0000 1.27 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify *************** *** 39,42 **** --- 39,43 ---- #include "Notifier.h" + #include <algorithm> #include <deque> #include <vector> Index: Fundamental.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Fundamental.C,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Fundamental.C 14 Sep 2009 04:37:46 -0000 1.18 --- Fundamental.C 2 Jan 2010 04:55:12 -0000 1.19 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: phasefix.h =================================================================== RCS file: /cvsroot/loris/Loris/src/phasefix.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** phasefix.h 14 Jan 2009 06:17:02 -0000 1.8 --- phasefix.h 2 Jan 2010 04:55:12 -0000 1.9 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Channelizer.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Channelizer.C,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Channelizer.C 16 Oct 2009 04:45:50 -0000 1.35 --- Channelizer.C 2 Jan 2010 04:55:12 -0000 1.36 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: KaiserWindow.C =================================================================== RCS file: /cvsroot/loris/Loris/src/KaiserWindow.C,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** KaiserWindow.C 14 Jan 2009 06:17:02 -0000 1.27 --- KaiserWindow.C 2 Jan 2010 04:55:12 -0000 1.28 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: SpectralPeakSelector.h =================================================================== RCS file: /cvsroot/loris/Loris/src/SpectralPeakSelector.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SpectralPeakSelector.h 14 Jan 2009 06:17:02 -0000 1.12 --- SpectralPeakSelector.h 2 Jan 2010 04:55:12 -0000 1.13 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: ReassignedSpectrum.h =================================================================== RCS file: /cvsroot/loris/Loris/src/ReassignedSpectrum.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ReassignedSpectrum.h 14 Jan 2009 06:17:02 -0000 1.37 --- ReassignedSpectrum.h 2 Jan 2010 04:55:12 -0000 1.38 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: SdifFile.h =================================================================== RCS file: /cvsroot/loris/Loris/src/SdifFile.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** SdifFile.h 14 Jan 2009 06:17:02 -0000 1.19 --- SdifFile.h 2 Jan 2010 04:55:12 -0000 1.20 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Dilator.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Dilator.C,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Dilator.C 14 Jan 2009 06:17:02 -0000 1.41 --- Dilator.C 2 Jan 2010 04:55:12 -0000 1.42 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: SpcFile.h =================================================================== RCS file: /cvsroot/loris/Loris/src/SpcFile.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** SpcFile.h 14 Jan 2009 06:17:02 -0000 1.28 --- SpcFile.h 2 Jan 2010 04:55:12 -0000 1.29 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Dilator.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Dilator.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Dilator.h 14 Jan 2009 06:17:02 -0000 1.39 --- Dilator.h 2 Jan 2010 04:55:12 -0000 1.40 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: SdifFile.C =================================================================== RCS file: /cvsroot/loris/Loris/src/SdifFile.C,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** SdifFile.C 4 Oct 2009 13:47:36 -0000 1.55 --- SdifFile.C 2 Jan 2010 04:55:12 -0000 1.56 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: ReassignedSpectrum.C =================================================================== RCS file: /cvsroot/loris/Loris/src/ReassignedSpectrum.C,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** ReassignedSpectrum.C 24 Sep 2009 04:46:26 -0000 1.75 --- ReassignedSpectrum.C 2 Jan 2010 04:55:12 -0000 1.76 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: SpcFile.C =================================================================== RCS file: /cvsroot/loris/Loris/src/SpcFile.C,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** SpcFile.C 14 Jan 2009 06:17:02 -0000 1.61 --- SpcFile.C 2 Jan 2010 04:55:12 -0000 1.62 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Distiller.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Distiller.h,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Distiller.h 14 Jan 2009 06:17:02 -0000 1.50 --- Distiller.h 2 Jan 2010 04:55:12 -0000 1.51 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Harmonifier.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Harmonifier.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Harmonifier.h 14 Jan 2009 06:17:02 -0000 1.8 --- Harmonifier.h 2 Jan 2010 04:55:12 -0000 1.9 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Collator.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Collator.C,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Collator.C 14 Jan 2009 06:17:02 -0000 1.12 --- Collator.C 2 Jan 2010 04:55:12 -0000 1.13 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: F0Estimate.C =================================================================== RCS file: /cvsroot/loris/Loris/src/F0Estimate.C,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** F0Estimate.C 14 Sep 2009 04:37:46 -0000 1.9 --- F0Estimate.C 2 Jan 2010 04:55:12 -0000 1.10 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Morpher.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Morpher.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Morpher.h 29 Sep 2009 04:51:59 -0000 1.45 --- Morpher.h 2 Jan 2010 04:55:12 -0000 1.46 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: BigEndian.h =================================================================== RCS file: /cvsroot/loris/Loris/src/BigEndian.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BigEndian.h 14 Jan 2009 06:17:02 -0000 1.4 --- BigEndian.h 2 Jan 2010 04:55:12 -0000 1.5 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Collator.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Collator.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Collator.h 14 Jan 2009 06:17:02 -0000 1.15 --- Collator.h 2 Jan 2010 04:55:12 -0000 1.16 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: BreakpointEnvelope.h =================================================================== RCS file: /cvsroot/loris/Loris/src/BreakpointEnvelope.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** BreakpointEnvelope.h 14 Jan 2009 06:17:02 -0000 1.26 --- BreakpointEnvelope.h 2 Jan 2010 04:55:12 -0000 1.27 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: PartialList.h =================================================================== RCS file: /cvsroot/loris/Loris/src/PartialList.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PartialList.h 14 Jan 2009 06:17:02 -0000 1.16 --- PartialList.h 2 Jan 2010 04:55:12 -0000 1.17 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: F0Estimate.h =================================================================== RCS file: /cvsroot/loris/Loris/src/F0Estimate.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** F0Estimate.h 14 Jan 2009 06:17:02 -0000 1.6 --- F0Estimate.h 2 Jan 2010 04:55:12 -0000 1.7 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisBpEnvelope_pi.C =================================================================== RCS file: /cvsroot/loris/Loris/src/lorisBpEnvelope_pi.C,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** lorisBpEnvelope_pi.C 14 Jan 2009 06:17:02 -0000 1.14 --- lorisBpEnvelope_pi.C 2 Jan 2010 04:55:12 -0000 1.15 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Distiller.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Distiller.C,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Distiller.C 14 Jan 2009 06:17:02 -0000 1.99 --- Distiller.C 2 Jan 2010 04:55:12 -0000 1.100 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Harmonifier.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Harmonifier.C,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Harmonifier.C 14 Jan 2009 06:17:02 -0000 1.7 --- Harmonifier.C 2 Jan 2010 04:55:12 -0000 1.8 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: BigEndian.C =================================================================== RCS file: /cvsroot/loris/Loris/src/BigEndian.C,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BigEndian.C 14 Jan 2009 06:17:02 -0000 1.4 --- BigEndian.C 2 Jan 2010 04:55:12 -0000 1.5 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Morpher.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Morpher.C,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Morpher.C 29 Sep 2009 04:51:59 -0000 1.65 --- Morpher.C 2 Jan 2010 04:55:12 -0000 1.66 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Exception.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Exception.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Exception.h 14 Jan 2009 06:17:02 -0000 1.28 --- Exception.h 2 Jan 2010 04:55:12 -0000 1.29 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: AssociateBandwidth.h =================================================================== RCS file: /cvsroot/loris/Loris/src/AssociateBandwidth.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** AssociateBandwidth.h 14 Sep 2009 04:34:49 -0000 1.33 --- AssociateBandwidth.h 2 Jan 2010 04:55:12 -0000 1.34 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: LorisExceptions.h =================================================================== RCS file: /cvsroot/loris/Loris/src/LorisExceptions.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LorisExceptions.h 14 Jan 2009 06:17:02 -0000 1.4 --- LorisExceptions.h 2 Jan 2010 04:55:12 -0000 1.5 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: PartialBuilder.h =================================================================== RCS file: /cvsroot/loris/Loris/src/PartialBuilder.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PartialBuilder.h 14 Sep 2009 04:37:46 -0000 1.10 --- PartialBuilder.h 2 Jan 2010 04:55:12 -0000 1.11 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: PartialBuilder.C =================================================================== RCS file: /cvsroot/loris/Loris/src/PartialBuilder.C,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PartialBuilder.C 24 Sep 2009 04:46:26 -0000 1.13 --- PartialBuilder.C 2 Jan 2010 04:55:12 -0000 1.14 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: AssociateBandwidth.C =================================================================== RCS file: /cvsroot/loris/Loris/src/AssociateBandwidth.C,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** AssociateBandwidth.C 14 Sep 2009 04:34:49 -0000 1.51 --- AssociateBandwidth.C 2 Jan 2010 04:55:12 -0000 1.52 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Resampler.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Resampler.C,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Resampler.C 14 Jan 2009 06:17:02 -0000 1.19 --- Resampler.C 2 Jan 2010 04:55:12 -0000 1.20 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify *************** *** 101,105 **** // --------------------------------------------------------------------------- ! // resample // --------------------------------------------------------------------------- //! Specify phase-corrected resampling, or not. If phase --- 101,105 ---- // --------------------------------------------------------------------------- ! // setPhaseCorrect // --------------------------------------------------------------------------- //! Specify phase-corrected resampling, or not. If phase Index: LorisExceptions.C =================================================================== RCS file: /cvsroot/loris/Loris/src/LorisExceptions.C,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LorisExceptions.C 14 Jan 2009 06:17:02 -0000 1.4 --- LorisExceptions.C 2 Jan 2010 04:55:12 -0000 1.5 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: PartialUtils.h =================================================================== RCS file: /cvsroot/loris/Loris/src/PartialUtils.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** PartialUtils.h 14 Sep 2009 04:37:46 -0000 1.32 --- PartialUtils.h 2 Jan 2010 04:55:12 -0000 1.33 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: AiffFile.h =================================================================== RCS file: /cvsroot/loris/Loris/src/AiffFile.h,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** AiffFile.h 9 Nov 2009 04:53:08 -0000 1.44 --- AiffFile.h 2 Jan 2010 04:55:12 -0000 1.45 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: ImportLemur.h =================================================================== RCS file: /cvsroot/loris/Loris/src/ImportLemur.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ImportLemur.h 14 Jan 2009 06:17:02 -0000 1.17 --- ImportLemur.h 2 Jan 2010 04:55:12 -0000 1.18 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisUtilities_pi.C =================================================================== RCS file: /cvsroot/loris/Loris/src/lorisUtilities_pi.C,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** lorisUtilities_pi.C 24 Sep 2009 04:46:26 -0000 1.37 --- lorisUtilities_pi.C 2 Jan 2010 04:55:12 -0000 1.38 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Notifier.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Notifier.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Notifier.h 14 Jan 2009 06:17:02 -0000 1.27 --- Notifier.h 2 Jan 2010 04:55:12 -0000 1.28 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: PartialUtils.C =================================================================== RCS file: /cvsroot/loris/Loris/src/PartialUtils.C,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PartialUtils.C 14 Jan 2009 06:17:02 -0000 1.16 --- PartialUtils.C 2 Jan 2010 04:55:12 -0000 1.17 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: ImportLemur.C =================================================================== RCS file: /cvsroot/loris/Loris/src/ImportLemur.C,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ImportLemur.C 14 Jan 2009 06:17:02 -0000 1.24 --- ImportLemur.C 2 Jan 2010 04:55:12 -0000 1.25 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: AiffFile.C =================================================================== RCS file: /cvsroot/loris/Loris/src/AiffFile.C,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** AiffFile.C 9 Nov 2009 04:53:08 -0000 1.70 --- AiffFile.C 2 Jan 2010 04:55:12 -0000 1.71 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: NoiseGenerator.C =================================================================== RCS file: /cvsroot/loris/Loris/src/NoiseGenerator.C,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NoiseGenerator.C 12 Oct 2009 04:35:27 -0000 1.10 --- NoiseGenerator.C 2 Jan 2010 04:55:12 -0000 1.11 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Breakpoint.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Breakpoint.C,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Breakpoint.C 14 Sep 2009 04:37:46 -0000 1.37 --- Breakpoint.C 2 Jan 2010 04:55:12 -0000 1.38 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: loris.h.in =================================================================== RCS file: /cvsroot/loris/Loris/src/loris.h.in,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** loris.h.in 14 Jan 2009 06:17:02 -0000 1.47 --- loris.h.in 2 Jan 2010 04:55:12 -0000 1.48 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Envelope.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Envelope.C,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Envelope.C 14 Jan 2009 06:17:02 -0000 1.15 --- Envelope.C 2 Jan 2010 04:55:12 -0000 1.16 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Oscillator.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Oscillator.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Oscillator.h 22 Oct 2009 03:54:47 -0000 1.37 --- Oscillator.h 2 Jan 2010 04:55:12 -0000 1.38 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: BreakpointUtils.h =================================================================== RCS file: /cvsroot/loris/Loris/src/BreakpointUtils.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** BreakpointUtils.h 14 Jan 2009 06:17:02 -0000 1.21 --- BreakpointUtils.h 2 Jan 2010 04:55:12 -0000 1.22 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: PartialPtrs.h =================================================================== RCS file: /cvsroot/loris/Loris/src/PartialPtrs.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PartialPtrs.h 14 Jan 2009 06:17:02 -0000 1.9 --- PartialPtrs.h 2 Jan 2010 04:55:12 -0000 1.10 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisException_pi.h =================================================================== RCS file: /cvsroot/loris/Loris/src/lorisException_pi.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** lorisException_pi.h 14 Jan 2009 06:17:02 -0000 1.10 --- lorisException_pi.h 2 Jan 2010 04:55:12 -0000 1.11 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Envelope.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Envelope.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Envelope.h 14 Jan 2009 06:17:02 -0000 1.21 --- Envelope.h 2 Jan 2010 04:55:12 -0000 1.22 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: NoiseGenerator.h =================================================================== RCS file: /cvsroot/loris/Loris/src/NoiseGenerator.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NoiseGenerator.h 12 Oct 2009 04:35:27 -0000 1.9 --- NoiseGenerator.h 2 Jan 2010 04:55:12 -0000 1.10 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Breakpoint.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Breakpoint.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Breakpoint.h 14 Jan 2009 06:17:02 -0000 1.31 --- Breakpoint.h 2 Jan 2010 04:55:12 -0000 1.32 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Makefile.am =================================================================== RCS file: /cvsroot/loris/Loris/src/Makefile.am,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Makefile.am 6 Oct 2009 04:48:03 -0000 1.57 --- Makefile.am 2 Jan 2010 04:55:12 -0000 1.58 *************** *** 1,3 **** ! # Copyright (c) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,4 ---- ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> # # This file is free software; as a special exception the author gives Index: lorisException_pi.C =================================================================== RCS file: /cvsroot/loris/Loris/src/lorisException_pi.C,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** lorisException_pi.C 14 Jan 2009 06:17:02 -0000 1.10 --- lorisException_pi.C 2 Jan 2010 04:55:12 -0000 1.11 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: BreakpointUtils.C =================================================================== RCS file: /cvsroot/loris/Loris/src/BreakpointUtils.C,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BreakpointUtils.C 14 Jan 2009 06:17:02 -0000 1.12 --- BreakpointUtils.C 2 Jan 2010 04:55:12 -0000 1.13 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Resampler.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Resampler.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Resampler.h 14 Jan 2009 06:17:02 -0000 1.12 --- Resampler.h 2 Jan 2010 04:55:12 -0000 1.13 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Oscillator.C =================================================================== RCS file: /cvsroot/loris/Loris/src/Oscillator.C,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Oscillator.C 22 Oct 2009 03:54:47 -0000 1.52 --- Oscillator.C 2 Jan 2010 04:55:12 -0000 1.53 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Synthesizer.h =================================================================== RCS file: /cvsroot/loris/Loris/src/Synthesizer.h,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Synthesizer.h 5 Nov 2009 05:34:56 -0000 1.49 --- Synthesizer.h 2 Jan 2010 04:55:12 -0000 1.50 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Notifier.C ==================================================... [truncated message content] |
|
From: Kelly F. <kf...@us...> - 2010-01-02 04:55:37
|
Update of /cvsroot/loris/Loris/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992/test Modified Files: Makefile.am morphtest.C morphtest.py morphtest.tcl pitest.c test_Distiller.C test_Filter.C test_Fundamental.C test_Identity.C test_Morpher.C test_Partial.C test_SdifFile.C Log Message: updated copyright notice Index: test_SdifFile.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_SdifFile.C,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_SdifFile.C 16 Jan 2009 03:37:00 -0000 1.11 --- test_SdifFile.C 2 Jan 2010 04:55:12 -0000 1.12 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: pitest.c =================================================================== RCS file: /cvsroot/loris/Loris/test/pitest.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pitest.c 16 Jan 2009 03:37:00 -0000 1.12 --- pitest.c 2 Jan 2010 04:55:12 -0000 1.13 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: test_Filter.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Filter.C,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_Filter.C 16 Oct 2009 04:48:23 -0000 1.2 --- test_Filter.C 2 Jan 2010 04:55:12 -0000 1.3 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: morphtest.tcl =================================================================== RCS file: /cvsroot/loris/Loris/test/morphtest.tcl,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** morphtest.tcl 16 Jan 2009 03:37:00 -0000 1.18 --- morphtest.tcl 2 Jan 2010 04:55:12 -0000 1.19 *************** *** 5,9 **** # Bandwidth-Enhanced Additive Sound Model. # ! # Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken # # This program is free software; you can redistribute it and/or modify --- 5,9 ---- # Bandwidth-Enhanced Additive Sound Model. # ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken # # This program is free software; you can redistribute it and/or modify Index: test_Identity.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Identity.C,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_Identity.C 16 Jan 2009 03:37:00 -0000 1.7 --- test_Identity.C 2 Jan 2010 04:55:12 -0000 1.8 *************** *** 1 **** ! /* * This is the Loris C++ Class Library, implementing analysis, * manipulation, and synthesis of digitized sounds using the Reassigned * Bandwidth-Enhanced Additive Sound Model. * * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * test_Identity.C * * Verify that Loris synthesis/analysis is an (nearly) identity * process. Analysis of samples rendered from synthetic Partials * should yield Partials very much like the originals. * The accuracy of the analysis will, of course, depend on the * Analyzer parameters. The ones chosen here should easily pass the * tests given. * * Kelly Fitz, 8 Dec 2004 * lo...@ce... * * http://www.cerlsoundgroup.org/Loris/ * */ #include <algorithm> #include <cmath> #include <iostream> #include <iomanip> #include "Analyzer.h" #include "Breakpoint.h" #include "Channelizer.h" #include "Distiller.h" #include "FrequencyReference.h" #include "Partial.h" #include "PartialList.h" #include "Synthesizer.h" using namespace std; using namespace Loris; const double pi = 3.14159265358979324; // tacky global error variable int ERR = 0; // --- helpers --- // It takes some kludging around to make sure that // phases near 2pi are wrapped down near zero. inline double mpi( double x ) { const double EPS = .01; x += EPS; x = fmod( x, 2*pi ); if ( x < 0 ) x = x + (2*pi); return x - EPS; } inline double env( double tau ) { double t = 2*(tau-.4); return (.1+.3*exp( - pi * t * t ))*min( 500*tau, 1.0 ); } static void float_rel_equal( double x, double y, double pct ) { #ifdef VERBOSE cout << "\t" << x << " == " << y << " ?" << endl; #endif double eps = 0; if ( x != 0. ) { eps = pct * std::fabs(x); } if ( std::fabs(x-y) > eps ) { cout << "\t" << x << " != " << y << " within " << pct*100 << "%" << endl; ERR = 1; } } static void float_abs_equal( double x, double y, double eps ) { #ifdef VERBOSE cout << "\t" << x << " == " << y << " ?" << endl; #endif if ( std::fabs(x-y) > eps ) { cout << "\t" << x << " != " << y << " within " << eps << endl; ERR = 1; } } // ----------- one_partial ----------- // static void one_partial( void ) { cout << "Single-partial analysis/synthesis identity check." << endl; // make a partial with // slowly-varying frequency Partial p1; p1.insert( .1, Breakpoint( 375, .2, 0, 0 ) ); p1.insert( .85, Breakpoint( 425, .2, 0, 0 ) ); p1.insert( .85235, Breakpoint( 426.06, 0, 0, 0 ) ); p1.insert( .899, Breakpoint( 500, 0, 0, pi ) ); p1.insert( .9, Breakpoint( 500, .3, 0, 0 ) ); p1.insert( 1.1, Breakpoint( 520, .3, 0, 0 ) ); PartialList fake; fake.push_back( p1 ); // synthesize the fake partial vector< double > v; Synthesizer synth( 44100, v ); synth.synthesize( fake.begin(), fake.end() ); // analyze the synthesized partial Analyzer anal( 300, 400 ); anal.setAmpFloor( -50 ); anal.setBwRegionWidth( 0 ); cout << "Using analysis window width " << anal.windowWidth() << " Hz" << endl; anal.analyze( v, 44100 ); PartialList & partials = anal.partials(); // need to distill, because the fake partial fades out // and back in again FrequencyReference ref( fake.begin(), fake.end(), 300, 600, 100 ); Channelizer chan( ref, 1 ); chan.channelize( partials.begin(), partials.end() ); Distiller still( 0.001, 0.001 ); // use 1 ms fade time for these tests still.distill( partials ); if ( partials.size() != 1 ) { cout << "ERROR: should find only one Partial" << endl; ERR = 2; return; } Partial a1 = partials.front(); // compare parameters of the original and analyzed partials iostream::fmtflags flags = cout.flags(); fixed( cout ); streamsize prec = cout.precision(); cout << setprecision(3); cout << "START TIMES (p1 a1) (testing within 3ms)" << endl; cout << p1.startTime() << " " << a1.startTime() << endl; float_abs_equal( p1.startTime(), a1.startTime(), 0.003 ); cout << "END TIMES (p1 a1) (testing within 3ms)" << endl; cout << p1.endTime() << " " << a1.endTime() << endl; float_abs_equal( p1.endTime(), a1.endTime(), 0.003 ); cout << "AMPLITUDES (time p1 a1) (testing within 2%)" << endl; const double dt = 0.042; double t = p1.startTime() + dt; while ( t <= p1.endTime() ) { cout << t << "\t" << p1.amplitudeAt(t, 0.01) << " " << a1.amplitudeAt(t,0.01) << endl; float_rel_equal( p1.amplitudeAt(t, 0.01), a1.amplitudeAt(t,0.01), 0.02 ); t = t + dt; } cout << "FREQUENCIES (time p1 a1) (testing within 0.1 Hz)" << endl; t = p1.startTime() + dt; while ( t <= p1.endTime() ) { if ( p1.amplitudeAt(t) > 0 ) { cout << t << "\t" << p1.frequencyAt(t) << " " << a1.frequencyAt(t) << endl; float_abs_equal( p1.frequencyAt(t), a1.frequencyAt(t), 0.1 ); } t = t + dt; } cout << "PHASES / pi (time p1 a1) (testing within 1% of pi)" << endl; t = p1.startTime() + dt; while ( t <= p1.endTime() ) { if ( p1.amplitudeAt(t) > 0 ) { cout << t << "\t" << mpi(p1.phaseAt(t))/pi << " " << mpi(a1.phaseAt(t))/pi << endl; float_abs_equal( mpi(p1.phaseAt(t))/pi, mpi(a1.phaseAt(t))/pi, 0.01*pi ); } t = t + dt; } cout << setprecision(prec); cout.flags( flags ); cout << "Done." << endl; } // ----------- two_partials ----------- // // Note: it takes some planning to ensure that the evaluation // times do not coincide with the beginning and end of either // Partial. Abrupt turn-on and turn-off always corrupt the // frequency and phase estimates at the ends of Partials, so // there is no point in testing the parameters very near the ends. // static void two_partials( void ) { cout << "Two-partial analysis/synthesis identity check." << endl; // make a constant-amplitude partial with // slowly-varying frequency Partial p1; p1.insert( .1, Breakpoint( 375, .2, 0, 0 ) ); p1.insert( .875, Breakpoint( 425, .2, 0, 0 ) ); // make another Partial with fancier envelopes Partial p2; double f = 1000; double phi = 0; double t = 0; p2.insert( t + .225, Breakpoint( f, env( t ), 0, phi ) ); double dt = 0.05; while ( t <= .75 ) { double fprev = f; f = f + (dt * 300); // - (env( t ) * 100) // reassignment does chirps really, really well, // add this extra perturbation to mix things up // a little -- still matches frequencies within // .1 Hz most of the time. double favg = .5 * (f + fprev); phi = phi + (2 * pi * favg * dt); t = t + dt; p2.insert( t + .225, Breakpoint( f, env( t ), 0, phi ) ); } PartialList fake; fake.push_back( p1 ); fake.push_back( p2 ); // synthesize the fake partial vector< double > v; Synthesizer synth( 44100, v ); synth.synthesize( fake.begin(), fake.end() ); // analyze the synthesized partial Analyzer anal( 300, 400 ); anal.setAmpFloor( -50 ); anal.setBwRegionWidth( 0 ); cout << "Using analysis window width " << anal.windowWidth() << " Hz" << endl; anal.analyze( v, 44100 ); PartialList & partials = anal.partials(); /* // no need to distill, these partials should pop right out // of the analysis FrequencyReference ref( fake.begin(), fake.end(), 300, 600, 100 ); Channelizer chan( ref, 1 ); chan.channelize( partials.begin(), partials.end() ); Distiller still; still.distill( partials ); */ if ( partials.size() != 2 ) { cout << "ERROR: should find only two Partials" << endl; ERR = 2; return; } Partial a1 = partials.front(); Partial a2 = partials.back(); // compare parameters of the original and analyzed partials iostream::fmtflags flags = cout.flags(); fixed( cout ); streamsize prec = cout.precision(); cout << setprecision(3); double hop = anal.hopTime() * 2; // turns on too fast for 2.5 ms cout << "START TIMES (p1 a1 p2 a2) (testing within " << hop*1000 << "ms)" << endl; cout << p1.startTime() << " " << a1.startTime() << "\t" << p2.startTime() << " " << a2.startTime() << endl; float_abs_equal( p1.startTime(), a1.startTime(), hop ); float_abs_equal( p2.startTime(), a2.startTime(), hop ); cout << "END TIMES (p1 a1 p2 a2) (testing within " << hop*1000 << "ms)" << endl; cout << p1.endTime() << " " << a1.endTime() << "\t" << p2.endTime() << " " << a2.endTime() << endl; float_abs_equal( p1.endTime(), a1.endTime(), hop ); float_abs_equal( p2.endTime(), a2.endTime(), hop ); const double tmin = min( p1.startTime(), p2.startTime() ); const double tmax = max( p1.endTime(), p2.endTime() ); cout << "AMPLITUDES (time p1 a1 p2 a2) (testing within 2%)" << endl; dt = 0.05; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t" << p1.amplitudeAt(t, 0.01) << " " << a1.amplitudeAt(t,0.01) << "\t" << p2.amplitudeAt(t, 0.01) << " " << a2.amplitudeAt(t,0.01) << endl; float_rel_equal( p1.amplitudeAt(t, 0.01), a1.amplitudeAt(t,0.01), 0.02 ); float_rel_equal( p2.amplitudeAt(t, 0.01), a2.amplitudeAt(t,0.01), 0.02 ); t = t + dt; } cout << "FREQUENCIES (time p1 a1 p2 a2) (testing within 0.1 Hz)" << endl; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t"; if ( p1.amplitudeAt(t) > 0 ) { cout << p1.frequencyAt(t) << " " << a1.frequencyAt(t) << "\t"; float_abs_equal( p1.frequencyAt(t), a1.frequencyAt(t), 0.1 ); } else { cout << "\t\t\t"; } if ( p2.amplitudeAt(t) > 0 ) { cout << p2.frequencyAt(t) << " " << a2.frequencyAt(t); float_abs_equal( p2.frequencyAt(t), a2.frequencyAt(t), 0.1 ); } cout << endl; t = t + dt; } cout << "PHASES / pi (time p1 a1) (testing within 1% of pi)" << endl; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t"; if ( p1.amplitudeAt(t) > 0 ) { cout << mpi(p1.phaseAt(t))/pi << " " << mpi(a1.phaseAt(t))/pi << "\t"; float_abs_equal( mpi(p1.phaseAt(t))/pi, mpi(a1.phaseAt(t))/pi, 0.01*pi ); } else { cout << "\t\t"; } if ( p2.amplitudeAt(t) > 0 ) { cout << mpi(p2.phaseAt(t))/pi << " " << mpi(a2.phaseAt(t))/pi; float_abs_equal( mpi(p2.phaseAt(t))/pi, mpi(a2.phaseAt(t))/pi, 0.01*pi ); } cout << endl; t = t + dt; } cout << setprecision(prec); cout.flags( flags ); cout << "Done." << endl; } // ----------- main ----------- // int main( void ) { std::cout << "Identity test for Loris analysis and synthesis." << endl; std::cout << "Renders synthetic Partials, analyzes the samples," << endl; std::cout << "and compares the analyzed Partials to the originals." << endl << endl; std::cout << "Built: " << __DATE__ << endl << endl; try { one_partial(); two_partials(); } catch( Exception & ex ) { cout << "Caught Loris exception: " << ex.what() << endl; return 1; } catch( std::exception & ex ) { cout << "Caught std C++ exception: " << ex.what() << endl; return 1; } if ( 0 == ERR ) { cout << "Passed identity tests." << endl; } else { cout << "FAILED identity tests." << endl; } return ERR; } \ No newline at end of file --- 1 ---- ! /* * This is the Loris C++ Class Library, implementing analysis, * manipulation, and synthesis of digitized sounds using the Reassigned * Bandwidth-Enhanced Additive Sound Model. * * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * test_Identity.C * * Verify that Loris synthesis/analysis is an (nearly) identity * process. Analysis of samples rendered from synthetic Partials * should yield Partials very much like the originals. * The accuracy of the analysis will, of course, depend on the * Analyzer parameters. The ones chosen here should easily pass the * tests given. * * Kelly Fitz, 8 Dec 2004 * lo...@ce... * * http://www.cerlsoundgroup.org/Loris/ * */ #include <algorithm> #include <cmath> #include <iostream> #include <iomanip> #include "Analyzer.h" #include "Breakpoint.h" #include "Channelizer.h" #include "Distiller.h" #include "FrequencyReference.h" #include "Partial.h" #include "PartialList.h" #include "Synthesizer.h" using namespace std; using namespace Loris; const double pi = 3.14159265358979324; // tacky global error variable int ERR = 0; // --- helpers --- // It takes some kludging around to make sure that // phases near 2pi are wrapped down near zero. inline double mpi( double x ) { const double EPS = .01; x += EPS; x = fmod( x, 2*pi ); if ( x < 0 ) x = x + (2*pi); return x - EPS; } inline double env( double tau ) { double t = 2*(tau-.4); return (.1+.3*exp( - pi * t * t ))*min( 500*tau, 1.0 ); } static void float_rel_equal( double x, double y, double pct ) { #ifdef VERBOSE cout << "\t" << x << " == " << y << " ?" << endl; #endif double eps = 0; if ( x != 0. ) { eps = pct * std::fabs(x); } if ( std::fabs(x-y) > eps ) { cout << "\t" << x << " != " << y << " within " << pct*100 << "%" << endl; ERR = 1; } } static void float_abs_equal( double x, double y, double eps ) { #ifdef VERBOSE cout << "\t" << x << " == " << y << " ?" << endl; #endif if ( std::fabs(x-y) > eps ) { cout << "\t" << x << " != " << y << " within " << eps << endl; ERR = 1; } } // ----------- one_partial ----------- // static void one_partial( void ) { cout << "Single-partial analysis/synthesis identity check." << endl; // make a partial with // slowly-varying frequency Partial p1; p1.insert( .1, Breakpoint( 375, .2, 0, 0 ) ); p1.insert( .85, Breakpoint( 425, .2, 0, 0 ) ); p1.insert( .85235, Breakpoint( 426.06, 0, 0, 0 ) ); p1.insert( .899, Breakpoint( 500, 0, 0, pi ) ); p1.insert( .9, Breakpoint( 500, .3, 0, 0 ) ); p1.insert( 1.1, Breakpoint( 520, .3, 0, 0 ) ); PartialList fake; fake.push_back( p1 ); // synthesize the fake partial vector< double > v; Synthesizer synth( 44100, v ); synth.synthesize( fake.begin(), fake.end() ); // analyze the synthesized partial Analyzer anal( 300, 400 ); anal.setAmpFloor( -50 ); anal.setBwRegionWidth( 0 ); cout << "Using analysis window width " << anal.windowWidth() << " Hz" << endl; anal.analyze( v, 44100 ); PartialList & partials = anal.partials(); // need to distill, because the fake partial fades out // and back in again FrequencyReference ref( fake.begin(), fake.end(), 300, 600, 100 ); Channelizer chan( ref, 1 ); chan.channelize( partials.begin(), partials.end() ); Distiller still( 0.001, 0.001 ); // use 1 ms fade time for these tests still.distill( partials ); if ( partials.size() != 1 ) { cout << "ERROR: should find only one Partial" << endl; ERR = 2; return; } Partial a1 = partials.front(); // compare parameters of the original and analyzed partials iostream::fmtflags flags = cout.flags(); fixed( cout ); streamsize prec = cout.precision(); cout << setprecision(3); cout << "START TIMES (p1 a1) (testing within 3ms)" << endl; cout << p1.startTime() << " " << a1.startTime() << endl; float_abs_equal( p1.startTime(), a1.startTime(), 0.003 ); cout << "END TIMES (p1 a1) (testing within 3ms)" << endl; cout << p1.endTime() << " " << a1.endTime() << endl; float_abs_equal( p1.endTime(), a1.endTime(), 0.003 ); cout << "AMPLITUDES (time p1 a1) (testing within 2%)" << endl; const double dt = 0.042; double t = p1.startTime() + dt; while ( t <= p1.endTime() ) { cout << t << "\t" << p1.amplitudeAt(t, 0.01) << " " << a1.amplitudeAt(t,0.01) << endl; float_rel_equal( p1.amplitudeAt(t, 0.01), a1.amplitudeAt(t,0.01), 0.02 ); t = t + dt; } cout << "FREQUENCIES (time p1 a1) (testing within 0.1 Hz)" << endl; t = p1.startTime() + dt; while ( t <= p1.endTime() ) { if ( p1.amplitudeAt(t) > 0 ) { cout << t << "\t" << p1.frequencyAt(t) << " " << a1.frequencyAt(t) << endl; float_abs_equal( p1.frequencyAt(t), a1.frequencyAt(t), 0.1 ); } t = t + dt; } cout << "PHASES / pi (time p1 a1) (testing within 1% of pi)" << endl; t = p1.startTime() + dt; while ( t <= p1.endTime() ) { if ( p1.amplitudeAt(t) > 0 ) { cout << t << "\t" << mpi(p1.phaseAt(t))/pi << " " << mpi(a1.phaseAt(t))/pi << endl; float_abs_equal( mpi(p1.phaseAt(t))/pi, mpi(a1.phaseAt(t))/pi, 0.01*pi ); } t = t + dt; } cout << setprecision(prec); cout.flags( flags ); cout << "Done." << endl; } // ----------- two_partials ----------- // // Note: it takes some planning to ensure that the evaluation // times do not coincide with the beginning and end of either // Partial. Abrupt turn-on and turn-off always corrupt the // frequency and phase estimates at the ends of Partials, so // there is no point in testing the parameters very near the ends. // static void two_partials( void ) { cout << "Two-partial analysis/synthesis identity check." << endl; // make a constant-amplitude partial with // slowly-varying frequency Partial p1; p1.insert( .1, Breakpoint( 375, .2, 0, 0 ) ); p1.insert( .875, Breakpoint( 425, .2, 0, 0 ) ); // make another Partial with fancier envelopes Partial p2; double f = 1000; double phi = 0; double t = 0; p2.insert( t + .225, Breakpoint( f, env( t ), 0, phi ) ); double dt = 0.05; while ( t <= .75 ) { double fprev = f; f = f + (dt * 300); // - (env( t ) * 100) // reassignment does chirps really, really well, // add this extra perturbation to mix things up // a little -- still matches frequencies within // .1 Hz most of the time. double favg = .5 * (f + fprev); phi = phi + (2 * pi * favg * dt); t = t + dt; p2.insert( t + .225, Breakpoint( f, env( t ), 0, phi ) ); } PartialList fake; fake.push_back( p1 ); fake.push_back( p2 ); // synthesize the fake partial vector< double > v; Synthesizer synth( 44100, v ); synth.synthesize( fake.begin(), fake.end() ); // analyze the synthesized partial Analyzer anal( 300, 400 ); anal.setAmpFloor( -50 ); anal.setBwRegionWidth( 0 ); cout << "Using analysis window width " << anal.windowWidth() << " Hz" << endl; anal.analyze( v, 44100 ); PartialList & partials = anal.partials(); /* // no need to distill, these partials should pop right out // of the analysis FrequencyReference ref( fake.begin(), fake.end(), 300, 600, 100 ); Channelizer chan( ref, 1 ); chan.channelize( partials.begin(), partials.end() ); Distiller still; still.distill( partials ); */ if ( partials.size() != 2 ) { cout << "ERROR: should find only two Partials" << endl; ERR = 2; return; } Partial a1 = partials.front(); Partial a2 = partials.back(); // compare parameters of the original and analyzed partials iostream::fmtflags flags = cout.flags(); fixed( cout ); streamsize prec = cout.precision(); cout << setprecision(3); double hop = anal.hopTime() * 2; // turns on too fast for 2.5 ms cout << "START TIMES (p1 a1 p2 a2) (testing within " << hop*1000 << "ms)" << endl; cout << p1.startTime() << " " << a1.startTime() << "\t" << p2.startTime() << " " << a2.startTime() << endl; float_abs_equal( p1.startTime(), a1.startTime(), hop ); float_abs_equal( p2.startTime(), a2.startTime(), hop ); cout << "END TIMES (p1 a1 p2 a2) (testing within " << hop*1000 << "ms)" << endl; cout << p1.endTime() << " " << a1.endTime() << "\t" << p2.endTime() << " " << a2.endTime() << endl; float_abs_equal( p1.endTime(), a1.endTime(), hop ); float_abs_equal( p2.endTime(), a2.endTime(), hop ); const double tmin = min( p1.startTime(), p2.startTime() ); const double tmax = max( p1.endTime(), p2.endTime() ); cout << "AMPLITUDES (time p1 a1 p2 a2) (testing within 2%)" << endl; dt = 0.05; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t" << p1.amplitudeAt(t, 0.01) << " " << a1.amplitudeAt(t,0.01) << "\t" << p2.amplitudeAt(t, 0.01) << " " << a2.amplitudeAt(t,0.01) << endl; float_rel_equal( p1.amplitudeAt(t, 0.01), a1.amplitudeAt(t,0.01), 0.02 ); float_rel_equal( p2.amplitudeAt(t, 0.01), a2.amplitudeAt(t,0.01), 0.02 ); t = t + dt; } cout << "FREQUENCIES (time p1 a1 p2 a2) (testing within 0.1 Hz)" << endl; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t"; if ( p1.amplitudeAt(t) > 0 ) { cout << p1.frequencyAt(t) << " " << a1.frequencyAt(t) << "\t"; float_abs_equal( p1.frequencyAt(t), a1.frequencyAt(t), 0.1 ); } else { cout << "\t\t\t"; } if ( p2.amplitudeAt(t) > 0 ) { cout << p2.frequencyAt(t) << " " << a2.frequencyAt(t); float_abs_equal( p2.frequencyAt(t), a2.frequencyAt(t), 0.1 ); } cout << endl; t = t + dt; } cout << "PHASES / pi (time p1 a1) (testing within 1% of pi)" << endl; t = tmin + dt; while ( t < tmax - dt ) { cout << t << "\t"; if ( p1.amplitudeAt(t) > 0 ) { cout << mpi(p1.phaseAt(t))/pi << " " << mpi(a1.phaseAt(t))/pi << "\t"; float_abs_equal( mpi(p1.phaseAt(t))/pi, mpi(a1.phaseAt(t))/pi, 0.01*pi ); } else { cout << "\t\t"; } if ( p2.amplitudeAt(t) > 0 ) { cout << mpi(p2.phaseAt(t))/pi << " " << mpi(a2.phaseAt(t))/pi; float_abs_equal( mpi(p2.phaseAt(t))/pi, mpi(a2.phaseAt(t))/pi, 0.01*pi ); } cout << endl; t = t + dt; } cout << setprecision(prec); cout.flags( flags ); cout << "Done." << endl; } // ----------- main ----------- // int main( void ) { std::cout << "Identity test for Loris analysis and synthesis." << endl; std::cout << "Renders synthetic Partials, analyzes the samples," << endl; std::cout << "and compares the analyzed Partials to the originals." << endl << endl; std::cout << "Built: " << __DATE__ << endl << endl; try { one_partial(); two_partials(); } catch( Exception & ex ) { cout << "Caught Loris exception: " << ex.what() << endl; return 1; } catch( std::exception & ex ) { cout << "Caught std C++ exception: " << ex.what() << endl; return 1; } if ( 0 == ERR ) { cout << "Passed identity tests." << endl; } else { cout << "FAILED identity tests." << endl; } return ERR; } \ No newline at end of file Index: Makefile.am =================================================================== RCS file: /cvsroot/loris/Loris/test/Makefile.am,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Makefile.am 11 Oct 2009 05:12:30 -0000 1.42 --- Makefile.am 2 Jan 2010 04:55:12 -0000 1.43 *************** *** 1,3 **** ! # Copyright (c) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,4 ---- ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> # # This file is free software; as a special exception the author gives Index: morphtest.py =================================================================== RCS file: /cvsroot/loris/Loris/test/morphtest.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** morphtest.py 6 Oct 2009 03:56:49 -0000 1.39 --- morphtest.py 2 Jan 2010 04:55:12 -0000 1.40 *************** *** 5,9 **** # Bandwidth-Enhanced Additive Sound Model. # ! # Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken # # This program is free software; you can redistribute it and/or modify --- 5,9 ---- # Bandwidth-Enhanced Additive Sound Model. # ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken # # This program is free software; you can redistribute it and/or modify Index: test_Fundamental.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Fundamental.C,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_Fundamental.C 16 Jan 2009 03:37:00 -0000 1.2 --- test_Fundamental.C 2 Jan 2010 04:55:12 -0000 1.3 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: morphtest.C =================================================================== RCS file: /cvsroot/loris/Loris/test/morphtest.C,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** morphtest.C 16 Oct 2009 04:48:23 -0000 1.38 --- morphtest.C 2 Jan 2010 04:55:12 -0000 1.39 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: test_Morpher.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Morpher.C,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** test_Morpher.C 29 Sep 2009 04:51:59 -0000 1.24 --- test_Morpher.C 2 Jan 2010 04:55:12 -0000 1.25 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: test_Distiller.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Distiller.C,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test_Distiller.C 16 Jan 2009 03:37:00 -0000 1.19 --- test_Distiller.C 2 Jan 2010 04:55:12 -0000 1.20 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: test_Partial.C =================================================================== RCS file: /cvsroot/loris/Loris/test/test_Partial.C,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_Partial.C 16 Jan 2009 03:37:00 -0000 1.14 --- test_Partial.C 2 Jan 2010 04:55:12 -0000 1.15 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify |
Update of /cvsroot/loris/Loris/utils In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992/utils Modified Files: Makefile.am loris_analyze.C loris_dilate.C loris_mark.C loris_spewmarkers.C loris_synthesize.C loris_unmark.C Log Message: updated copyright notice Index: loris_unmark.C =================================================================== RCS file: /cvsroot/loris/Loris/utils/loris_unmark.C,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** loris_unmark.C 16 Jan 2009 03:37:00 -0000 1.6 --- loris_unmark.C 2 Jan 2010 04:55:12 -0000 1.7 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: loris_synthesize.C =================================================================== RCS file: /cvsroot/loris/Loris/utils/loris_synthesize.C,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** loris_synthesize.C 16 Jan 2009 03:37:00 -0000 1.10 --- loris_synthesize.C 2 Jan 2010 04:55:12 -0000 1.11 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: loris_mark.C =================================================================== RCS file: /cvsroot/loris/Loris/utils/loris_mark.C,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** loris_mark.C 16 Jan 2009 03:37:00 -0000 1.7 --- loris_mark.C 2 Jan 2010 04:55:12 -0000 1.8 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: loris_spewmarkers.C =================================================================== RCS file: /cvsroot/loris/Loris/utils/loris_spewmarkers.C,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** loris_spewmarkers.C 16 Jan 2009 03:37:00 -0000 1.10 --- loris_spewmarkers.C 2 Jan 2010 04:55:12 -0000 1.11 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Makefile.am =================================================================== RCS file: /cvsroot/loris/Loris/utils/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.am 16 Jan 2009 03:37:00 -0000 1.11 --- Makefile.am 2 Jan 2010 04:55:12 -0000 1.12 *************** *** 1,3 **** ! # Copyright (c) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,4 ---- ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> # # This file is free software; as a special exception the author gives Index: loris_analyze.C =================================================================== RCS file: /cvsroot/loris/Loris/utils/loris_analyze.C,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** loris_analyze.C 16 Jan 2009 03:37:00 -0000 1.15 --- loris_analyze.C 2 Jan 2010 04:55:12 -0000 1.16 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: loris_dilate.C =================================================================== RCS file: /cvsroot/loris/Loris/utils/loris_dilate.C,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** loris_dilate.C 16 Jan 2009 03:37:00 -0000 1.6 --- loris_dilate.C 2 Jan 2010 04:55:12 -0000 1.7 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify |
|
From: Kelly F. <kf...@us...> - 2010-01-02 04:55:25
|
Update of /cvsroot/loris/Loris/csound In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992/csound Modified Files: Makefile.am lorisgens4.C lorisgens4.h lorisgens5.C lorisgens5.h Log Message: updated copyright notice Index: lorisgens5.h =================================================================== RCS file: /cvsroot/loris/Loris/csound/lorisgens5.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** lorisgens5.h 16 Jan 2009 03:36:57 -0000 1.6 --- lorisgens5.h 2 Jan 2010 04:55:12 -0000 1.7 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisgens5.C =================================================================== RCS file: /cvsroot/loris/Loris/csound/lorisgens5.C,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** lorisgens5.C 11 Oct 2009 05:12:30 -0000 1.9 --- lorisgens5.C 2 Jan 2010 04:55:12 -0000 1.10 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Makefile.am =================================================================== RCS file: /cvsroot/loris/Loris/csound/Makefile.am,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile.am 16 Jan 2009 03:36:56 -0000 1.17 --- Makefile.am 2 Jan 2010 04:55:12 -0000 1.18 *************** *** 1,3 **** ! # Copyright (c) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,4 ---- ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> # # This file is free software; as a special exception the author gives Index: lorisgens4.h =================================================================== RCS file: /cvsroot/loris/Loris/csound/lorisgens4.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lorisgens4.h 16 Jan 2009 03:36:57 -0000 1.2 --- lorisgens4.h 2 Jan 2010 04:55:12 -0000 1.3 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisgens4.C =================================================================== RCS file: /cvsroot/loris/Loris/csound/lorisgens4.C,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lorisgens4.C 16 Jan 2009 03:36:57 -0000 1.2 --- lorisgens4.C 2 Jan 2010 04:55:12 -0000 1.3 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify |
|
From: Kelly F. <kf...@us...> - 2010-01-02 04:55:25
|
Update of /cvsroot/loris/Loris/demo In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992/demo Modified Files: Makefile morphdemo.py Log Message: updated copyright notice Index: morphdemo.py =================================================================== RCS file: /cvsroot/loris/Loris/demo/morphdemo.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** morphdemo.py 11 Mar 2009 04:48:04 -0000 1.20 --- morphdemo.py 2 Jan 2010 04:55:12 -0000 1.21 *************** *** 5,9 **** # Bandwidth-Enhanced Additive Sound Model. # ! # Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken # # This program is free software; you can redistribute it and/or modify --- 5,9 ---- # Bandwidth-Enhanced Additive Sound Model. # ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken # # This program is free software; you can redistribute it and/or modify Index: Makefile =================================================================== RCS file: /cvsroot/loris/Loris/demo/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 11 Mar 2009 04:48:04 -0000 1.5 --- Makefile 2 Jan 2010 04:55:12 -0000 1.6 *************** *** 1,3 **** ! # Copyright (C) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,4 ---- ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> # # This file is free software; as a special exception the author gives |
|
From: Kelly F. <kf...@us...> - 2010-01-02 04:55:25
|
Update of /cvsroot/loris/Loris In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992 Modified Files: Makefile.am NEWS README configure.ac reconf Log Message: updated copyright notice Index: README =================================================================== RCS file: /cvsroot/loris/Loris/README,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** README 23 Sep 2009 04:11:31 -0000 1.18 --- README 2 Jan 2010 04:55:12 -0000 1.19 *************** *** 53,57 **** COPYRIGHT AND LICENSE: ! Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken Loris is free software; you can redistribute it and/or modify --- 53,57 ---- COPYRIGHT AND LICENSE: ! Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken Loris is free software; you can redistribute it and/or modify Index: NEWS =================================================================== RCS file: /cvsroot/loris/Loris/NEWS,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** NEWS 5 Nov 2009 05:34:56 -0000 1.90 --- NEWS 2 Jan 2010 04:55:12 -0000 1.91 *************** *** 21,25 **** Loris is free software. Please see the file COPYING for details. ! Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken. --- 21,25 ---- Loris is free software. Please see the file COPYING for details. ! Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken. *************** *** 790,796 **** Copying information: ! Copyright (C) 1999-2007, Kelly Fitz and Lippold Haken <lo...@ce...> Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the --- 790,797 ---- Copying information: ! Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken <lo...@ce...> + Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the Index: configure.ac =================================================================== RCS file: /cvsroot/loris/Loris/configure.ac,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** configure.ac 14 Oct 2009 03:34:54 -0000 1.68 --- configure.ac 2 Jan 2010 04:55:12 -0000 1.69 *************** *** 1,3 **** ! dnl Copyright (c) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> dnl dnl This file is free software; as a special exception the author gives --- 1,4 ---- ! dnl Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! dnl <lo...@ce...> dnl dnl This file is free software; as a special exception the author gives Index: Makefile.am =================================================================== RCS file: /cvsroot/loris/Loris/Makefile.am,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Makefile.am 8 Mar 2009 00:30:19 -0000 1.28 --- Makefile.am 2 Jan 2010 04:55:12 -0000 1.29 *************** *** 1,3 **** ! # Copyright (c) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,4 ---- ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> # # This file is free software; as a special exception the author gives Index: reconf =================================================================== RCS file: /cvsroot/loris/Loris/reconf,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** reconf 27 Apr 2007 07:50:22 -0000 1.12 --- reconf 2 Jan 2010 04:55:12 -0000 1.13 *************** *** 1,5 **** #!/bin/sh ! # Copyright (c) 1999-2007, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,7 ---- #!/bin/sh ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> ! # # This file is free software; as a special exception the author gives |
|
From: Kelly F. <kf...@us...> - 2010-01-02 04:55:20
|
Update of /cvsroot/loris/Loris/doc In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992/doc Modified Files: Makefile.am Log Message: updated copyright notice Index: Makefile.am =================================================================== RCS file: /cvsroot/loris/Loris/doc/Makefile.am,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Makefile.am 16 Jan 2009 03:36:57 -0000 1.25 --- Makefile.am 2 Jan 2010 04:55:12 -0000 1.26 *************** *** 1,3 **** ! # Copyright (c) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,4 ---- ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> # # This file is free software; as a special exception the author gives |
|
From: Kelly F. <kf...@us...> - 2010-01-02 04:55:20
|
Update of /cvsroot/loris/Loris/win In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992/win Modified Files: loris.h Log Message: updated copyright notice Index: loris.h =================================================================== RCS file: /cvsroot/loris/Loris/win/loris.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** loris.h 26 Jan 2009 03:50:00 -0000 1.1 --- loris.h 2 Jan 2010 04:55:12 -0000 1.2 *************** *** 6,10 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 6,10 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify |
Update of /cvsroot/loris/Loris/scripting In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10992/scripting Modified Files: Makefile.am loris.i lorisChannelizer.i lorisEnvelope.i lorisFundamental.i lorisPartialList.i lorisSynthesizer.i lorisdoc.py Log Message: updated copyright notice Index: lorisChannelizer.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/lorisChannelizer.i,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lorisChannelizer.i 14 Oct 2009 04:35:12 -0000 1.1 --- lorisChannelizer.i 2 Jan 2010 04:55:12 -0000 1.2 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: loris.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/loris.i,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** loris.i 29 Dec 2009 05:50:43 -0000 1.141 --- loris.i 2 Jan 2010 04:55:12 -0000 1.142 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisFundamental.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/lorisFundamental.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lorisFundamental.i 15 Jan 2009 06:03:18 -0000 1.2 --- lorisFundamental.i 2 Jan 2010 04:55:12 -0000 1.3 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisSynthesizer.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/lorisSynthesizer.i,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lorisSynthesizer.i 9 Nov 2009 04:53:08 -0000 1.4 --- lorisSynthesizer.i 2 Jan 2010 04:55:12 -0000 1.5 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: lorisPartialList.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/lorisPartialList.i,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** lorisPartialList.i 16 Sep 2009 03:53:37 -0000 1.51 --- lorisPartialList.i 2 Jan 2010 04:55:12 -0000 1.52 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify Index: Makefile.am =================================================================== RCS file: /cvsroot/loris/Loris/scripting/Makefile.am,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Makefile.am 14 Oct 2009 04:35:12 -0000 1.50 --- Makefile.am 2 Jan 2010 04:55:12 -0000 1.51 *************** *** 1,3 **** ! # Copyright (c) 1999-2009, Kelly Fitz and Lippold Haken <lo...@ce...> # # This file is free software; as a special exception the author gives --- 1,4 ---- ! # Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken ! # <lo...@ce...> # # This file is free software; as a special exception the author gives Index: lorisdoc.py =================================================================== RCS file: /cvsroot/loris/Loris/scripting/lorisdoc.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** lorisdoc.py 15 Jan 2009 06:03:18 -0000 1.5 --- lorisdoc.py 2 Jan 2010 04:55:12 -0000 1.6 *************** *** 12,16 **** (http://loris.sourceforge.net) and its mirrors. ! Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken """ import loris --- 12,16 ---- (http://loris.sourceforge.net) and its mirrors. ! Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken """ import loris Index: lorisEnvelope.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/lorisEnvelope.i,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lorisEnvelope.i 16 Sep 2009 03:55:00 -0000 1.1 --- lorisEnvelope.i 2 Jan 2010 04:55:12 -0000 1.2 *************** *** 4,8 **** * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2009 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify --- 4,8 ---- * Bandwidth-Enhanced Additive Sound Model. * ! * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken * * This program is free software; you can redistribute it and/or modify |
|
From: Kelly F. <kf...@us...> - 2009-12-29 05:50:57
|
Update of /cvsroot/loris/Loris/scripting In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20122 Modified Files: loris.i Log Message: Added single-Partial version of PartialUtils functions for setting and scaling Partial parameter envelopes to the scripting interface (they already were implemented in C++). Index: loris.i =================================================================== RCS file: /cvsroot/loris/Loris/scripting/loris.i,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** loris.i 9 Nov 2009 04:53:08 -0000 1.140 --- loris.i 29 Dec 2009 05:50:43 -0000 1.141 *************** *** 913,917 **** %feature("docstring", ! "Scale the amplitude of the Partials in a PartialList according to an envelope representing a time-varying amplitude scale value.") scaleAmplitude; --- 913,917 ---- %feature("docstring", ! "Scale the amplitude of a Partial, or all Partials in a PartialList, according to an envelope representing a time-varying amplitude scale value.") scaleAmplitude; *************** *** 930,933 **** --- 930,938 ---- } + void scaleAmplitude( Partial * p, Envelope * ampEnv ) + { + PartialUtils::scaleAmplitude( *p, *ampEnv ); + } + void scaleAmp( PartialList * partials, double val ) { *************** *** 942,949 **** } %} %feature("docstring", ! "Scale the bandwidth of the Partials in a PartialList according to an envelope representing a time-varying bandwidth scale value."); --- 947,959 ---- } + void scaleAmplitude( Partial * p, double val ) + { + LinearEnvelope e( val ); + PartialUtils::scaleAmplitude( *p, e ); + } %} %feature("docstring", ! "Scale the bandwidth of a Partial, or all Partials in a PartialList, according to an envelope representing a time-varying bandwidth scale value."); *************** *** 962,969 **** } %} %feature("docstring", ! "Scale the frequency of the Partials in a PartialList according to an envelope representing a time-varying frequency scale value."); --- 972,990 ---- } + void scaleBandwidth( Partial * p, Envelope * bwEnv ) + { + PartialUtils::scaleBandwidth( *p, *bwEnv ); + } + + + void scaleBandwidth( Partial * p, double val ) + { + LinearEnvelope e( val ); + PartialUtils::scaleBandwidth( *p, e ); + } %} %feature("docstring", ! "Scale the frequency of a Partial, or all Partials in a PartialList, according to an envelope representing a time-varying frequency scale value."); *************** *** 981,988 **** } %} %feature("docstring", ! "Scale the relative noise content of the Partials in a PartialList according to an envelope representing a (time-varying) noise energy scale value."); --- 1002,1020 ---- } + void scaleFrequency( Partial * p, Envelope * freqEnv ) + { + PartialUtils::scaleFrequency( *p, *freqEnv ); + } + + void scaleFrequency( Partial * p, double val ) + { + LinearEnvelope e( val ); + PartialUtils::scaleFrequency( *p, e ); + } + %} %feature("docstring", ! "Scale the relative noise content of a Partial, or all Partials in a PartialList, according to an envelope representing a (time-varying) noise energy scale value."); *************** *** 1003,1010 **** } %} %feature("docstring", ! "Set the bandwidth of the Partials in a PartialList according to an envelope representing a time-varying bandwidth value."); --- 1035,1052 ---- } + void scaleNoiseRatio( Partial * p, Envelope * noiseEnv ) + { + PartialUtils::scaleNoiseRatio( *p, *noiseEnv ); + } + + void scaleNoiseRatio( Partial * p, double val ) + { + LinearEnvelope e( val ); + PartialUtils::scaleNoiseRatio( *p, e ); + } %} %feature("docstring", ! "Set the bandwidth of a Partial, or all Partials in a PartialList, according to an envelope representing a time-varying bandwidth value."); *************** *** 1023,1026 **** --- 1065,1078 ---- } + void setBandwidth( Partial * p, Envelope * bwEnv ) + { + PartialUtils::setBandwidth( *p, *bwEnv ); + } + + void setBandwidth( Partial * p, double val ) + { + LinearEnvelope e( val ); + PartialUtils::setBandwidth( *p, e ); + } %} |