Skip to content

Commit f44612d

Browse files
feat: implement smoothed value class (#33)
## Summary Closes #32
1 parent 87ddd15 commit f44612d

39 files changed

Lines changed: 847 additions & 460 deletions

CMakeLists.txt

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ option(NEO_BUILD_TESTS "Build unit tests" OFF)
55

66
project(neuron VERSION 0.1.0 LANGUAGES CXX)
77

8-
file(GLOB_RECURSE LIST_DIRECTORIES INCLUDE_DIRS "src/*")
98
file(GLOB_RECURSE SRC_FILES "src/*.cpp")
109

1110
add_library(neuron STATIC ${SRC_FILES})
@@ -25,33 +24,36 @@ else()
2524
CXX_STANDARD_REQUIRED)
2625
endif ()
2726

27+
target_include_directories(neuron
28+
PUBLIC
29+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
30+
$<INSTALL_INTERFACE:include>
31+
PRIVATE
32+
${CMAKE_CURRENT_SOURCE_DIR}/src)
33+
2834
if (NEO_BUILD_TESTS)
2935
function(add_neuron_test name src)
3036
add_executable("${name}_test_exe" ${src})
31-
target_include_directories("${name}_test_exe" PRIVATE ${INCLUDE_DIRS})
32-
target_link_libraries("${name}_test_exe" neuron)
33-
target_link_libraries("${name}_test_exe" gtest gtest_main)
37+
target_link_libraries("${name}_test_exe" PRIVATE neuron gtest gtest_main)
3438
add_test(NAME "${name}_test" COMMAND "${name}_test_exe")
3539
endfunction()
3640

3741
add_subdirectory(vendor/googletest)
3842

3943
if (NEO_PLUGIN_SUPPORT)
40-
add_neuron_test(parameter_atomic tests/abstractions/parameter_test_atomic.cpp)
44+
add_neuron_test(parameter_atomic tests/core/parameter_test_atomic.cpp)
4145
else ()
42-
add_neuron_test(parameter tests/abstractions/parameter_test.cpp)
43-
add_neuron_test(waveform tests/audio/waveform_test.cpp)
44-
add_neuron_test(oscillator tests/generators/oscillator_test.cpp)
45-
add_neuron_test(adsr tests/modulators/adsr_test.cpp)
46-
add_neuron_test(saturator tests/processors/effects/saturator_test.cpp)
47-
add_neuron_test(wavefolder tests/processors/effects/wavefolder_test.cpp)
48-
add_neuron_test(filter tests/processors/filters/filter_test.cpp)
49-
add_neuron_test(arithmetic tests/utilities/arithmetic_test.cpp)
50-
add_neuron_test(midi tests/utilities/midi_test.cpp)
51-
add_neuron_test(smoothed_value tests/utilities/smoothed_value_test.cpp)
46+
add_neuron_test(parameter tests/core/parameter_test.cpp)
47+
add_neuron_test(waveform tests/utils/waveform_test.cpp)
48+
add_neuron_test(oscillator tests/dsp/generators/oscillator_test.cpp)
49+
add_neuron_test(adsr tests/dsp/modulators/adsr_test.cpp)
50+
add_neuron_test(saturator tests/dsp/processors/saturator_test.cpp)
51+
add_neuron_test(wavefolder tests/dsp/processors/wavefolder_test.cpp)
52+
add_neuron_test(filter tests/dsp/processors/filter_test.cpp)
53+
add_neuron_test(arithmetic tests/utils/arithmetic_test.cpp)
54+
add_neuron_test(midi tests/utils/midi_test.cpp)
55+
add_neuron_test(smoothed_value tests/utils/smoothed_value_test.cpp)
5256
endif ()
5357

5458
enable_testing()
5559
endif ()
56-
57-
target_include_directories(neuron PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src PRIVATE ${INCLUDE_DIRS})

Makefile

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,33 @@
11
TARGET = libneuron
22

3-
MODULE_DIR = src
3+
INCLUDE_DIR = include
4+
SRC_DIR = src
45

56
# Each Module Directory is listed below with it's modules.
67
# Header only modules are listed commented out
78
# below the others.
89

9-
ABSTRACTIONS_MOD_DIR = abstractions
10-
ABSTRACTIONS_MODULES = \
11-
12-
AUDIO_MOD_DIR = audio
13-
AUDIO_MODULES = \
14-
15-
GENERATOR_MOD_DIR = generators
10+
GENERATOR_MOD_DIR = dsp/generators
1611
GENERATOR_MODULES = \
1712
oscillator \
1813

19-
MODULATOR_MOD_DIR = modulators
14+
MODULATOR_MOD_DIR = dsp/modulators
2015
MODULATOR_MODULES = \
2116
adsr \
2217

23-
PROCESSOR_EFFECTS_MOD_DIR = processors/effects
24-
PROCESSOR_EFFECTS_MODULES = \
18+
PROCESSOR_MOD_DIR = dsp/processors
19+
PROCESSOR_MODULES = \
20+
filter \
2521
saturator \
2622
wavefolder \
2723

28-
PROCESSOR_FILTERS_MOD_DIR = processors/filters
29-
PROCESS_FILTERS_MODULES = \
30-
filter \
31-
32-
UTILITY_MOD_DIR = utilities
33-
UTILITY_MODULES = \
34-
logger
35-
3624
######################################
3725
# source
3826
######################################
3927

40-
CPP_SOURCES += $(addsuffix .cpp, $(MODULE_DIR)/$(GENERATOR_MOD_DIR)/$(GENERATOR_MODULES))
41-
CPP_SOURCES += $(addsuffix .cpp, $(MODULE_DIR)/$(MODULATOR_MOD_DIR)/$(MODULATOR_MODULES))
42-
CPP_SOURCES += $(addsuffix .cpp, $(MODULE_DIR)/$(PROCESSOR_EFFECTS_MOD_DIR)/$(PROCESSOR_EFFECTS_MODULES))
43-
CPP_SOURCES += $(addsuffix .cpp, $(MODULE_DIR)/$(PROCESSOR_FILTERS_MOD_DIR)/$(PROCESS_FILTERS_MODULES))
44-
CPP_SOURCES += $(addsuffix .cpp, $(MODULE_DIR)/$(UTILITY_MOD_DIR)/$(UTILITY_MODULES))
28+
CPP_SOURCES += $(addsuffix .cpp, $(SRC_DIR)/$(GENERATOR_MOD_DIR)/$(GENERATOR_MODULES))
29+
CPP_SOURCES += $(addsuffix .cpp, $(SRC_DIR)/$(MODULATOR_MOD_DIR)/$(MODULATOR_MODULES))
30+
CPP_SOURCES += $(addsuffix .cpp, $(SRC_DIR)/$(PROCESSOR_MOD_DIR)/$(PROCESSOR_MODULES))
4531

4632
######################################
4733
# building variables
@@ -114,14 +100,8 @@ C_DEFS = \
114100
-DSTM32H750xx
115101

116102
C_INCLUDES = \
117-
-I$(MODULE_DIR) \
118-
-I$(MODULE_DIR)/$(ABSTRACTIONS_MOD_DIR) \
119-
-I$(MODULE_DIR)/$(AUDIO_MOD_DIR) \
120-
-I$(MODULE_DIR)/$(GENERATOR_MOD_DIR) \
121-
-I$(MODULE_DIR)/$(MODULATOR_MOD_DIR) \
122-
-I$(MODULE_DIR)/$(PROCESSOR_EFFECTS_MOD_DIR) \
123-
-I$(MODULE_DIR)/$(PROCESSOR_FILTERS_MOD_DIR) \
124-
-I$(MODULE_DIR)/$(UTILITY_MOD_DIR) \
103+
-I$(INCLUDE_DIR) \
104+
-I$(SRC_DIR) \
125105

126106
# compile gcc flags
127107
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "audio/sample.h"
3+
#include "neuron/core/sample.h"
44

55
namespace neuron {
66

src/generators/oscillator.h renamed to include/neuron/dsp/generators/oscillator.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#pragma once
22

3-
#include "abstractions/generator.h"
4-
#include "abstractions/neuron.h"
5-
#include "abstractions/parameter.h"
6-
#include "audio/context.h"
7-
#include "audio/waveform.h"
8-
#include "utilities/arithmetic.h"
3+
#include "neuron/core/base.h"
4+
#include "neuron/core/context.h"
5+
#include "neuron/core/parameter.h"
6+
#include "neuron/dsp/generators/generator.h"
7+
#include "neuron/utils/arithmetic.h"
8+
#include "neuron/utils/waveform.h"
99

1010
namespace neuron {
1111

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#pragma once
22

3-
#include "abstractions/modulator.h"
4-
#include "abstractions/neuron.h"
5-
#include "abstractions/parameter.h"
6-
#include "audio/context.h"
3+
#include "neuron/core/base.h"
4+
#include "neuron/core/context.h"
5+
#include "neuron/core/parameter.h"
6+
#include "neuron/dsp/modulators/modulator.h"
77

88
namespace neuron {
99

0 commit comments

Comments
 (0)