CMake for example command-line util
This commit is contained in:
parent
27d580fceb
commit
9bffc80ec8
13
CMakeLists.txt
Normal file
13
CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.24)
|
||||||
|
project(example-cmd VERSION 1.0.0)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
add_executable(stretch ${CMAKE_CURRENT_SOURCE_DIR}/cmd/main.cpp)
|
||||||
|
|
||||||
|
#if(WIN32)
|
||||||
|
# find_package(IPP)
|
||||||
|
# if(IPP_FOUND)
|
||||||
|
# message(STATUS "Found ipp!")
|
||||||
|
# target_link_libraries(example-cmd PRIVATE IPP::ippcore IPP::ipps IPP::ippi)
|
||||||
|
# target_compile_definitions(stretch PRIVATE SIGNALSMITH_USE_IPP)
|
||||||
|
# endif()
|
||||||
|
#endif()
|
||||||
@ -28,7 +28,7 @@ int main(int argc, char* argv[]) {
|
|||||||
outWav.sampleRate = inWav.sampleRate;
|
outWav.sampleRate = inWav.sampleRate;
|
||||||
int outputLength = std::round(inputLength*time);
|
int outputLength = std::round(inputLength*time);
|
||||||
|
|
||||||
signalsmith::stretch::SignalsmithStretch<float> stretch;
|
signalsmith::stretch::SignalsmithStretch<float, std::mt19937> stretch;
|
||||||
stretch.presetDefault(inWav.channels, inWav.sampleRate);
|
stretch.presetDefault(inWav.channels, inWav.sampleRate);
|
||||||
stretch.setTransposeSemitones(semitones, tonality/inWav.sampleRate);
|
stretch.setTransposeSemitones(semitones, tonality/inWav.sampleRate);
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ SIGNALSMITH_DSP_VERSION_CHECK(1, 6, 0); // Check version is compatible
|
|||||||
|
|
||||||
namespace signalsmith { namespace stretch {
|
namespace signalsmith { namespace stretch {
|
||||||
|
|
||||||
template<typename Sample=float>
|
template<typename Sample=float, class RandomEngine=std::default_random_engine>
|
||||||
struct SignalsmithStretch {
|
struct SignalsmithStretch {
|
||||||
|
|
||||||
SignalsmithStretch() : randomEngine(std::random_device{}()) {}
|
SignalsmithStretch() : randomEngine(std::random_device{}()) {}
|
||||||
@ -394,8 +394,8 @@ private:
|
|||||||
Prediction * predictionsForChannel(int c) {
|
Prediction * predictionsForChannel(int c) {
|
||||||
return channelPredictions.data() + c*bands;
|
return channelPredictions.data() + c*bands;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::default_random_engine randomEngine;
|
RandomEngine randomEngine;
|
||||||
|
|
||||||
void processSpectrum(bool newSpectrum, Sample timeFactor) {
|
void processSpectrum(bool newSpectrum, Sample timeFactor) {
|
||||||
timeFactor = std::max<Sample>(timeFactor, 1/maxCleanStretch);
|
timeFactor = std::max<Sample>(timeFactor, 1/maxCleanStretch);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user