PitchAndTimeDemo with cmake does not properly enable time stretching (+ fix)

I noticed that when I built the PitchAndTimeDemo using the pip it works correctly when changing the pitch of the sample. However, when I built the examples using the generate_examples script in ~/tests, when you change the pitch it doesn’t throw an exception, but it just hangs indefinitely, including when trying to close the application.

Further investigation into the matter revealed that the pip has the following for preprocessor definitions:

TRACKTION_ENABLE_TIMESTRETCH_SOUNDTOUCH=1, JUCE_MODAL_LOOPS_PERMITTED=1, TRACKTION_BUILD_RUBBERBAND=1

In the CMakeLists.txt for the PitchAndTimeDemo it appears to be missing:

target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
    JUCE_PLUGINHOST_AU=1
    JUCE_PLUGINHOST_LADSPA=1
    JUCE_PLUGINHOST_VST3=1
    JUCE_USE_CURL=0
    JUCE_WEB_BROWSER=0
    JUCER_ENABLE_GPL_MODE=1
    JUCE_DISPLAY_SPLASH_SCREEN=0
    JUCE_REPORT_APP_USAGE=0
    JUCE_MODAL_LOOPS_PERMITTED=1
    JUCE_STRICT_REFCOUNTEDPOINTER=1)

Adding those preprocessor definitions back in and then rebuilding the examples with the build script fixed the issue:

target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
    JUCE_PLUGINHOST_AU=1
    JUCE_PLUGINHOST_LADSPA=1
    JUCE_PLUGINHOST_VST3=1
    JUCE_USE_CURL=0
    JUCE_WEB_BROWSER=0
    JUCER_ENABLE_GPL_MODE=1
    JUCE_DISPLAY_SPLASH_SCREEN=0
    JUCE_REPORT_APP_USAGE=0
    JUCE_MODAL_LOOPS_PERMITTED=1
    JUCE_STRICT_REFCOUNTEDPOINTER=1
    TRACKTION_ENABLE_TIMESTRETCH_SOUNDTOUCH=1
    TRACKTION_BUILD_RUBBERBAND=1)

I’m not sure what other examples use time stretching, but it might be worth checking over the CMakeLists.txt files to see if any other examples are missing these definitions.

Cheers.

Thanks. This should be fixed here now: Rubber Band: Fixed an issue building rubberband from source · Tracktion/tracktion_engine@25fb32d · GitHub

Tested and correctly builds with soundtouch now, cheers.