[SCM] rubberband/master: Resolve merge

mira-guest at users.alioth.debian.org mira-guest at users.alioth.debian.org
Mon Sep 24 11:48:00 UTC 2012


Imported Upstream version 1.7.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: bfc8486f852b2e2a51f5e399b120cd4b6937c065
X-Git-Newrev: 4fc8392fdb016f60a1598c8b8299703afd43eede

The following commit has been merged in the master branch:
commit 4fc8392fdb016f60a1598c8b8299703afd43eede
Merge: bfc8486f852b2e2a51f5e399b120cd4b6937c065 b363750b5b05742234f749c36c6c5f55c6d67d12
Author: Jaromír Mikeš <mira.mikes at seznam.cz>
Date:   Mon Sep 24 13:46:09 2012 +0200

    Resolve merge

diff --combined Makefile.in
index 6eb07c6,5107b5c..bd4a2d4
--- a/Makefile.in
+++ b/Makefile.in
@@@ -1,14 -1,13 +1,14 @@@
  
  CXX		:= @CXX@
- CXXFLAGS	:= -DHAVE_FFTW3 -DFFTW_DOUBLE_ONLY -DNO_THREAD_CHECKS @CXXFLAGS@ @SRC_CFLAGS@ @SNDFILE_CFLAGS@ @FFTW_CFLAGS@ @Vamp_CFLAGS@ -Irubberband -Isrc $(OPTFLAGS)
+ CXXFLAGS	:= -DHAVE_LIBSAMPLERATE -DHAVE_FFTW3 -DFFTW_DOUBLE_ONLY -DNO_THREAD_CHECKS -DNO_TIMING -DNDEBUG @CXXFLAGS@ @SRC_CFLAGS@ @SNDFILE_CFLAGS@ @FFTW_CFLAGS@ @Vamp_CFLAGS@ -Irubberband -I. -Isrc $(OPTFLAGS)
  CFLAGS		:= @CFLAGS@ $(OPTFLAGS)
 -LDFLAGS		:= @LDFLAGS@ -lpthread $(LDFLAGS)
 +LDFLAGS		:= @LDFLAGS@ $(LDFLAGS)
  
 -LIBRARY_LIBS		:= @SRC_LIBS@ @FFTW_LIBS@ 
 -PROGRAM_LIBS		:= @SNDFILE_LIBS@ $(LIBRARY_LIBS)
 -VAMP_PLUGIN_LIBS	:= @Vamp_LIBS@ $(LIBRARY_LIBS)
 -LADSPA_PLUGIN_LIBS	:= $(LIBRARY_LIBS)
 +LIBRARY_LIBS		:= @SRC_LIBS@ @FFTW_LIBS@ -lpthread
 +SELF_LIBS		:= -Llib -lrubberband
 +PROGRAM_LIBS		:= @SNDFILE_LIBS@ $(SELF_LIBS)
 +VAMP_PLUGIN_LIBS	:= @Vamp_LIBS@ $(SELF_LIBS)
 +LADSPA_PLUGIN_LIBS	:= $(SELF_LIBS)
  
  MKDIR			:= mkdir
  AR			:= ar
@@@ -18,8 -17,8 +18,8 @@@ DYNAMIC_FULL_VERSION	:= .2.1.
  DYNAMIC_ABI_VERSION	:= .2
  DYNAMIC_LIBNAME		:= librubberband$(DYNAMIC_EXTENSION)
  DYNAMIC_LDFLAGS		:= -shared -Wl,-Bsymbolic -Wl,-soname=$(DYNAMIC_LIBNAME)$(DYNAMIC_ABI_VERSION)
- VAMP_LDFLAGS		:= -shared -Wl,-Bsymbolic -Wl,--version-script=src/vamp/vamp-plugin.map
- LADSPA_LDFLAGS		:= -shared -Wl,-Bsymbolic -Wl,--version-script=src/ladspa/ladspa-plugin.map
+ VAMP_LDFLAGS		:= -shared -Wl,-Bsymbolic -Wl,--version-script=vamp/vamp-plugin.map
+ LADSPA_LDFLAGS		:= -shared -Wl,-Bsymbolic -Wl,--version-script=ladspa/ladspa-plugin.map
  
  PROGRAM_TARGET 		:= bin/rubberband
  STATIC_TARGET  		:= lib/librubberband.a
@@@ -49,60 -48,67 +49,67 @@@ PUBLIC_INCLUDES := 
  	rubberband/RubberBandStretcher.h
  
  LIBRARY_INCLUDES := \
- 	src/AudioCurve.h \
- 	src/ConstantAudioCurve.h \
- 	src/FFT.h \
- 	src/HighFrequencyAudioCurve.h \
- 	src/PercussiveAudioCurve.h \
- 	src/Profiler.h \
- 	src/Resampler.h \
- 	src/RingBuffer.h \
- 	src/Scavenger.h \
- 	src/SilentAudioCurve.h \
- 	src/SpectralDifferenceAudioCurve.h \
- 	src/StretchCalculator.h \
- 	src/StretcherImpl.h \
  	src/StretcherChannelData.h \
- 	src/Thread.h \
- 	src/Window.h \
- 	src/sysutils.h
+ 	src/float_cast/float_cast.h \
+ 	src/StretcherImpl.h \
+ 	src/StretchCalculator.h \
+ 	src/base/Profiler.h \
+ 	src/base/RingBuffer.h \
+ 	src/base/Scavenger.h \
+ 	src/dsp/AudioCurveCalculator.h \
+ 	src/dsp/CompoundAudioCurve.h \
+ 	src/dsp/ConstantAudioCurve.h \
+ 	src/dsp/HighFrequencyAudioCurve.h \
+ 	src/dsp/PercussiveAudioCurve.h \
+ 	src/dsp/SilentAudioCurve.h \
+ 	src/dsp/SpectralDifferenceAudioCurve.h \
+ 	src/dsp/Resampler.h \
+ 	src/dsp/FFT.h \
+ 	src/dsp/MovingMedian.h \
+ 	src/dsp/SincWindow.h \
+ 	src/dsp/Window.h \
+ 	src/system/Allocators.h \
+ 	src/system/Thread.h \
+ 	src/system/VectorOps.h \
+ 	src/system/sysutils.h
  
  LIBRARY_SOURCES := \
- 	src/AudioCurve.cpp \
- 	src/ConstantAudioCurve.cpp \
- 	src/FFT.cpp \
- 	src/HighFrequencyAudioCurve.cpp \
- 	src/PercussiveAudioCurve.cpp \
- 	src/Profiler.cpp \
- 	src/Resampler.cpp \
  	src/rubberband-c.cpp \
  	src/RubberBandStretcher.cpp \
- 	src/SilentAudioCurve.cpp \
- 	src/SpectralDifferenceAudioCurve.cpp \
- 	src/StretchCalculator.cpp \
- 	src/StretcherImpl.cpp \
  	src/StretcherProcess.cpp \
+ 	src/StretchCalculator.cpp \
+ 	src/base/Profiler.cpp \
+ 	src/dsp/AudioCurveCalculator.cpp \
+ 	src/dsp/CompoundAudioCurve.cpp \
+ 	src/dsp/SpectralDifferenceAudioCurve.cpp \
+ 	src/dsp/HighFrequencyAudioCurve.cpp \
+ 	src/dsp/SilentAudioCurve.cpp \
+ 	src/dsp/ConstantAudioCurve.cpp \
+ 	src/dsp/PercussiveAudioCurve.cpp \
+ 	src/dsp/Resampler.cpp \
+ 	src/dsp/FFT.cpp \
+ 	src/system/Allocators.cpp \
+ 	src/system/sysutils.cpp \
+ 	src/system/Thread.cpp \
  	src/StretcherChannelData.cpp \
- 	src/Thread.cpp \
- 	src/Window.cpp \
- 	src/sysutils.cpp
+ 	src/StretcherImpl.cpp
  
  PROGRAM_SOURCES := \
- 	src/main.cpp
+ 	main/main.cpp
  
  VAMP_HEADERS := \
- 	src/vamp/RubberBandVampPlugin.h
+ 	vamp/RubberBandVampPlugin.h
  
  VAMP_SOURCES := \
- 	src/vamp/RubberBandVampPlugin.cpp \
- 	src/vamp/libmain.cpp
+ 	vamp/RubberBandVampPlugin.cpp \
+ 	vamp/libmain.cpp
  
  LADSPA_HEADERS := \
- 	src/ladspa/RubberBandPitchShifter.h
+ 	ladspa/RubberBandPitchShifter.h
  
  LADSPA_SOURCES := \
- 	src/ladspa/RubberBandPitchShifter.cpp \
- 	src/ladspa/libmain.cpp
+ 	ladspa/RubberBandPitchShifter.cpp \
+ 	ladspa/libmain.cpp
  
  LIBRARY_OBJECTS := $(LIBRARY_SOURCES:.cpp=.o)
  LIBRARY_OBJECTS := $(LIBRARY_OBJECTS:.c=.o)
@@@ -111,20 -117,20 +118,20 @@@ PROGRAM_OBJECTS := $(PROGRAM_SOURCES:.c
  VAMP_OBJECTS    := $(VAMP_SOURCES:.cpp=.o)
  LADSPA_OBJECTS  := $(LADSPA_SOURCES:.cpp=.o)
  
 -$(PROGRAM_TARGET):	$(LIBRARY_OBJECTS) $(PROGRAM_OBJECTS)
 -	$(CXX) -o $@ $^ $(PROGRAM_LIBS) $(LDFLAGS)
 +$(PROGRAM_TARGET):	$(DYNAMIC_TARGET) $(PROGRAM_OBJECTS)
 +	$(CXX) -o $@ $(PROGRAM_OBJECTS) $(PROGRAM_LIBS) $(LDFLAGS)
  
  $(STATIC_TARGET):	$(LIBRARY_OBJECTS)
  	$(AR) rsc $@ $^
  
  $(DYNAMIC_TARGET):	$(LIBRARY_OBJECTS)
 -	$(CXX) $(DYNAMIC_LDFLAGS) $^ -o $@ $(LIBRARY_LIBS) $(LDFLAGS)
 +	$(CXX) $(DYNAMIC_LDFLAGS) $^ -o $@ $(LIBRARY_LIBS) $(LIBRARY_LDFLAGS) $(LDFLAGS)
  
 -$(VAMP_TARGET):		$(LIBRARY_OBJECTS) $(VAMP_OBJECTS)
 -	$(CXX) $(VAMP_LDFLAGS) -o $@ $^ $(VAMP_PLUGIN_LIBS) $(LDFLAGS)
 +$(VAMP_TARGET):		$(DYNAMIC_TARGET) $(VAMP_OBJECTS)
 +	$(CXX) $(VAMP_LDFLAGS) -o $@ $(VAMP_OBJECTS) $(VAMP_PLUGIN_LIBS) $(LDFLAGS)
  
 -$(LADSPA_TARGET):	$(LIBRARY_OBJECTS) $(LADSPA_OBJECTS)
 -	$(CXX) $(LADSPA_LDFLAGS) -o $@ $^ $(LADSPA_PLUGIN_LIBS) $(LDFLAGS)
 +$(LADSPA_TARGET):	$(DYNAMIC_TARGET) $(LADSPA_OBJECTS)
 +	$(CXX) $(LADSPA_LDFLAGS) -o $@ $(LADSPA_OBJECTS) $(LADSPA_PLUGIN_LIBS) $(LDFLAGS)
  
  bin:
  	$(MKDIR) $@
@@@ -148,10 -154,10 +155,10 @@@ install:	al
  	test -n "$(DYNAMIC_FULL_VERSION)" && ln -s $(DYNAMIC_LIBNAME)$(DYNAMIC_FULL_VERSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_LIBNAME)$(DYNAMIC_ABI_VERSION)
  	test -n "$(DYNAMIC_FULL_VERSION)" && ln -s $(DYNAMIC_LIBNAME)$(DYNAMIC_FULL_VERSION) $(DESTDIR)$(INSTALL_LIBDIR)/$(DYNAMIC_LIBNAME)
  	cp $(VAMP_TARGET) $(DESTDIR)$(INSTALL_VAMPDIR)
- 	cp src/vamp/vamp-rubberband.cat $(DESTDIR)$(INSTALL_VAMPDIR)
+ 	cp vamp/vamp-rubberband.cat $(DESTDIR)$(INSTALL_VAMPDIR)
  	cp $(LADSPA_TARGET) $(DESTDIR)$(INSTALL_LADSPADIR)
- 	cp src/ladspa/ladspa-rubberband.cat $(DESTDIR)$(INSTALL_LADSPADIR)
- 	cp src/ladspa/ladspa-rubberband.rdf $(DESTDIR)$(INSTALL_LRDFDIR)
+ 	cp ladspa/ladspa-rubberband.cat $(DESTDIR)$(INSTALL_LADSPADIR)
+ 	cp ladspa/ladspa-rubberband.rdf $(DESTDIR)$(INSTALL_LRDFDIR)
  	sed "s,%PREFIX%, at prefix@," rubberband.pc.in \
  	  > $(DESTDIR)$(INSTALL_PKGDIR)/rubberband.pc
  
@@@ -161,97 -167,96 +168,96 @@@ clean
  distclean:	clean
  	rm -f $(PROGRAM_TARGET) $(STATIC_TARGET) $(DYNAMIC_TARGET) $(VAMP_TARGET) $(LADSPA_TARGET)
  
+ depend:
+ 	makedepend -Y $(LIBRARY_SOURCES) $(PROGRAM_SOURCES)
+ 
+ 
  # DO NOT DELETE
  
- src/AudioCurve.o: src/AudioCurve.h src/sysutils.h
- src/ConstantAudioCurve.o: src/ConstantAudioCurve.h src/AudioCurve.h
- src/ConstantAudioCurve.o: src/sysutils.h
- src/FFT.o: src/FFT.h src/sysutils.h src/Thread.h src/Profiler.h
- src/HighFrequencyAudioCurve.o: src/HighFrequencyAudioCurve.h src/AudioCurve.h
- src/HighFrequencyAudioCurve.o: src/sysutils.h src/Window.h
- src/main.o: rubberband/RubberBandStretcher.h rubberband/rubberband-c.h
- src/main.o: src/sysutils.h src/Profiler.h
- src/PercussiveAudioCurve.o: src/PercussiveAudioCurve.h src/AudioCurve.h
- src/PercussiveAudioCurve.o: src/sysutils.h
- src/Profiler.o: src/Profiler.h src/sysutils.h
- src/Resampler.o: src/Resampler.h src/sysutils.h src/Profiler.h
- src/RingBuffer.o: src/RingBuffer.h src/Scavenger.h src/Thread.h
- src/RingBuffer.o: src/sysutils.h src/Profiler.h
+ src/rubberband-c.o: rubberband/rubberband-c.h
+ src/rubberband-c.o: rubberband/RubberBandStretcher.h
  src/RubberBandStretcher.o: src/StretcherImpl.h
- src/RubberBandStretcher.o: rubberband/RubberBandStretcher.h
- src/RubberBandStretcher.o: rubberband/rubberband-c.h src/Window.h
- src/RubberBandStretcher.o: src/sysutils.h src/Thread.h src/RingBuffer.h
- src/RubberBandStretcher.o: src/Scavenger.h src/Profiler.h src/FFT.h
- src/SpectralDifferenceAudioCurve.o: src/SpectralDifferenceAudioCurve.h
- src/SpectralDifferenceAudioCurve.o: src/AudioCurve.h src/sysutils.h
- src/SpectralDifferenceAudioCurve.o: src/Window.h
- src/StretchCalculator.o: src/StretchCalculator.h src/sysutils.h
+ src/RubberBandStretcher.o: rubberband/RubberBandStretcher.h src/dsp/Window.h
+ src/RubberBandStretcher.o: src/dsp/SincWindow.h src/dsp/FFT.h
+ src/RubberBandStretcher.o: src/dsp/CompoundAudioCurve.h
+ src/RubberBandStretcher.o: src/dsp/AudioCurveCalculator.h
+ src/RubberBandStretcher.o: src/dsp/PercussiveAudioCurve.h
+ src/RubberBandStretcher.o: src/dsp/HighFrequencyAudioCurve.h
+ src/RubberBandStretcher.o: src/dsp/SampleFilter.h src/base/RingBuffer.h
+ src/RubberBandStretcher.o: src/base/Scavenger.h src/system/Thread.h
+ src/RubberBandStretcher.o: src/system/sysutils.h
+ src/StretcherProcess.o: src/StretcherImpl.h rubberband/RubberBandStretcher.h
+ src/StretcherProcess.o: src/dsp/Window.h src/dsp/SincWindow.h src/dsp/FFT.h
+ src/StretcherProcess.o: src/dsp/CompoundAudioCurve.h
+ src/StretcherProcess.o: src/dsp/AudioCurveCalculator.h
+ src/StretcherProcess.o: src/dsp/PercussiveAudioCurve.h
+ src/StretcherProcess.o: src/dsp/HighFrequencyAudioCurve.h
+ src/StretcherProcess.o: src/dsp/SampleFilter.h src/base/RingBuffer.h
+ src/StretcherProcess.o: src/base/Scavenger.h src/system/Thread.h
+ src/StretcherProcess.o: src/system/sysutils.h src/dsp/PercussiveAudioCurve.h
+ src/StretcherProcess.o: src/dsp/HighFrequencyAudioCurve.h
+ src/StretcherProcess.o: src/dsp/ConstantAudioCurve.h src/StretchCalculator.h
+ src/StretcherProcess.o: src/StretcherChannelData.h src/dsp/Resampler.h
+ src/StretcherProcess.o: src/base/Profiler.h src/system/VectorOps.h
+ src/StretcherProcess.o: src/system/sysutils.h
+ src/StretchCalculator.o: src/StretchCalculator.h src/system/sysutils.h
+ src/base/Profiler.o: src/base/Profiler.h src/system/sysutils.h
+ src/dsp/AudioCurveCalculator.o: src/dsp/AudioCurveCalculator.h
+ src/dsp/CompoundAudioCurve.o: src/dsp/CompoundAudioCurve.h
+ src/dsp/CompoundAudioCurve.o: src/dsp/AudioCurveCalculator.h
+ src/dsp/CompoundAudioCurve.o: src/dsp/PercussiveAudioCurve.h
+ src/dsp/CompoundAudioCurve.o: src/dsp/HighFrequencyAudioCurve.h
+ src/dsp/CompoundAudioCurve.o: src/dsp/SampleFilter.h src/dsp/MovingMedian.h
+ src/dsp/SpectralDifferenceAudioCurve.o: src/dsp/SpectralDifferenceAudioCurve.h
+ src/dsp/SpectralDifferenceAudioCurve.o: src/dsp/AudioCurveCalculator.h
+ src/dsp/SpectralDifferenceAudioCurve.o: src/dsp/Window.h
+ src/dsp/SpectralDifferenceAudioCurve.o: src/system/sysutils.h
+ src/dsp/SpectralDifferenceAudioCurve.o: src/system/VectorOps.h
+ src/dsp/SpectralDifferenceAudioCurve.o: src/system/sysutils.h
+ src/dsp/HighFrequencyAudioCurve.o: src/dsp/HighFrequencyAudioCurve.h
+ src/dsp/HighFrequencyAudioCurve.o: src/dsp/AudioCurveCalculator.h
+ src/dsp/SilentAudioCurve.o: src/dsp/SilentAudioCurve.h
+ src/dsp/SilentAudioCurve.o: src/dsp/AudioCurveCalculator.h
+ src/dsp/ConstantAudioCurve.o: src/dsp/ConstantAudioCurve.h
+ src/dsp/ConstantAudioCurve.o: src/dsp/AudioCurveCalculator.h
+ src/dsp/PercussiveAudioCurve.o: src/dsp/PercussiveAudioCurve.h
+ src/dsp/PercussiveAudioCurve.o: src/dsp/AudioCurveCalculator.h
+ src/dsp/PercussiveAudioCurve.o: src/system/VectorOps.h src/system/sysutils.h
+ src/dsp/Resampler.o: src/dsp/Resampler.h src/system/sysutils.h
+ src/dsp/Resampler.o: src/base/Profiler.h
+ src/dsp/FFT.o: src/dsp/FFT.h src/system/sysutils.h src/system/Thread.h
+ src/dsp/FFT.o: src/base/Profiler.h src/system/VectorOps.h
+ src/dsp/FFT.o: src/system/sysutils.h
+ src/system/Allocators.o: src/system/Allocators.h src/system/VectorOps.h
+ src/system/Allocators.o: src/system/sysutils.h
+ src/system/sysutils.o: src/system/sysutils.h
+ src/system/Thread.o: src/system/Thread.h
  src/StretcherChannelData.o: src/StretcherChannelData.h src/StretcherImpl.h
- src/StretcherChannelData.o: rubberband/RubberBandStretcher.h
- src/StretcherChannelData.o: rubberband/rubberband-c.h src/Window.h
- src/StretcherChannelData.o: src/sysutils.h src/Thread.h src/RingBuffer.h
- src/StretcherChannelData.o: src/Scavenger.h src/Profiler.h src/FFT.h
- src/StretcherChannelData.o: src/Resampler.h
+ src/StretcherChannelData.o: rubberband/RubberBandStretcher.h src/dsp/Window.h
+ src/StretcherChannelData.o: src/dsp/SincWindow.h src/dsp/FFT.h
+ src/StretcherChannelData.o: src/dsp/CompoundAudioCurve.h
+ src/StretcherChannelData.o: src/dsp/AudioCurveCalculator.h
+ src/StretcherChannelData.o: src/dsp/PercussiveAudioCurve.h
+ src/StretcherChannelData.o: src/dsp/HighFrequencyAudioCurve.h
+ src/StretcherChannelData.o: src/dsp/SampleFilter.h src/base/RingBuffer.h
+ src/StretcherChannelData.o: src/base/Scavenger.h src/system/Thread.h
+ src/StretcherChannelData.o: src/system/sysutils.h src/dsp/Resampler.h
+ src/StretcherChannelData.o: src/system/Allocators.h src/system/VectorOps.h
+ src/StretcherChannelData.o: src/system/sysutils.h
  src/StretcherImpl.o: src/StretcherImpl.h rubberband/RubberBandStretcher.h
- src/StretcherImpl.o: rubberband/rubberband-c.h src/Window.h src/sysutils.h
- src/StretcherImpl.o: src/Thread.h src/RingBuffer.h src/Scavenger.h
- src/StretcherImpl.o: src/Profiler.h src/FFT.h src/PercussiveAudioCurve.h
- src/StretcherImpl.o: src/AudioCurve.h src/HighFrequencyAudioCurve.h
- src/StretcherImpl.o: src/SpectralDifferenceAudioCurve.h
- src/StretcherImpl.o: src/ConstantAudioCurve.h src/StretchCalculator.h
- src/StretcherImpl.o: src/StretcherChannelData.h src/Resampler.h
- src/StretcherProcess.o: src/StretcherImpl.h rubberband/RubberBandStretcher.h
- src/StretcherProcess.o: rubberband/rubberband-c.h src/Window.h
- src/StretcherProcess.o: src/sysutils.h src/Thread.h src/RingBuffer.h
- src/StretcherProcess.o: src/Scavenger.h src/Profiler.h src/FFT.h
- src/StretcherProcess.o: src/PercussiveAudioCurve.h src/AudioCurve.h
- src/StretcherProcess.o: src/HighFrequencyAudioCurve.h
- src/StretcherProcess.o: src/ConstantAudioCurve.h src/StretchCalculator.h
- src/StretcherProcess.o: src/StretcherChannelData.h src/Resampler.h
- src/sysutils.o: src/sysutils.h
- src/Thread.o: src/Thread.h
- src/Window.o: src/Window.h src/sysutils.h
- rubberband/RubberBandStretcher.o: rubberband/rubberband-c.h
- src/AudioCurve.o: src/sysutils.h
- src/ConstantAudioCurve.o: src/AudioCurve.h src/sysutils.h
- src/FFT.o: src/sysutils.h
- src/HighFrequencyAudioCurve.o: src/AudioCurve.h src/sysutils.h src/Window.h
- src/PercussiveAudioCurve.o: src/AudioCurve.h src/sysutils.h
- src/Profiler.o: src/sysutils.h
- src/Resampler.o: src/sysutils.h
- src/RingBuffer.o: src/Scavenger.h src/Thread.h src/sysutils.h src/Profiler.h
- src/Scavenger.o: src/Thread.h src/sysutils.h
- src/SpectralDifferenceAudioCurve.o: src/AudioCurve.h src/sysutils.h
- src/SpectralDifferenceAudioCurve.o: src/Window.h
- src/StretcherChannelData.o: src/StretcherImpl.h
- src/StretcherChannelData.o: rubberband/RubberBandStretcher.h
- src/StretcherChannelData.o: rubberband/rubberband-c.h src/Window.h
- src/StretcherChannelData.o: src/sysutils.h src/Thread.h src/RingBuffer.h
- src/StretcherChannelData.o: src/Scavenger.h src/Profiler.h src/FFT.h
- src/StretcherImpl.o: rubberband/RubberBandStretcher.h
- src/StretcherImpl.o: rubberband/rubberband-c.h src/Window.h src/sysutils.h
- src/StretcherImpl.o: src/Thread.h src/RingBuffer.h src/Scavenger.h
- src/StretcherImpl.o: src/Profiler.h src/FFT.h
- src/rubberband-c.o: rubberband/RubberBandStretcher.h rubberband/rubberband-c.h
- src/Window.o: src/sysutils.h
- src/ladspa/libmain.o: src/ladspa/RubberBandPitchShifter.h 
- src/ladspa/libmain.o: src/RingBuffer.h src/Scavenger.h src/Thread.h
- src/ladspa/libmain.o: src/sysutils.h src/Profiler.h
- src/ladspa/RubberBandPitchShifter.o: src/ladspa/RubberBandPitchShifter.h
- src/ladspa/RubberBandPitchShifter.o: src/RingBuffer.h
- src/ladspa/RubberBandPitchShifter.o: src/Scavenger.h src/Thread.h
- src/ladspa/RubberBandPitchShifter.o: src/sysutils.h src/Profiler.h
- src/ladspa/RubberBandPitchShifter.o: rubberband/RubberBandStretcher.h
- src/ladspa/RubberBandPitchShifter.o: rubberband/rubberband-c.h
- src/vamp/libmain.o: src/vamp/RubberBandVampPlugin.h
- src/vamp/libmain.o: rubberband/RubberBandStretcher.h
- src/vamp/libmain.o: rubberband/rubberband-c.h
- src/vamp/RubberBandVampPlugin.o: src/vamp/RubberBandVampPlugin.h
- src/vamp/RubberBandVampPlugin.o: rubberband/RubberBandStretcher.h
- src/vamp/RubberBandVampPlugin.o: rubberband/rubberband-c.h
- src/vamp/RubberBandVampPlugin.o: src/StretchCalculator.h
- src/ladspa/RubberBandPitchShifter.o: src/RingBuffer.h
- src/ladspa/RubberBandPitchShifter.o: src/Scavenger.h src/Thread.h
- src/ladspa/RubberBandPitchShifter.o: src/sysutils.h src/Profiler.h
- src/vamp/RubberBandVampPlugin.o: rubberband/RubberBandStretcher.h
- src/vamp/RubberBandVampPlugin.o: rubberband/rubberband-c.h
+ src/StretcherImpl.o: src/dsp/Window.h src/dsp/SincWindow.h src/dsp/FFT.h
+ src/StretcherImpl.o: src/dsp/CompoundAudioCurve.h
+ src/StretcherImpl.o: src/dsp/AudioCurveCalculator.h
+ src/StretcherImpl.o: src/dsp/PercussiveAudioCurve.h
+ src/StretcherImpl.o: src/dsp/HighFrequencyAudioCurve.h src/dsp/SampleFilter.h
+ src/StretcherImpl.o: src/base/RingBuffer.h src/base/Scavenger.h
+ src/StretcherImpl.o: src/system/Thread.h src/system/sysutils.h
+ src/StretcherImpl.o: src/dsp/PercussiveAudioCurve.h
+ src/StretcherImpl.o: src/dsp/HighFrequencyAudioCurve.h
+ src/StretcherImpl.o: src/dsp/SpectralDifferenceAudioCurve.h src/dsp/Window.h
+ src/StretcherImpl.o: src/system/VectorOps.h src/system/sysutils.h
+ src/StretcherImpl.o: src/dsp/SilentAudioCurve.h src/dsp/ConstantAudioCurve.h
+ src/StretcherImpl.o: src/dsp/Resampler.h src/StretchCalculator.h
+ src/StretcherImpl.o: src/StretcherChannelData.h src/base/Profiler.h
+ main/main.o: rubberband/RubberBandStretcher.h src/system/sysutils.h
+ main/main.o: src/base/Profiler.h
diff --combined main/main.cpp
index 65751ec,c977423..24c9e3e
--- a/main/main.cpp
+++ b/main/main.cpp
@@@ -3,7 -3,7 +3,7 @@@
  /*
      Rubber Band
      An audio time-stretching and pitch-shifting library.
-     Copyright 2007-2008 Chris Cannam.
+     Copyright 2007-2011 Chris Cannam.
      
      This program is free software; you can redistribute it and/or
      modify it under the terms of the GNU General Public License as
@@@ -12,7 -12,7 +12,7 @@@
      COPYING included with this distribution for more information.
  */
  
- #include "RubberBandStretcher.h"
+ #include "rubberband/RubberBandStretcher.h"
  
  #include <iostream>
  #include <sndfile.h>
@@@ -20,26 -20,26 +20,31 @@@
  #include <time.h>
  #include <cstdlib>
  #include <cstring>
++<<<<<<< HEAD:src/main.cpp
 +#include <unistd.h>
 +#include "sysutils.h"
++=======
+ #include <string>
+ 
+ #include <fstream>
+ 
+ #include "system/sysutils.h"
++>>>>>>> upstream/1.7.0:main/main.cpp
  
- #ifdef __MSVC__
- #include "bsd-3rdparty/getopt/getopt.h"
- #else
  #include <getopt.h>
+ #include <unistd.h>
  #include <sys/time.h>
- #endif
  
- #include "Profiler.h"
+ #include "base/Profiler.h"
  
  using namespace std;
  using namespace RubberBand;
  
  #ifdef _WIN32
  using RubberBand::gettimeofday;
- using RubberBand::usleep;
  #endif
  
+ 
  double tempo_convert(const char *str)
  {
      char *d = strchr((char *)str, ':');
@@@ -71,13 -71,15 +76,15 @@@ int main(int argc, char **argv
      double frequencyshift = 1.0;
      int debug = 0;
      bool realtime = false;
-     bool precise = false;
+     bool precise = true;
      int threading = 0;
      bool lamination = true;
      bool longwin = false;
      bool shortwin = false;
+     bool smoothing = false;
      bool hqpitch = false;
      bool formant = false;
+     bool together = false;
      bool crispchanged = false;
      int crispness = -1;
      bool help = false;
@@@ -86,12 -88,20 +93,20 @@@
  
      bool haveRatio = false;
  
+     std::string mapfile;
+ 
      enum {
          NoTransients,
          BandLimitedTransients,
          Transients
      } transients = Transients;
  
+     enum {
+         CompoundDetector,
+         PercussiveDetector,
+         SoftDetector
+     } detector = CompoundDetector;
+ 
      while (1) {
          int optionIndex = 0;
  
@@@ -107,21 -117,29 +122,29 @@@
              { "crispness",     1, 0, 'c' },
              { "debug",         1, 0, 'd' },
              { "realtime",      0, 0, 'R' },
+             { "loose",         0, 0, 'L' },
              { "precise",       0, 0, 'P' },
              { "formant",       0, 0, 'F' },
              { "no-threads",    0, 0, '0' },
              { "no-transients", 0, 0, '1' },
              { "no-lamination", 0, 0, '2' },
+             { "centre-focus",  0, 0, '7' },
              { "window-long",   0, 0, '3' },
              { "window-short",  0, 0, '4' },
              { "bl-transients", 0, 0, '8' },
+             { "detector-perc", 0, 0, '5' },
+             { "detector-soft", 0, 0, '6' },
+             { "smoothing",     0, 0, '9' },
              { "pitch-hq",      0, 0, '%' },
              { "threads",       0, 0, '@' },
              { "quiet",         0, 0, 'q' },
-             { 0, 0, 0 }
+             { "timemap",       1, 0, 'M' },
+             { 0, 0, 0, 0 }
          };
  
-         c = getopt_long(argc, argv, "t:p:d:RPFc:f:T:D:qhV", longOpts, &optionIndex);
+         c = getopt_long(argc, argv,
+                         "t:p:d:RLPFc:f:T:D:qhVM:",
+                         longOpts, &optionIndex);
          if (c == -1) break;
  
          switch (c) {
@@@ -134,6 -152,7 +157,7 @@@
          case 'f': frequencyshift = atof(optarg); haveRatio = true; break;
          case 'd': debug = atoi(optarg); break;
          case 'R': realtime = true; break;
+         case 'L': precise = false; break;
          case 'P': precise = true; break;
  	case 'F': formant = true; break;
          case '0': threading = 1; break;
@@@ -142,10 -161,15 +166,15 @@@
          case '2': lamination = false; crispchanged = true; break;
          case '3': longwin = true; crispchanged = true; break;
          case '4': shortwin = true; crispchanged = true; break;
+         case '5': detector = PercussiveDetector; crispchanged = true; break;
+         case '6': detector = SoftDetector; crispchanged = true; break;
+         case '7': together = true; break;
          case '8': transients = BandLimitedTransients; crispchanged = true; break;
+         case '9': smoothing = true; crispchanged = true; break;
          case '%': hqpitch = true; break;
          case 'c': crispness = atoi(optarg); break;
          case 'q': quiet = true; break;
+         case 'M': mapfile = optarg; break;
          default:  help = true; break;
          }
      }
@@@ -159,7 -183,7 +188,7 @@@
          cerr << endl;
  	cerr << "Rubber Band" << endl;
          cerr << "An audio time-stretching and pitch-shifting library and utility program." << endl;
- 	cerr << "Copyright 2008 Chris Cannam.  Distributed under the GNU General Public License." << endl;
+ 	cerr << "Copyright 2011 Chris Cannam.  Distributed under the GNU General Public License." << endl;
          cerr << endl;
  	cerr << "   Usage: " << argv[0] << " [options] <infile.wav> <outfile.wav>" << endl;
          cerr << endl;
@@@ -173,10 -197,17 +202,17 @@@
          cerr << "  -p<X>, --pitch <X>      Raise pitch by X semitones, or" << endl;
          cerr << "  -f<X>, --frequency <X>  Change frequency by multiple X" << endl;
          cerr << endl;
+         cerr << "  -M<F>, --timemap <F>    Use file F as the source for key frame map" << endl;
+         cerr << endl;
+         cerr << "A map file consists of a series of lines each having two numbers separated" << endl;
+         cerr << "by a single space.  These are source and target sample frame numbers for fixed" << endl;
+         cerr << "time points within the audio data, defining a varying stretch factor through" << endl;
+         cerr << "the audio.  You must specify an overall stretch factor using e.g. -t as well." << endl;
+         cerr << endl;
          cerr << "The following options provide a simple way to adjust the sound.  See below" << endl;
          cerr << "for more details." << endl;
          cerr << endl;
-         cerr << "  -c<N>, --crisp <N>      Crispness (N = 0,1,2,3,4,5); default 4 (see below)" << endl;
+         cerr << "  -c<N>, --crisp <N>      Crispness (N = 0,1,2,3,4,5,6); default 5 (see below)" << endl;
  	cerr << "  -F,    --formant        Enable formant preservation when pitch shifting" << endl;
          cerr << endl;
          cerr << "The remaining options fine-tune the processing mode and stretch algorithm." << endl;
@@@ -184,8 -215,9 +220,9 @@@
          cerr << "crispness parameter are intended to provide the best sounding set of options" << endl;
          cerr << "for most situations.  The default is to use none of these options." << endl;
          cerr << endl;
-         cerr << "  -P,    --precise        Aim for minimal time distortion (implied by -R)" << endl;
-         cerr << "  -R,    --realtime       Select realtime mode (implies -P --no-threads)" << endl;
+         cerr << "  -L,    --loose          Relax timing in hope of better transient preservation" << endl;
+         cerr << "  -P,    --precise        Ignored: The opposite of -L, this is default from 1.6" << endl;
+         cerr << "  -R,    --realtime       Select realtime mode (implies --no-threads)" << endl;
          cerr << "         --no-threads     No extra threads regardless of CPU and channel count" << endl;
          cerr << "         --threads        Assume multi-CPU even if only one CPU is identified" << endl;
          cerr << "         --no-transients  Disable phase resynchronisation at transients" << endl;
@@@ -193,7 -225,12 +230,12 @@@
          cerr << "         --no-lamination  Disable phase lamination" << endl;
          cerr << "         --window-long    Use longer processing window (actual size may vary)" << endl;
          cerr << "         --window-short   Use shorter processing window" << endl;
+         cerr << "         --smoothing      Apply window presum and time-domain smoothing" << endl;
+         cerr << "         --detector-perc  Use percussive transient detector (as in pre-1.5)" << endl;
+         cerr << "         --detector-soft  Use soft transient detector" << endl;
          cerr << "         --pitch-hq       In RT mode, use a slower, higher quality pitch shift" << endl;
+         cerr << "         --centre-focus   Preserve focus of centre material in stereo" << endl;
+         cerr << "                          (at a cost in width and individual channel quality)" << endl;
          cerr << endl;
          cerr << "  -d<N>, --debug <N>      Select debug level (N = 0,1,2,3); default 0, full 3" << endl;
          cerr << "                          (N.B. debug level 3 includes audible ticks in output)" << endl;
@@@ -204,11 -241,12 +246,12 @@@
          cerr << endl;
          cerr << "\"Crispness\" levels:" << endl;
          cerr << "  -c 0   equivalent to --no-transients --no-lamination --window-long" << endl;
-         cerr << "  -c 1   equivalent to --no-transients --no-lamination" << endl;
-         cerr << "  -c 2   equivalent to --no-transients" << endl;
-         cerr << "  -c 3   equivalent to --bl-transients" << endl;
-         cerr << "  -c 4   default processing options" << endl;
-         cerr << "  -c 5   equivalent to --no-lamination --window-short (may be good for drums)" << endl;
+         cerr << "  -c 1   equivalent to --detector-soft --no-lamination --window-long (for piano)" << endl;
+         cerr << "  -c 2   equivalent to --no-transients --no-lamination" << endl;
+         cerr << "  -c 3   equivalent to --no-transients" << endl;
+         cerr << "  -c 4   equivalent to --bl-transients" << endl;
+         cerr << "  -c 5   default processing options" << endl;
+         cerr << "  -c 6   equivalent to --no-lamination --window-short (may be good for drums)" << endl;
          cerr << endl;
  	return 2;
      }
@@@ -219,28 -257,70 +262,70 @@@
      }
  
      switch (crispness) {
-     case -1: crispness = 4; break;
-     case 0: transients = NoTransients; lamination = false; longwin = true; shortwin = false; break;
-     case 1: transients = NoTransients; lamination = false; longwin = false; shortwin = false; break;
-     case 2: transients = NoTransients; lamination = true; longwin = false; shortwin = false; break;
-     case 3: transients = BandLimitedTransients; lamination = true; longwin = false; shortwin = false; break;
-     case 4: transients = Transients; lamination = true; longwin = false; shortwin = false; break;
-     case 5: transients = Transients; lamination = false; longwin = false; shortwin = true; break;
+     case -1: crispness = 5; break;
+     case 0: detector = CompoundDetector; transients = NoTransients; lamination = false; longwin = true; shortwin = false; break;
+     case 1: detector = SoftDetector; transients = Transients; lamination = false; longwin = true; shortwin = false; break;
+     case 2: detector = CompoundDetector; transients = NoTransients; lamination = false; longwin = false; shortwin = false; break;
+     case 3: detector = CompoundDetector; transients = NoTransients; lamination = true; longwin = false; shortwin = false; break;
+     case 4: detector = CompoundDetector; transients = BandLimitedTransients; lamination = true; longwin = false; shortwin = false; break;
+     case 5: detector = CompoundDetector; transients = Transients; lamination = true; longwin = false; shortwin = false; break;
+     case 6: detector = CompoundDetector; transients = Transients; lamination = false; longwin = false; shortwin = true; break;
      };
  
      if (!quiet) {
          cerr << "Using crispness level: " << crispness << " (";
          switch (crispness) {
          case 0: cerr << "Mushy"; break;
-         case 1: cerr << "Smooth"; break;
-         case 2: cerr << "Balanced multitimbral mixture"; break;
-         case 3: cerr << "Unpitched percussion with stable notes"; break;
-         case 4: cerr << "Crisp monophonic instrumental"; break;
-         case 5: cerr << "Unpitched solo percussion"; break;
+         case 1: cerr << "Piano"; break;
+         case 2: cerr << "Smooth"; break;
+         case 3: cerr << "Balanced multitimbral mixture"; break;
+         case 4: cerr << "Unpitched percussion with stable notes"; break;
+         case 5: cerr << "Crisp monophonic instrumental"; break;
+         case 6: cerr << "Unpitched solo percussion"; break;
          }
          cerr << ")" << endl;
      }
  
+     std::map<size_t, size_t> mapping;
+     
+     if (mapfile != "") {
+         std::ifstream ifile(mapfile.c_str());
+         if (!ifile.is_open()) {
+             cerr << "ERROR: Failed to open time map file \"" << mapfile << "\""
+                  << endl;
+             return 1;
+         }
+         std::string line;
+         int lineno = 0;
+         while (!ifile.eof()) {
+             std::getline(ifile, line);
+             while (line.length() > 0 && line[0] == ' ') line = line.substr(1);
+             if (line == "") {
+                 ++lineno;
+                 continue;
+             }
+             std::string::size_type i = line.find_first_of(" ");
+             if (i == std::string::npos) {
+                 cerr << "ERROR: Time map file \"" << mapfile
+                      << "\" is malformed at line " << lineno << endl;
+                 return 1;
+             }
+             size_t source = atoi(line.substr(0, i).c_str());
+             while (i < line.length() && line[i] == ' ') ++i;
+             size_t target = atoi(line.substr(i).c_str());
+             mapping[source] = target;
+             if (debug > 0) {
+                 cerr << "adding mapping from " << source << " to " << target << endl;
+             }
+             ++lineno;
+         }
+         ifile.close();
+ 
+         if (!quiet) {
+             cerr << "Read " << mapping.size() << " line(s) from map file" << endl;
+         }
+     }
+ 
      char *fileName = strdup(argv[optind++]);
      char *fileNameOut = strdup(argv[optind++]);
  
@@@ -289,8 -369,10 +374,10 @@@
      if (!lamination) options |= RubberBandStretcher::OptionPhaseIndependent;
      if (longwin)     options |= RubberBandStretcher::OptionWindowLong;
      if (shortwin)    options |= RubberBandStretcher::OptionWindowShort;
+     if (smoothing)   options |= RubberBandStretcher::OptionSmoothingOn;
      if (formant)     options |= RubberBandStretcher::OptionFormantPreserved;
      if (hqpitch)     options |= RubberBandStretcher::OptionPitchHighQuality;
+     if (together)    options |= RubberBandStretcher::OptionChannelsTogether;
  
      switch (threading) {
      case 0:
@@@ -316,6 -398,18 +403,18 @@@
          break;
      }
  
+     switch (detector) {
+     case CompoundDetector:
+         options |= RubberBandStretcher::OptionDetectorCompound;
+         break;
+     case PercussiveDetector:
+         options |= RubberBandStretcher::OptionDetectorPercussive;
+         break;
+     case SoftDetector:
+         options |= RubberBandStretcher::OptionDetectorSoft;
+         break;
+     }
+ 
      if (pitchshift != 0.0) {
          frequencyshift *= pow(2.0, pitchshift / 12);
      }
@@@ -388,6 -482,10 +487,10 @@@
  
      frame = 0;
      percent = 0;
+ 
+     if (!mapping.empty()) {
+         ts.setKeyFrameMap(mapping);
+     }
      
      size_t countIn = 0, countOut = 0;
  
@@@ -408,6 -506,10 +511,10 @@@
  
          bool final = (frame + ibs >= sfinfo.frames);
  
+         if (debug > 2) {
+             cerr << "count = " << count << ", ibs = " << ibs << ", frame = " << frame << ", frames = " << sfinfo.frames << ", final = " << final << endl;
+         }
+ 
          ts.process(ibuf, count, final);
  
          int avail = ts.available();
@@@ -522,7 -624,7 +629,7 @@@
          cerr << "elapsed time: " << sec << " sec, in frames/sec: " << countIn/sec << ", out frames/sec: " << countOut/sec << endl;
      }
  
-     Profiler::dump();
+     RubberBand::Profiler::dump();
  
      return 0;
  }
diff --combined rubberband/RubberBandStretcher.h
index 10c62d5,a1d75a7..941e3b7
--- a/rubberband/RubberBandStretcher.h
+++ b/rubberband/RubberBandStretcher.h
@@@ -3,7 -3,7 +3,7 @@@
  /*
      Rubber Band
      An audio time-stretching and pitch-shifting library.
-     Copyright 2007-2008 Chris Cannam.
+     Copyright 2007-2011 Chris Cannam.
      
      This program is free software; you can redistribute it and/or
      modify it under the terms of the GNU General Public License as
@@@ -15,11 -15,12 +15,15 @@@
  #ifndef _RUBBERBANDSTRETCHER_H_
  #define _RUBBERBANDSTRETCHER_H_
      
- #define RUBBERBAND_VERSION "1.3.0-gpl"    
+ #define RUBBERBAND_VERSION "1.7-gpl"
  #define RUBBERBAND_API_MAJOR_VERSION 2
- #define RUBBERBAND_API_MINOR_VERSION 0
+ #define RUBBERBAND_API_MINOR_VERSION 5
  
  #include <vector>
++<<<<<<< HEAD
++=======
+ #include <map>
++>>>>>>> upstream/1.7.0
  #include <cstddef>
  
  /**
@@@ -27,7 -28,7 +31,7 @@@
   * 
   * The Rubber Band API is contained in the single class
   * RubberBand::RubberBandStretcher.
-  *
+  * 
   * Threading notes for real-time applications:
   * 
   * Multiple instances of RubberBandStretcher may be created and used
@@@ -109,7 -110,9 +113,9 @@@ public
       *   percussive event).  This, the default setting, usually
       *   results in a clear-sounding output; but it is not always
       *   consistent, and may cause interruptions in stable sounds
-      *   present at the same time as transient events.
+      *   present at the same time as transient events.  The
+      *   OptionDetector flags (below) can be used to tune this to some
+      *   extent.
       *
       *   \li \c OptionTransientsMixed - Reset component phases at the
       *   peak of each transient, outside a frequency range typical of
@@@ -124,7 -127,25 +130,25 @@@
       *   but may be less clear than with either of the other
       *   transients flags.
       *
-      * 4. Flags prefixed \c OptionPhase control the adjustment of
+      * 4. Flags prefixed \c OptionDetector control the type of
+      * transient detector used.  These options may be changed
+      * after construction when running in real-time mode, but not when
+      * running in offline mode.
+      *
+      *   \li \c OptionDetectorCompound - Use a general-purpose
+      *   transient detector which is likely to be good for most
+      *   situations.  This is the default.
+      *
+      *   \li \c OptionDetectorPercussive - Detect percussive
+      *   transients.  Note that this was the default and only option
+      *   in Rubber Band versions prior to 1.5.
+      *
+      *   \li \c OptionDetectorSoft - Use an onset detector with less
+      *   of a bias toward percussive transients.  This may give better
+      *   results with certain material (e.g. relatively monophonic
+      *   piano music).
+      *
+      * 5. Flags prefixed \c OptionPhase control the adjustment of
       * component frequency phases from one analysis window to the next
       * during non-transient segments.  These options may be changed at
       * any time.
@@@ -139,7 -160,7 +163,7 @@@
       *   frequency bin independently from its neighbours.  This
       *   usually results in a slightly softer, phasier sound.
       *
-      * 5. Flags prefixed \c OptionThreading control the threading
+      * 6. Flags prefixed \c OptionThreading control the threading
       * model of the stretcher.  These options may not be changed after
       * construction.
       *
@@@ -147,7 -168,8 +171,8 @@@
       *   determine its own threading model.  Usually this means using
       *   one processing thread per audio channel in offline mode if
       *   the stretcher is able to determine that more than one CPU is
-      *   available, and one thread only in realtime mode.
+      *   available, and one thread only in realtime mode.  This is the
+      *   defafult.
       *
       *   \li \c OptionThreadingNever - Never use more than one thread.
       *  
@@@ -155,7 -177,7 +180,7 @@@
       *   situation where \c OptionThreadingAuto would do so, except omit
       *   the check for multiple CPUs and instead assume it to be true.
       *
-      * 6. Flags prefixed \c OptionWindow control the window size for
+      * 7. Flags prefixed \c OptionWindow control the window size for
       * FFT processing.  The window size actually used will depend on
       * many factors, but it can be influenced.  These options may not
       * be changed after construction.
@@@ -173,20 -195,33 +198,33 @@@
       *   likely to result in a smoother sound at the expense of
       *   clarity and timing.
       *
-      * 7. Flags prefixed \c OptionFormant control the handling of
+      * 8. Flags prefixed \c OptionSmoothing control the use of
+      * window-presum FFT and time-domain smoothing.  These options may
+      * not be changed after construction.
+      *
+      *   \li \c OptionSmoothingOff - Do not use time-domain smoothing.
+      *   This is the default.
+      *
+      *   \li \c OptionSmoothingOn - Use time-domain smoothing.  This
+      *   will result in a softer sound with some audible artifacts
+      *   around sharp transients, but it may be appropriate for longer
+      *   stretches of some instruments and can mix well with
+      *   OptionWindowShort.
+      *
+      * 9. Flags prefixed \c OptionFormant control the handling of
       * formant shape (spectral envelope) when pitch-shifting.  These
       * options may be changed at any time.
       *
       *   \li \c OptionFormantShifted - Apply no special formant
       *   processing.  The spectral envelope will be pitch shifted as
-      *   normal.
+      *   normal.  This is the default.
       *
       *   \li \c OptionFormantPreserved - Preserve the spectral
       *   envelope of the unshifted signal.  This permits shifting the
       *   note frequency without so substantially affecting the
       *   perceived pitch profile of the voice or instrument.
       *
-      * 8. Flags prefixed \c OptionPitch control the method used for
+      * 10. Flags prefixed \c OptionPitch control the method used for
       * pitch shifting.  These options may be changed at any time.
       * They are only effective in realtime mode; in offline mode, the
       * pitch-shift method is fixed.
@@@ -194,7 -229,7 +232,7 @@@
       *   \li \c OptionPitchHighSpeed - Use a method with a CPU cost
       *   that is relatively moderate and predictable.  This may
       *   sound less clear than OptionPitchHighQuality, especially
-      *   for large pitch shifts. 
+      *   for large pitch shifts.  This is the default.
  
       *   \li \c OptionPitchHighQuality - Use the highest quality
       *   method for pitch shifting.  This method has a CPU cost
@@@ -206,6 -241,26 +244,26 @@@
       *   options, this avoids discontinuities when moving across the
       *   1.0 pitch scale in real-time; it also consumes more CPU than
       *   the others in the case where the pitch scale is exactly 1.0.
+      *
+      * 11. Flags prefixed \c OptionChannels control the method used for
+      * processing two-channel audio.  These options may not be changed
+      * after construction.
+      *
+      *   \li \c OptionChannelsApart - Each channel is processed
+      *   individually, though timing is synchronised and phases are
+      *   synchronised at transients (depending on the OptionTransients
+      *   setting).  This gives the highest quality for the individual
+      *   channels but a relative lack of stereo focus and unrealistic
+      *   increase in "width".  This is the default.
+      *
+      *   \li \c OptionChannelsTogether - The first two channels (where
+      *   two or more are present) are considered to be a stereo pair
+      *   and are processed in mid-side format; mid and side are
+      *   processed individually, with timing synchronised and phases
+      *   synchronised at transients (depending on the OptionTransients
+      *   setting).  This usually leads to better focus in the centre
+      *   but a loss of stereo space and width.  Any channels beyond
+      *   the first two are processed individually.
       */
      
      enum Option {
@@@ -220,6 -275,10 +278,10 @@@
          OptionTransientsMixed      = 0x00000100,
          OptionTransientsSmooth     = 0x00000200,
  
+         OptionDetectorCompound     = 0x00000000,
+         OptionDetectorPercussive   = 0x00000400,
+         OptionDetectorSoft         = 0x00000800,
+ 
          OptionPhaseLaminar         = 0x00000000,
          OptionPhaseIndependent     = 0x00002000,
      
@@@ -231,12 -290,20 +293,20 @@@
          OptionWindowShort          = 0x00100000,
          OptionWindowLong           = 0x00200000,
  
+         OptionSmoothingOff         = 0x00000000,
+         OptionSmoothingOn          = 0x00800000,
+ 
          OptionFormantShifted       = 0x00000000,
          OptionFormantPreserved     = 0x01000000,
  
          OptionPitchHighSpeed       = 0x00000000,
          OptionPitchHighQuality     = 0x02000000,
-         OptionPitchHighConsistency = 0x04000000
+         OptionPitchHighConsistency = 0x04000000,
+ 
+         OptionChannelsApart        = 0x00000000,
+         OptionChannelsTogether     = 0x10000000,
+ 
+         // n.b. Options is int, so we must stop before 0x80000000
      };
  
      typedef int Options;
@@@ -350,6 -417,14 +420,14 @@@
      void setTransientsOption(Options options);
  
      /**
+      * Change an OptionDetector configuration setting.  This may be
+      * called at any time in RealTime mode.  It may not be called in
+      * Offline mode (for which the detector option is fixed on
+      * construction).
+      */
+     void setDetectorOption(Options options);
+ 
+     /**
       * Change an OptionPhase configuration setting.  This may be
       * called at any time in any mode.
       *
@@@ -387,37 -462,77 +465,77 @@@
      void setExpectedInputDuration(size_t samples);
  
      /**
-      * Ask the stretcher how many audio sample frames should be
-      * provided as input in order to ensure that some more output
-      * becomes available.  Normal usage consists of querying this
-      * function, providing that number of samples to process(),
-      * reading the output using available() and retrieve(), and then
-      * repeating.
+      * Tell the stretcher the maximum number of sample frames that you
+      * will ever be passing in to a single process() call.  If you
+      * don't call this, the stretcher will assume that you are calling
+      * getSamplesRequired() at each cycle and are never passing more
+      * samples than are suggested by that function.
+      *
+      * If your application has some external constraint that means you
+      * prefer a fixed block size, then your normal mode of operation
+      * would be to provide that block size to this function; to loop
+      * calling process() with that size of block; after each call to
+      * process(), test whether output has been generated by calling
+      * available(); and, if so, call retrieve() to obtain it.  See
+      * getSamplesRequired() for a more suitable operating mode for
+      * applications without such external constraints.
+      *
+      * This function may not be called after the first call to study()
+      * or process().
       *
       * Note that this value is only relevant to process(), not to
       * study() (to which you may pass any number of samples at a time,
       * and from which there is no output).
       */
-      size_t getSamplesRequired() const;
+     void setMaxProcessSize(size_t samples);
  
      /**
-      * Tell the stretcher the maximum number of sample frames that you
-      * will ever be passing in to a single process() call. If you
-      * don't call this function, the stretcher will assume that you
-      * never pass in more samples than getSamplesRequired() suggested
-      * you should.  You should not pass in more samples than that
-      * unless you have called setMaxProcessSize first.
-      *
-      * This function may not be called after the first call to study()
-      * or process().
+      * Ask the stretcher how many audio sample frames should be
+      * provided as input in order to ensure that some more output
+      * becomes available.
+      * 
+      * If your application has no particular constraint on processing
+      * block size and you are able to provide any block size as input
+      * for each cycle, then your normal mode of operation would be to
+      * loop querying this function; providing that number of samples
+      * to process(); and reading the output using available() and
+      * retrieve().  See setMaxProcessSize() for a more suitable
+      * operating mode for applications that do have external block
+      * size constraints.
       *
       * Note that this value is only relevant to process(), not to
       * study() (to which you may pass any number of samples at a time,
       * and from which there is no output).
       */
-     void setMaxProcessSize(size_t samples);
+      size_t getSamplesRequired() const;
  
      /**
+      * Provide a set of mappings from "before" to "after" sample
+      * numbers so as to enforce a particular stretch profile.  The
+      * argument is a map from audio sample frame number in the source
+      * material, to the corresponding sample frame number in the
+      * stretched output.  The mapping should be for key frames only,
+      * with a "reasonable" gap between mapped samples.
+      *
+      * This function cannot be used in RealTime mode.
+      *
+      * This function may not be called after the first call to
+      * process().  It should be called after the time and pitch ratios
+      * have been set; the results of changing the time and pitch
+      * ratios after calling this function are undefined.  Calling
+      * reset() will clear this mapping.
+      *
+      * The key frame map only affects points within the material; it
+      * does not determine the overall stretch ratio (that is, the
+      * ratio between the output material's duration and the source
+      * material's duration).  You need to provide this ratio
+      * separately to setTimeRatio(), otherwise the results may be
+      * truncated or extended in unexpected ways regardless of the
+      * extent of the frame numbers found in the key frame map.
+      */
+     void setKeyFrameMap(const std::map<size_t, size_t> &);
+     
+     /**
       * Provide a block of "samples" sample frames for the stretcher to
       * study and calculate a stretch profile from.
       *
diff --combined vamp/RubberBandVampPlugin.cpp
index a3dbbd4,ca1a76a..9942be6
--- a/vamp/RubberBandVampPlugin.cpp
+++ b/vamp/RubberBandVampPlugin.cpp
@@@ -3,7 -3,7 +3,7 @@@
  /*
      Rubber Band
      An audio time-stretching and pitch-shifting library.
-     Copyright 2007-2008 Chris Cannam.
+     Copyright 2007-2011 Chris Cannam.
      
      This program is free software; you can redistribute it and/or
      modify it under the terms of the GNU General Public License as
@@@ -15,10 -15,10 +15,11 @@@
  #include "RubberBandVampPlugin.h"
  
  #include "StretchCalculator.h"
- #include "sysutils.h"
+ #include "system/sysutils.h"
  
 +#include <cstdio>
  #include <cmath>
+ #include <cstdio>
  
  using std::string;
  using std::vector;
@@@ -301,7 -301,7 +302,7 @@@ RubberBandVampPlugin::getParameterDescr
      d.isQuantized = true;
      d.quantizeStep = 1;
      d.valueNames.clear();
-     d.valueNames.push_back("Peak Locked");
+     d.valueNames.push_back("Laminar");
      d.valueNames.push_back("Independent");
      list.push_back(d);
  
@@@ -406,8 -406,6 +407,6 @@@ RubberBandVampPlugin::initialise(size_
  void
  RubberBandVampPlugin::reset()
  {
- //    delete m_stretcher;  //!!! or just if (m_stretcher) m_stretcher->reset();
- //    m_stretcher = new RubberBand::RubberBandStretcher(lrintf(m_inputSampleRate), channels);
      if (m_d->m_stretcher) m_d->m_stretcher->reset();
  }
  
@@@ -456,9 -454,7 +455,7 @@@ RubberBandVampPlugin::Impl::getRemainin
  
      int rate = m_sampleRate;
  
-     RubberBand::StretchCalculator sc(rate,
-                                      m_stretcher->getInputIncrement(),
-                                      true);
+     RubberBand::StretchCalculator sc(rate, m_stretcher->getInputIncrement(), true);
  
      size_t inputIncrement = m_stretcher->getInputIncrement();
      std::vector<int> outputIncrements = m_stretcher->getOutputIncrements();

-- 
rubberband packaging



More information about the pkg-multimedia-commits mailing list