Skip to content

Commit

Permalink
chore: rename project to neuron (#23)
Browse files Browse the repository at this point in the history
## Summary

`cortex` is to become another library with a different purpose while
`neuron` is more befitting for DSP building blocks that are used to
compose larger, more complex signal chains.

## Changelog

```
- Replace all usages of "cortex" with "neuron"
```
  • Loading branch information
maxwellmattryan authored Nov 12, 2024
1 parent 329041f commit d824754
Show file tree
Hide file tree
Showing 33 changed files with 79 additions and 118 deletions.
39 changes: 0 additions & 39 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,9 @@
## Summary

> Please summarize your changes, describing *what* they are and *why* they were made.
...

## Changelog

```
- Please write a list of changes
```

## Testing

### Instructions

> Please describe relevant instructions, configurations, etc. for testing your changes.
...

### Platforms

> Please select any platforms where your changes have been tested.
- **Desktop**
- [ ] MacOS
- [ ] Linux
- [ ] Windows
- **Mobile**
- [ ] iOS
- [ ] Android
- **Web**
- [ ] Chrome
- [ ] Firefox
- [ ] Brave
- [ ] Safari

## Checklist

> Please tick the following boxes that are relevant to your changes.
- [ ] I have followed the contribution guidelines for this project
- [ ] I have performed a self-review of my changes
- [ ] I have added or modified tests, proving my changes work as intended
- [ ] I have added comments to my code for hard-to-understand areas
- [ ] I have verified that new and existing unit tests pass locally with my changes
- [ ] I have verified that my latest changes pass CI workflows for testing and linting
- [ ] I have made corresponding changes to the documentation
10 changes: 5 additions & 5 deletions .github/workflows/ci.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
uses: actions/checkout@v4

- name: "Prepare"
working-directory: ${{runner.workspace}}/cortex
run: cmake -E make_directory ${{runner.workspace}}/cortex/target
working-directory: ${{runner.workspace}}/neuron
run: cmake -E make_directory ${{runner.workspace}}/neuron/target

- name: "Configure"
working-directory: ${{runner.workspace}}/cortex/target
run: cmake ${{runner.workspace}}/cortex
working-directory: ${{runner.workspace}}/neuron/target
run: cmake ${{runner.workspace}}/neuron

- name: "Build"
working-directory: ${{runner.workspace}}/cortex/target
working-directory: ${{runner.workspace}}/neuron/target
run: cmake --build .

Make:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
submodules: recursive

- name: "Prepare"
working-directory: ${{runner.workspace}}/cortex
working-directory: ${{runner.workspace}}/neuron
run: mkdir -p target/test

- name: "Generate Makefile"
working-directory: ${{runner.workspace}}/cortex/target/test
working-directory: ${{runner.workspace}}/neuron/target/test
run: cmake -DBUILD_TESTS=ON ../../

- name: "Build"
working-directory: ${{runner.workspace}}/cortex/target/test
working-directory: ${{runner.workspace}}/neuron/target/test
run: make

- name: "Test"
working-directory: ${{runner.workspace}}/cortex/target/test
working-directory: ${{runner.workspace}}/neuron/target/test
run: ctest
28 changes: 14 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14)

option(BUILD_TESTS "Build unit tests" OFF)

project(cortex VERSION 0.1.0 LANGUAGES CXX)
project(neuron VERSION 0.1.0 LANGUAGES CXX)

list(APPEND SOURCE
src/generators/oscillator.cpp
Expand All @@ -23,36 +23,36 @@ list(APPEND INCLUDE_DIR
"src/utilities"
)

add_library(cortex STATIC ${SOURCE})
add_library(neuron STATIC ${SOURCE})

set_target_properties(cortex PROPERTIES PUBLIC
set_target_properties(neuron PROPERTIES PUBLIC
CXX_STANDARD 14
CXX_STANDARD_REQUIRED
)

if(BUILD_TESTS)
function(add_cortex_test name src)
function(add_neuron_test name src)
add_executable("${name}_test_exe" ${src})
target_include_directories("${name}_test_exe" PRIVATE ${INCLUDE_DIR})
target_link_libraries("${name}_test_exe" cortex)
target_link_libraries("${name}_test_exe" neuron)
target_link_libraries("${name}_test_exe" gtest gtest_main)
add_test(NAME "${name}_test" COMMAND "${name}_test_exe")
endfunction()

add_subdirectory(vendor/googletest)

add_cortex_test(waveform tests/audio/waveform_test.cpp)
add_cortex_test(oscillator tests/generators/oscillator_test.cpp)
add_cortex_test(adsr tests/modulators/adsr_test.cpp)
add_cortex_test(saturator tests/processors/effects/saturator_test.cpp)
add_cortex_test(wavefolder tests/processors/effects/wavefolder_test.cpp)
add_cortex_test(filter tests/processors/filters/filter_test.cpp)
add_cortex_test(arithmetic tests/utilities/arithmetic_test.cpp)
add_cortex_test(midi tests/utilities/midi_test.cpp)
add_neuron_test(waveform tests/audio/waveform_test.cpp)
add_neuron_test(oscillator tests/generators/oscillator_test.cpp)
add_neuron_test(adsr tests/modulators/adsr_test.cpp)
add_neuron_test(saturator tests/processors/effects/saturator_test.cpp)
add_neuron_test(wavefolder tests/processors/effects/wavefolder_test.cpp)
add_neuron_test(filter tests/processors/filters/filter_test.cpp)
add_neuron_test(arithmetic tests/utilities/arithmetic_test.cpp)
add_neuron_test(midi tests/utilities/midi_test.cpp)

enable_testing()
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")

target_include_directories(cortex PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src PRIVATE ${INCLUDE_DIR})
target_include_directories(neuron PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src PRIVATE ${INCLUDE_DIR})
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TARGET = libcortex
TARGET = libneuron

MODULE_DIR = src

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# `cortex`
# `neuron`

[![Test](https://github.com/blackboxaudio/cortex/actions/workflows/ci.test.yml/badge.svg)](https://github.com/blackboxaudio/cortex/actions/workflows/ci.test.yml)
[![Build](https://github.com/blackboxaudio/cortex/actions/workflows/ci.build.yml/badge.svg)](https://github.com/blackboxaudio/cortex/actions/workflows/ci.build.yml)
[![cortex: v0.1.0](https://img.shields.io/badge/Version-v0.1.0-blue.svg)](https://github.com/blackboxaudio/cortex)
[![License](https://img.shields.io/badge/License-MIT-yellow)](https://github.com/blackboxaudio/cortex/blob/develop/LICENSE)
[![Test](https://github.com/blackboxaudio/neuron/actions/workflows/ci.test.yml/badge.svg)](https://github.com/blackboxaudio/neuron/actions/workflows/ci.test.yml)
[![Build](https://github.com/blackboxaudio/neuron/actions/workflows/ci.build.yml/badge.svg)](https://github.com/blackboxaudio/neuron/actions/workflows/ci.build.yml)
[![neuron: v0.1.0](https://img.shields.io/badge/Version-v0.1.0-blue.svg)](https://github.com/blackboxaudio/neuron)
[![License](https://img.shields.io/badge/License-MIT-yellow)](https://github.com/blackboxaudio/neuron/blob/develop/LICENSE)

> Collection of C++ audio DSP components 🧠
## Overview

`cortex` is an open-source DSP (Digital Signal Processing) library that provides a wide-ranging suite of components for building audio software.
`neuron` is an open-source DSP (Digital Signal Processing) library that provides a wide-ranging suite of components for building audio software.

It can be used for a variety of applications, including:

Expand All @@ -19,7 +19,7 @@ It can be used for a variety of applications, including:

## Features

`cortex` currently lacks wide support for features because it is in early stages, however the following are in its immediate roadmap:
`neuron` currently lacks wide support for features because it is in early stages, however the following are in its immediate roadmap:

- Dynamics
- Compressor
Expand Down Expand Up @@ -57,8 +57,8 @@ It can be used for a variety of applications, including:

Clone this repository:
```bash
git clone https://github.com/blackboxaudio/cortex
cd cortex/
git clone https://github.com/blackboxaudio/neuron
cd neuron/
```

Build the library:
Expand All @@ -69,7 +69,7 @@ make
## Using the Library

```c++
#include "cortex.h"
#include "neuron.h"

// Create a DSP context (sample rate,
// number of channels, buffer size).
Expand Down
2 changes: 1 addition & 1 deletion src/audio/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <cmath>

namespace cortex {
namespace neuron {

/**
* Contains information about the context in which DSP operations
Expand Down
2 changes: 1 addition & 1 deletion src/audio/sample.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

namespace cortex {
namespace neuron {

/**
* The basic data type for DSP operations of
Expand Down
2 changes: 1 addition & 1 deletion src/audio/waveform.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "audio/sample.h"
#include "utilities/arithmetic.h"

namespace cortex {
namespace neuron {

/**
* The basic waveform variants, i.e. sine, triangle,
Expand Down
2 changes: 1 addition & 1 deletion src/generators/oscillator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "generators/oscillator.h"

using namespace cortex;
using namespace neuron;

Oscillator::Oscillator(Context& context, float frequency, Waveform waveform)
: m_context(context)
Expand Down
2 changes: 1 addition & 1 deletion src/generators/oscillator.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "audio/waveform.h"
#include "utilities/arithmetic.h"

namespace cortex {
namespace neuron {

const size_t WAVETABLE_SIZE = 256;

Expand Down
2 changes: 1 addition & 1 deletion src/modulators/adsr.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "modulators/adsr.h"

using namespace cortex;
using namespace neuron;

AdsrEnvelopeModulator::AdsrEnvelopeModulator(Context& context, AdsrEnvelope envelope)
: m_context(context)
Expand Down
2 changes: 1 addition & 1 deletion src/modulators/adsr.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "audio/context.h"

namespace cortex {
namespace neuron {

/**
* The configuration of an ADSR envelope curve including durations
Expand Down
6 changes: 3 additions & 3 deletions src/cortex.h → src/neuron.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Cortex is a lightweight audio DSP library intended for use
* Neuron is a lightweight audio DSP library intended for use
* in any relevant application e.g. Electrosmith Daisy patches,
* JUCE plugins, VCV Rack modules.
*
* Author: Matthew Maxwell, 2024
*/
#ifndef CORTEX_LIB_H
#define CORTEX_LIB_H
#ifndef NEURON_LIB_H
#define NEURON_LIB_H

// AUDIO
#include "audio/context.h"
Expand Down
2 changes: 1 addition & 1 deletion src/processors/effects/saturator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "processors/effects/saturator.h"

using namespace cortex;
using namespace neuron;

Sample Saturator::Process(const Sample input)
{
Expand Down
2 changes: 1 addition & 1 deletion src/processors/effects/saturator.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "audio/sample.h"
#include "utilities/arithmetic.h"

namespace cortex {
namespace neuron {

/**
* The Saturator class applies a tape saturation
Expand Down
2 changes: 1 addition & 1 deletion src/processors/effects/wavefolder.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "processors/effects/wavefolder.h"

using namespace cortex;
using namespace neuron;

Sample Wavefolder::Process(const Sample input)
{
Expand Down
2 changes: 1 addition & 1 deletion src/processors/effects/wavefolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "audio/sample.h"
#include "utilities/arithmetic.h"

namespace cortex {
namespace neuron {

/**
* The Wavefolder class applies a wavefolding
Expand Down
6 changes: 3 additions & 3 deletions src/processors/filters/filter.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include "processors/filters/filter.h"

using namespace cortex;
using namespace neuron;

Filter::Filter(cortex::Context& context, float cutoffFrequency)
Filter::Filter(neuron::Context& context, float cutoffFrequency)
: m_context(context)
, m_cutoffFrequency(cutoffFrequency)
, m_previousOutput(0.0f)
{
SetCutoffFrequency(cutoffFrequency);
}

Sample Filter::Process(const cortex::Sample input)
Sample Filter::Process(const neuron::Sample input)
{
float output = m_alpha * (float)input + (1.0f - m_alpha) * (float)m_previousOutput;
m_previousOutput = (Sample)output;
Expand Down
2 changes: 1 addition & 1 deletion src/processors/filters/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "audio/sample.h"
#include "utilities/arithmetic.h"

namespace cortex {
namespace neuron {
const float FILTER_CUTOFF_FREQ_MIN = 20.0f;
const float FILTER_CUTOFF_FREQ_MAX = 20000.0f;

Expand Down
2 changes: 1 addition & 1 deletion src/utilities/arithmetic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <algorithm>
#include <cmath>

namespace cortex {
namespace neuron {

/**
* A value for the absence of quantity; nothing.
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <ctime>
#include <iostream>

using namespace cortex;
using namespace neuron;

void Logger::Log(std::string str)
{
Expand All @@ -13,5 +13,5 @@ void Logger::Log(std::string str)
std::strftime(buffer, sizeof(buffer), "Y-%m-%d %H:%M:%S", localTime);

std::cout << "[" << buffer << "] "
<< "CORTEX: " << str << std::endl;
<< "NEURON: " << str << std::endl;
}
10 changes: 5 additions & 5 deletions src/utilities/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <string>

namespace cortex {
namespace neuron {

class Logger {
public:
Expand All @@ -11,7 +11,7 @@ class Logger {

}

#define CX_TRACE(...) ::cortex::Logger::Log(__VA_ARGS__)
#define CX_INFO(...) ::cortex::Logger::Log(__VA_ARGS__)
#define CX_WARN(...) ::cortex::Logger::Log(__VA_ARGS__)
#define CX_ERROR(...) ::cortex::Logger::Log(__VA_ARGS__)
#define NEO_TRACE(...) ::neuron::Logger::Log(__VA_ARGS__)
#define NEO_INFO(...) ::neuron::Logger::Log(__VA_ARGS__)
#define NEO_WARN(...) ::neuron::Logger::Log(__VA_ARGS__)
#define NEO_ERROR(...) ::neuron::Logger::Log(__VA_ARGS__)
Loading

0 comments on commit d824754

Please sign in to comment.