Skip to content

Commit 6bc72c9

Browse files
committed
Changed build rules
1 parent 998ab51 commit 6bc72c9

4 files changed

Lines changed: 55 additions & 35 deletions

File tree

src/maxmsp/1dSAV/source/projects/1dSAV.CubicString/CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Copyright 2018 The Min-DevKit Authors. All rights reserved.
2-
# Use of this source code is governed by the MIT License found in the License.md file.
3-
41
cmake_minimum_required(VERSION 3.10)
52

63
set(C74_MIN_API_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../min-api)
@@ -50,8 +47,17 @@ target_link_libraries(
5047
include(${C74_MIN_API_DIR}/script/min-posttarget.cmake)
5148

5249

53-
#############################################################
54-
# UNIT TEST
55-
#############################################################
56-
57-
include(${C74_MIN_API_DIR}/test/min-object-unittest.cmake)
50+
# Optimisation flags
51+
if(NOT MSVC)
52+
target_compile_options(${PROJECT_NAME} PRIVATE
53+
-O3
54+
-march=native
55+
-ffast-math
56+
-funroll-loops
57+
-fno-omit-frame-pointer
58+
)
59+
target_compile_definitions(${PROJECT_NAME} PRIVATE
60+
EIGEN_NO_DEBUG
61+
EIGEN_DONT_PARALLELIZE
62+
)
63+
endif()

src/processor/StringProcessor.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -286,30 +286,30 @@ std::tuple<T, T, T> StringProcessor<T>::process(T input, T bend, T posex,
286286
T t60_0)
287287
{
288288
// Eigen::internal::set_is_malloc_allowed(false);
289-
// Pitch bend
290-
// if (bend != this->bend)
291-
// {
292-
// this->bend = bend;
293-
// modifyhFromBend();
294-
// updateCoefficients();
295-
// }
296-
// // Excitation and listening positions
297-
// if (posex != this->posex || poslistL != this->poslistL ||
298-
// poslistR != this->poslistR)
299-
// {
300-
// this->posex = std::clamp(posex, T(0), T(1));
301-
// this->poslistL = std::clamp(poslistL, T(0), T(1));
302-
// this->poslistR = std::clamp(poslistR, T(0), T(1));
303-
// }
304-
// // Modify damping from t60_0. Only eta_0 is modified to preserve stability.
305-
// // F60_0 is considered to be zero here.
306-
// if (t60_0 != this->t60_0 && t60_0 > 1e-4)
307-
// {
308-
// this->t60_0 = t60_0;
309-
// this->eta_0 = 3 * log(10) / (t60_0);
310-
311-
// updateCoefficients();
312-
// }
289+
// Pitch bend
290+
if (bend != this->bend)
291+
{
292+
this->bend = bend;
293+
modifyhFromBend();
294+
updateCoefficients();
295+
}
296+
// Excitation and listening positions
297+
if (posex != this->posex || poslistL != this->poslistL ||
298+
poslistR != this->poslistR)
299+
{
300+
this->posex = std::clamp(posex, T(0), T(1));
301+
this->poslistL = std::clamp(poslistL, T(0), T(1));
302+
this->poslistR = std::clamp(poslistR, T(0), T(1));
303+
}
304+
// Modify damping from t60_0. Only eta_0 is modified to preserve stability.
305+
// F60_0 is considered to be zero here.
306+
if (t60_0 != this->t60_0 && t60_0 > 1e-4)
307+
{
308+
this->t60_0 = t60_0;
309+
this->eta_0 = 3 * log(10) / (t60_0);
310+
311+
updateCoefficients();
312+
}
313313

314314
// Compute g (dependant on the nonlinear mode => value of nl)
315315
computeVAndVprime();

src/processor/StringProcessor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class StringProcessor
4242
Eigen::Vector<T, -1> qlast, qnow, qnext;
4343

4444
// Intermediary variables
45-
double A0_inv;
45+
T A0_inv;
4646

4747
// Excitation and listening positions
4848
T posex{0}, poslistL{0}, poslistR{0};

src/timing/CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,19 @@ target_link_libraries(
3333
Eigen3::Eigen
3434
)
3535

36-
37-
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
36+
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
37+
38+
# Optimisation flags
39+
if(NOT MSVC)
40+
target_compile_options(${PROJECT_NAME} PRIVATE
41+
-O3
42+
-march=native
43+
-ffast-math
44+
-funroll-loops
45+
-fno-omit-frame-pointer
46+
)
47+
target_compile_definitions(${PROJECT_NAME} PRIVATE
48+
EIGEN_NO_DEBUG
49+
EIGEN_DONT_PARALLELIZE
50+
)
51+
endif()

0 commit comments

Comments
 (0)