Skip to content

Fx3 beta1 #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a69e97f
Implementationg proposition for:
abscisys Dec 19, 2022
dabe431
Fixing compiling errors on RPI1
abscisys Dec 20, 2022
03a0774
Fixing compiling issue on RPI1
abscisys Dec 20, 2022
aac8391
Revert "Fixing compiling issue on RPI1"
abscisys Dec 20, 2022
11b3885
Revert "Fixing compiling errors on RPI1"
abscisys Dec 20, 2022
5317265
Revert "Implementationg proposition for:"
abscisys Dec 20, 2022
919221d
Implementationg proposition for:
abscisys Dec 19, 2022
d42b8af
Merge branch 'main' of github.com:abscisys/MiniDexed
abscisys Dec 20, 2022
6ca3e3d
Adding first set of FX
abscisys Dec 23, 2022
154cf69
Finalizing the Phase before testing
abscisys Dec 23, 2022
2542be1
Optize existing effect and add the Orbitone effect
abscisys Dec 24, 2022
fd3fd0e
Adding Flanger FX -> 1 point to fix as code is not compiling
abscisys Dec 24, 2022
992f275
Fixing Flanger
abscisys Dec 25, 2022
650db9a
Adding Tube and Chorus and update the way the FXChain is structured
abscisys Dec 27, 2022
d1408c6
Start FXRack parameter integration
abscisys Dec 28, 2022
79882d3
Merging minidexed_ext.cpp into minidexed.cpp
abscisys Dec 28, 2022
63a9460
Finalizing the menu integration and wiring to UI
abscisys Dec 28, 2022
1b33d6b
Multiple fixes - intermediate debugging
abscisys Dec 29, 2022
fe340f2
First step debugging completed
abscisys Dec 31, 2022
17030e8
2nd phase of debugging
abscisys Jan 3, 2023
6da53dc
Fixing the Shimmer Reverb
abscisys Jan 4, 2023
acc96b1
Fixing LFO frequency on the FXEngine
abscisys Jan 4, 2023
a376b41
Fixing the Chorus and enhancing the FXEngine to disable internal LFO
abscisys Jan 4, 2023
dc5165e
Removing the Chorus Feedback parameter that makes no sense
abscisys Jan 4, 2023
8227a3a
Fixing the Orbitone
abscisys Jan 4, 2023
d0fe01f
Tranform TapeDelay into a Delay as Flutter is a noise artifact generator
abscisys Jan 4, 2023
2a2b72a
Forgot 1 important source file for the conversion TapeDelay to Delay
abscisys Jan 4, 2023
ab4f238
Enhance the Buffer class for future use
abscisys Jan 4, 2023
f2006bd
Fixing the Tube effect so it has more presence
abscisys Jan 4, 2023
4fb79f8
Fixing the Phaser
abscisys Jan 5, 2023
e18c0f2
FXRack finalization
abscisys Jan 5, 2023
ffcafd6
A bit of cleanup
abscisys Jan 5, 2023
f14ac0a
Merge branch 'main' into fx
probonopd Jan 7, 2023
49973d1
Merge pull request #3 from probonopd/main
abscisys Jan 8, 2023
9cb9b97
Merge pull request #4 from probonopd/main
abscisys Jan 20, 2023
926ba53
Fixing many FX bugs and change of test framework
abscisys Jan 29, 2023
c19be7f
Alignement with fx2
abscisys Jan 30, 2023
4440ded
Fixing stereo image bug and missing initialization
abscisys Jan 30, 2023
6fb78be
Fix of the Shimmer Reverb
abscisys Feb 4, 2023
a264fdf
Fixes on FX to increase stability and performances
abscisys Feb 5, 2023
4709fc3
Fixes on FX and increase performances
abscisys Feb 5, 2023
20419bb
Reorganizing tests
abscisys Feb 5, 2023
4c502dd
FX fixes + optimizations + prepare for FX2 release
abscisys Feb 11, 2023
b18f4da
Merge pull request #5 from probonopd/main
abscisys Feb 11, 2023
dc15d62
Merge branch 'main' of github.com:probonopd/MiniDexed into probonopd-…
abscisys Feb 11, 2023
d933e05
Merge branch 'probonopd-main' into fx
abscisys Feb 11, 2023
23ab355
Changing the LFO to the new FastLFO2
abscisys Mar 4, 2023
398d11e
fixing unit tests + change default delay flutter to 0
abscisys Mar 4, 2023
73a430b
Merge branch 'main' into fx
abscisys Mar 4, 2023
6d8bb2e
Merge pull request #8 from abscisys/fx
abscisys Mar 4, 2023
3e7d28e
Merge branch 'probonopd:main' into main
abscisys Apr 10, 2023
d2f11cc
Merge pull request #10 from probonopd/main
abscisys May 18, 2023
253d36d
new fx implementation
abscisys May 26, 2023
781eba6
reducing changes due to reformatting and correction of wiki documenta…
abscisys May 26, 2023
15677e3
Fixing missing FX-Send in TG menu that was swallowed during PR merge
abscisys May 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ sdcard
# Editor related files
*.swp
*.swo

.vscode/
src/test/bin/
src/test/objects/
src/test/results/
78 changes: 78 additions & 0 deletions src/CFileDevice.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//
// CFileDevice.h
//
// Device implementation that writes into a file.
// This device is a singleton dedicated to allow the Circle CLogger class to output log event into the file instead of the internal buffer.
// Author: Vincent Gauché
//

#pragma once

#include "extra_features.h"

#include <circle/device.h>
#include <fatfs/ff.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <cassert>

class CFileDevice : public CDevice
{
DISALLOW_COPY_AND_ASSIGN(CFileDevice);

private:
CFileDevice() :
m_file(new FIL())
{
FRESULT res = f_open(this->m_file, "SD:/debuglog.txt", FA_WRITE | FA_CREATE_ALWAYS);
assert(res == FR_OK);
}

public:
static void UseMeForLogger()
{
CLogger::Get()->SetNewTarget(&CFileDevice::GetInstance());
}

static CFileDevice& GetInstance()
{
static CFileDevice Instance;

return Instance;
}

~CFileDevice()
{
f_sync(this->m_file);
f_close(this->m_file);
}

virtual int Write(const void* pBuffer, size_t nCount) override
{
UINT nb = 0;
if(nCount > 0)
{
f_write(this->m_file, pBuffer, nCount, &nb);
f_sync(this->m_file);
}

return (int)nb;
}

private:
FIL* m_file;
};
36 changes: 32 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,38 @@ CIRCLE_STDLIB_DIR = ../circle-stdlib
SYNTH_DEXED_DIR = ../Synth_Dexed/src
CMSIS_DIR = ../CMSIS_5/CMSIS

OBJS = main.o kernel.o minidexed.o config.o userinterface.o uimenu.o \
mididevice.o midikeyboard.o serialmididevice.o pckeyboard.o \
sysexfileloader.o performanceconfig.o perftimer.o \
effect_compressor.o effect_platervbstereo.o uibuttons.o midipin.o
OBJS := main.o
OBJS += kernel.o
OBJS += minidexed.o
OBJS += config.o
OBJS += userinterface.o
OBJS += uimenu.o
OBJS += mididevice.o
OBJS += midikeyboard.o
OBJS += serialmididevice.o
OBJS += pckeyboard.o
OBJS += sysexfileloader.o
OBJS += performanceconfig.o
OBJS += perftimer.o
OBJS += effect_compressor.o
OBJS += effect_platervbstereo.o
OBJS += fx.o
OBJS += fx_components.o
OBJS += fx_svf.o
OBJS += fx_tube.o
OBJS += fx_chorus.o
OBJS += fx_flanger.o
OBJS += fx_orbitone.o
OBJS += fx_phaser.o
OBJS += fx_delay.o
OBJS += fx_shimmer_helper.o
OBJS += fx_diffuser.o
OBJS += fx_pitch_shifter.o
OBJS += fx_reverberator.o
OBJS += fx_shimmer_reverb.o
OBJS += fx_dry.o
OBJS += uibuttons.o
OBJS += midipin.o

OPTIMIZE = -O3

Expand Down
117 changes: 117 additions & 0 deletions src/debug.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#pragma once

#if defined(DEBUG)

#include <cmath>
#include <string>
#include <iostream>
#include <sstream>

typedef size_t (*ValueInpector)(const std::string& tag, const float32_t valueToTest, const float32_t _min, float32_t _max, bool outDebugInfo);

inline size_t nanValueInspector(const std::string& tag, const float32_t valueToTest, const float32_t _min, float32_t _max, bool outDebugInfo)
{
if(std::isnan(valueToTest))
{
if(outDebugInfo)
{
std::cerr << tag << ": nan" << std::endl;
}
return 1u;
}

return 0u;
}

inline size_t normalizedValueInspector(const std::string& tag, const float32_t valueToTest, const float32_t _min, float32_t _max, bool outDebugInfo)
{
if(valueToTest > _max || valueToTest < _min)
{
if(outDebugInfo)
{
std::cerr << tag << ": out of bounds - value: " << valueToTest << " - boundaries: [" << _min << ", " << _max << "]" << std::endl;
}
return 1u;
}

return 0u;
}

inline size_t fullInspector(const std::string& tag, const float32_t valueToTest, const float32_t _min = -1.0f, float32_t _max = 1.0f, bool outDebugInfo = true)
{
if(std::isnan(valueToTest))
{
if(outDebugInfo)
{
std::cerr << tag << ": nan" << std::endl;
}
return 1u;
}
else if(valueToTest > _max || valueToTest < _min)
{
if(outDebugInfo)
{
std::cerr << tag << ": out of bounds - value: " << valueToTest << " - boundaries: [" << _min << ", " << _max << "]" << std::endl;
}
return 1u;
}

return 0u;
}

#define SS_RESET(ss, prec, align) ss.str(""); ss.precision(prec); ss << align; ss << std::fixed
#define SS_SPACE(ss, spc, nb, align, sep) ss.fill(spc); ss.width(nb); ss << "" << sep
#define SS__TEXT(ss, spc, nb, align, sep, txt) ss << align; ss.fill(spc); ss.width(nb); ss << txt << sep

class ValueInpectorDebugger
{
public:
ValueInpectorDebugger() {}
virtual ~ValueInpectorDebugger() {}

virtual void dump(std::ostream& out, bool deepInspection = true, const std::string& tag = "") const = 0;
virtual size_t inspect(ValueInpector inspector, bool deepInspection = true, const std::string& tag = "") const = 0;
};

#define INSPECTABLE(clazz) clazz : public ValueInpectorDebugger
#define IMPLEMENT_DUMP(code) \
public:\
__attribute__((noinline)) virtual void dump(std::ostream& out, bool deepInspection = true, const std::string& tag = "") const override\
{\
code\
}

#define DUMP(clazz, out) clazz->dump(out, true, "")
#define DUMP2(clazz, out, tag) clazz->dump(out, true, tag)
#define FAST_DUMP(clazz, out, tag) clazz->dump(out, false, "")
#define FAST_DUMP2(clazz, out, tag) clazz->dump(out, false, tag)

#define IMPLEMENT_INSPECT(code) \
public:\
__attribute__((noinline)) virtual size_t inspect(ValueInpector inspector, bool deepInspection = true, const std::string& tag = "") const override\
{\
code\
}

#define INSPECT(obj, inspector) obj->inspect(inspector, true)
#define INSPECT2(obj, inspector, deepInspection) obj->inspect(inspector, deepInspection)
#define FULL_INSPECT(obj, deepInspection) obj->inspect(fullInspector, deepInspection)
#define FULL_INSPECT2(obj, deepInspection, tag) obj->inspect(fullInspector, deepInspection, tag)

#else

#define INSPECTABLE(clazz) clazz
#define IMPLEMENT_DUMP(code)
#define IMPLEMENT_INSPECT(code)

#define DUMP(clazz, out)
#define DUMP2(clazz, out, tag)
#define FAST_DUMP(clazz, out, tag)
#define FAST_DUMP2(clazz, out, tag)

#define INSPECT(obj, inspector)
#define INSPECT2(obj, inspector, deepInspection)
#define FULL_INSPECT(obj, deepInspection)
#define FULL_INSPECT2(obj, deepInspection, tag)

#endif
38 changes: 19 additions & 19 deletions src/effect_mixer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ template <int NN> class AudioMixer
delete [] sumbufL;
}

void doAddMix(uint8_t channel, float32_t* in)
void doAddMix(uint8_t channel, float32_t* in)
{
float32_t tmp[buffer_length];

assert(in);

if(multiplier[channel]!=UNITY_GAIN)
float32_t tmp[buffer_length];
bool isScaled = (multiplier[channel]!=UNITY_GAIN);

if(isScaled)
arm_scale_f32(in,multiplier[channel],tmp,buffer_length);
arm_add_f32(sumbufL, tmp, sumbufL, buffer_length);
arm_add_f32(sumbufL, (isScaled ? tmp : in), sumbufL, buffer_length);
}

void gain(uint8_t channel, float32_t gain)
Expand Down Expand Up @@ -119,37 +120,36 @@ template <int NN> class AudioStereoMixer : public AudioMixer<NN>

void doAddMix(uint8_t channel, float32_t* in)
{
float32_t tmp[buffer_length];

assert(in);

float32_t tmp[buffer_length];

// left
arm_scale_f32(in, panorama[channel][0], tmp, buffer_length);
if(multiplier[channel]!=UNITY_GAIN)
arm_scale_f32(tmp,multiplier[channel],tmp,buffer_length);
arm_scale_f32(in, panorama[channel][0] * multiplier[channel], tmp, buffer_length);
arm_add_f32(sumbufL, tmp, sumbufL, buffer_length);

// right
arm_scale_f32(in, panorama[channel][1], tmp, buffer_length);
if(multiplier[channel]!=UNITY_GAIN)
arm_scale_f32(tmp,multiplier[channel],tmp,buffer_length);
arm_scale_f32(in, panorama[channel][1] * multiplier[channel], tmp, buffer_length);
arm_add_f32(sumbufR, tmp, sumbufR, buffer_length);
}

void doAddMix(uint8_t channel, float32_t* inL, float32_t* inR)
{
float32_t tmp[buffer_length];

assert(inL);
assert(inR);

float32_t tmp[buffer_length];
bool isScaled = (multiplier[channel]!=UNITY_GAIN);

// left
if(multiplier[channel]!=UNITY_GAIN)
if(isScaled)
arm_scale_f32(inL,multiplier[channel],tmp,buffer_length);
arm_add_f32(sumbufL, tmp, sumbufL, buffer_length);
arm_add_f32(sumbufL, (isScaled ? tmp : inL), sumbufL, buffer_length);

// right
if(multiplier[channel]!=UNITY_GAIN)
if(isScaled)
arm_scale_f32(inR,multiplier[channel],tmp,buffer_length);
arm_add_f32(sumbufR, tmp, sumbufR, buffer_length);
arm_add_f32(sumbufR, (isScaled ? tmp : inR), sumbufR, buffer_length);
}

void getMix(float32_t* bufferL, float32_t* bufferR)
Expand Down
Loading