[Loris-cvs] Loris/scripting loris.i,1.142,1.143
C++ class library for sound analysis, synthesis, and morphing
Brought to you by:
kfitz
|
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."); |