Skip to content

Commit

Permalink
Disable Gaia and Tensorflow algorithms if libraries are not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
wo80 committed Jun 16, 2024
1 parent 55a97df commit f8af65a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
16 changes: 16 additions & 0 deletions src/algorithms/essentia_algorithms_reg_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include "algorithms/extractor/lowlevelspectraleqloudextractor.h"
#include "algorithms/extractor/lowlevelspectralextractor.h"
#include "algorithms/extractor/musicextractor.h"
#if ENABLE_GAIA2
#include "algorithms/extractor/musicextractorsvm.h"
#endif
#include "algorithms/extractor/rhythmdescriptors.h"
#include "algorithms/extractor/tonalextractor.h"
#include "algorithms/extractor/tuningfrequencyextractor.h"
Expand Down Expand Up @@ -96,7 +98,9 @@
#include "algorithms/rhythm/superfluxextractor.h"
#include "algorithms/rhythm/superfluxnovelty.h"
#include "algorithms/rhythm/superfluxpeaks.h"
#if ENABLE_TENSORFLOW
#include "algorithms/rhythm/tempocnn.h"
#endif
#include "algorithms/rhythm/temposcalebands.h"
#include "algorithms/rhythm/tempotap.h"
#include "algorithms/rhythm/tempotapdegara.h"
Expand Down Expand Up @@ -283,7 +287,9 @@
#include "algorithms/tonal/pitchcontoursmelody.h"
#include "algorithms/tonal/pitchcontoursmonomelody.h"
#include "algorithms/tonal/pitchcontoursmultimelody.h"
#if ENABLE_TENSORFLOW
#include "algorithms/tonal/pitchcrepe.h"
#endif
#include "algorithms/tonal/pitchfilter.h"
#include "algorithms/tonal/pitchmelodia.h"
#include "algorithms/tonal/pitchsaliencefunction.h"
Expand Down Expand Up @@ -325,7 +331,9 @@ ESSENTIA_API void registerAlgorithm() {
AlgorithmFactory::Registrar<LowLevelSpectralEqloudExtractor> regLowLevelSpectralEqloudExtractor;
AlgorithmFactory::Registrar<LowLevelSpectralExtractor> regLowLevelSpectralExtractor;
AlgorithmFactory::Registrar<MusicExtractor> regMusicExtractor;
#if ENABLE_GAIA2
AlgorithmFactory::Registrar<MusicExtractorSVM> regMusicExtractorSVM;
#endif
AlgorithmFactory::Registrar<RhythmDescriptors> regRhythmDescriptors;
AlgorithmFactory::Registrar<TonalExtractor> regTonalExtractor;
AlgorithmFactory::Registrar<TuningFrequencyExtractor> regTuningFrequencyExtractor;
Expand Down Expand Up @@ -397,7 +405,9 @@ ESSENTIA_API void registerAlgorithm() {
AlgorithmFactory::Registrar<SuperFluxExtractor> regSuperFluxExtractor;
AlgorithmFactory::Registrar<SuperFluxNovelty> regSuperFluxNovelty;
AlgorithmFactory::Registrar<SuperFluxPeaks> regSuperFluxPeaks;
#if ENABLE_TENSORFLOW
AlgorithmFactory::Registrar<TempoCNN> regTempoCNN;
#endif
AlgorithmFactory::Registrar<TempoScaleBands> regTempoScaleBands;
AlgorithmFactory::Registrar<TempoTap> regTempoTap;
AlgorithmFactory::Registrar<TempoTapDegara> regTempoTapDegara;
Expand Down Expand Up @@ -576,7 +586,9 @@ ESSENTIA_API void registerAlgorithm() {
AlgorithmFactory::Registrar<PitchContoursMelody> regPitchContoursMelody;
AlgorithmFactory::Registrar<PitchContoursMonoMelody> regPitchContoursMonoMelody;
AlgorithmFactory::Registrar<PitchContoursMultiMelody> regPitchContoursMultiMelody;
#if ENABLE_TENSORFLOW
AlgorithmFactory::Registrar<PitchCREPE> regPitchCREPE;
#endif
AlgorithmFactory::Registrar<PitchFilter> regPitchFilter;
AlgorithmFactory::Registrar<PitchMelodia> regPitchMelodia;
AlgorithmFactory::Registrar<PitchSalienceFunction> regPitchSalienceFunction;
Expand Down Expand Up @@ -680,7 +692,9 @@ ESSENTIA_API void registerAlgorithm() {
AlgorithmFactory::Registrar<SuperFluxExtractor, essentia::standard::SuperFluxExtractor> regSuperFluxExtractor;
AlgorithmFactory::Registrar<SuperFluxNovelty, essentia::standard::SuperFluxNovelty> regSuperFluxNovelty;
AlgorithmFactory::Registrar<SuperFluxPeaks, essentia::standard::SuperFluxPeaks> regSuperFluxPeaks;
#if ENABLE_TENSORFLOW
AlgorithmFactory::Registrar<TempoCNN, essentia::standard::TempoCNN> regTempoCNN;
#endif
AlgorithmFactory::Registrar<TempoScaleBands, essentia::standard::TempoScaleBands> regTempoScaleBands;
AlgorithmFactory::Registrar<TempoTap, essentia::standard::TempoTap> regTempoTap;
AlgorithmFactory::Registrar<TempoTapDegara, essentia::standard::TempoTapDegara> regTempoTapDegara;
Expand Down Expand Up @@ -864,7 +878,9 @@ ESSENTIA_API void registerAlgorithm() {
AlgorithmFactory::Registrar<PitchContoursMelody, essentia::standard::PitchContoursMelody> regPitchContoursMelody;
AlgorithmFactory::Registrar<PitchContoursMonoMelody, essentia::standard::PitchContoursMonoMelody> regPitchContoursMonoMelody;
AlgorithmFactory::Registrar<PitchContoursMultiMelody, essentia::standard::PitchContoursMultiMelody> regPitchContoursMultiMelody;
#if ENABLE_TENSORFLOW
AlgorithmFactory::Registrar<PitchCREPE, essentia::standard::PitchCREPE> regPitchCREPE;
#endif
AlgorithmFactory::Registrar<PitchFilter, essentia::standard::PitchFilter> regPitchFilter;
AlgorithmFactory::Registrar<PitchMelodia, essentia::standard::PitchMelodia> regPitchMelodia;
AlgorithmFactory::Registrar<PitchSalienceFunction, essentia::standard::PitchSalienceFunction> regPitchSalienceFunction;
Expand Down
9 changes: 7 additions & 2 deletions src/algorithms/extractor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ target_sources(essentia
lowlevelspectraleqloudextractor.cpp
lowlevelspectralextractor.cpp
musicextractor.cpp
musicextractorsvm.cpp
rhythmdescriptors.cpp
tonalextractor.cpp
tuningfrequencyextractor.cpp
Expand All @@ -20,7 +19,13 @@ target_sources(essentia
lowlevelspectraleqloudextractor.h
lowlevelspectralextractor.h
musicextractor.h
musicextractorsvm.h
rhythmdescriptors.h
tonalextractor.h
tuningfrequencyextractor.h)

if(ESSENTIA_USE_GAIA2)
target_sources(essentia
PRIVATE
musicextractorsvm.cpp
musicextractorsvm.h)
endif()
9 changes: 7 additions & 2 deletions src/algorithms/rhythm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ target_sources(essentia
superfluxextractor.cpp
superfluxnovelty.cpp
superfluxpeaks.cpp
tempocnn.cpp
temposcalebands.cpp
tempotap.cpp
tempotapdegara.cpp
Expand Down Expand Up @@ -56,9 +55,15 @@ target_sources(essentia
superfluxextractor.h
superfluxnovelty.h
superfluxpeaks.h
tempocnn.h
temposcalebands.h
tempotap.h
tempotapdegara.h
tempotapmaxagreement.h
tempotapticks.h)

if(ESSENTIA_USE_TENSORFLOW)
target_sources(essentia
PRIVATE
tempocnn.cpp
tempocnn.h)
endif()
9 changes: 7 additions & 2 deletions src/algorithms/tonal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ target_sources(essentia
pitchcontoursmelody.cpp
pitchcontoursmonomelody.cpp
pitchcontoursmultimelody.cpp
pitchcrepe.cpp
pitchfilter.cpp
pitchmelodia.cpp
pitchsaliencefunction.cpp
Expand Down Expand Up @@ -49,7 +48,6 @@ target_sources(essentia
pitchcontoursmelody.h
pitchcontoursmonomelody.h
pitchcontoursmultimelody.h
pitchcrepe.h
pitchfilter.h
pitchmelodia.h
pitchsaliencefunction.h
Expand All @@ -64,3 +62,10 @@ target_sources(essentia
tristimulus.h
tuningfrequency.h
vibrato.h)

if(ESSENTIA_USE_TENSORFLOW)
target_sources(essentia
PRIVATE
pitchcrepe.cpp
pitchcrepe.h)
endif()

0 comments on commit f8af65a

Please sign in to comment.