|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
#include "config.h" |
|
|
|
|
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/synth.h |
|
|
|
|
CODE: orig_code/synth.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2012 Google Inc. |
|
|
|
@ -78,7 +78,7 @@ inline static T max(const T& a, const T& b) { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/aligned_buf.h |
|
|
|
|
CODE: orig_code/aligned_buf.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2013 Google Inc. |
|
|
|
@ -113,7 +113,7 @@ class AlignedBuf { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/sin.h |
|
|
|
|
CODE: orig_code/sin.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2012 Google Inc. |
|
|
|
@ -180,7 +180,7 @@ int32_t Sin::lookup(int32_t phase) { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/exp2.h |
|
|
|
|
CODE: orig_code/exp2.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2012 Google Inc. |
|
|
|
@ -265,7 +265,7 @@ int32_t Tanh::lookup(int32_t x) { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/fast_log.h |
|
|
|
|
CODE: orig_code/fast_log.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
https://community.arm.com/tools/f/discussions/4292/cmsis-dsp-new-functionality-proposal/22621#22621
|
|
|
|
@ -320,7 +320,7 @@ inline float dbToUnit(float db) { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/freqlut.h |
|
|
|
|
CODE: orig_code/freqlut.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2012 Google Inc. |
|
|
|
@ -346,7 +346,7 @@ class Freqlut { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/lfo.h |
|
|
|
|
CODE: orig_code/lfo.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2013 Google Inc. |
|
|
|
@ -394,7 +394,7 @@ class Lfo { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/env.h |
|
|
|
|
CODE: orig_code/env.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2017 Pascal Gauthier. |
|
|
|
@ -474,7 +474,7 @@ class Env { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/pitchenv.h |
|
|
|
|
CODE: orig_code/pitchenv.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2013 Google Inc. |
|
|
|
@ -527,7 +527,7 @@ extern const int8_t pitchenv_tab[]; |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/controllers.h |
|
|
|
|
CODE: orig_code/controllers.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2013 Google Inc. |
|
|
|
@ -666,7 +666,7 @@ class Controllers { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/PluginFx.h |
|
|
|
|
CODE: orig_code/PluginFx.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/**
|
|
|
|
|
|
|
|
|
@ -740,7 +740,7 @@ class PluginFx { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/fm_op_kernel.h |
|
|
|
|
CODE: orig_code/fm_op_kernel.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2012 Google Inc. |
|
|
|
@ -788,7 +788,7 @@ class FmOpKernel { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/fm_core.h |
|
|
|
|
CODE: orig_code/fm_core.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2012 Google Inc. |
|
|
|
@ -841,7 +841,7 @@ class FmCore { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/dx7note.h |
|
|
|
|
CODE: orig_code/dx7note.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2016-2017 Pascal Gauthier. |
|
|
|
@ -920,7 +920,7 @@ class Dx7Note { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/dexed.h |
|
|
|
|
CODE: orig_code/dexed.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
MicroDexed |
|
|
|
@ -1139,7 +1139,7 @@ class Dexed |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/porta.h |
|
|
|
|
CODE: orig_code/porta.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
/*
|
|
|
|
|
Copyright 2019 Jean Pierre Cimalando. |
|
|
|
@ -1166,8 +1166,54 @@ struct Porta { |
|
|
|
|
|
|
|
|
|
//=====================================================
|
|
|
|
|
/*****************************************************
|
|
|
|
|
CODE; orig_code/source_microdexed.h |
|
|
|
|
CODE: orig_code/synth_microdexed.h |
|
|
|
|
*****************************************************/ |
|
|
|
|
class AudioSynthDexed : public AudioStream, public Dexed { |
|
|
|
|
public: |
|
|
|
|
const uint16_t audio_block_time_us = 1000000 / (SAMPLE_RATE / AUDIO_BLOCK_SAMPLES); |
|
|
|
|
uint32_t xrun = 0; |
|
|
|
|
uint16_t render_time_max = 0; |
|
|
|
|
|
|
|
|
|
AudioSynthDexed(uint16_t sample_rate) : AudioStream(0, NULL), Dexed(sample_rate) { }; |
|
|
|
|
|
|
|
|
|
void update(void) |
|
|
|
|
{ |
|
|
|
|
if (in_update == true) |
|
|
|
|
{ |
|
|
|
|
xrun++; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
in_update = true; |
|
|
|
|
|
|
|
|
|
elapsedMicros render_time; |
|
|
|
|
audio_block_t *lblock; |
|
|
|
|
|
|
|
|
|
lblock = allocate(); |
|
|
|
|
|
|
|
|
|
if (!lblock) |
|
|
|
|
{ |
|
|
|
|
in_update = false; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getSamples(AUDIO_BLOCK_SAMPLES, lblock->data); |
|
|
|
|
|
|
|
|
|
if (render_time > audio_block_time_us) // everything greater audio_block_time_us (2.9ms for buffer size of 128) is a buffer underrun!
|
|
|
|
|
xrun++; |
|
|
|
|
|
|
|
|
|
if (render_time > render_time_max) |
|
|
|
|
render_time_max = render_time; |
|
|
|
|
|
|
|
|
|
transmit(lblock, 0); |
|
|
|
|
release(lblock); |
|
|
|
|
|
|
|
|
|
in_update = false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
volatile bool in_update = false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class AudioSynthDexed_F32 : public AudioStream_F32, public Dexed { |
|
|
|
|
public: |
|
|
|
@ -1206,8 +1252,8 @@ class AudioSynthDexed_F32 : public AudioStream_F32, public Dexed { |
|
|
|
|
if (render_time > render_time_max) |
|
|
|
|
render_time_max = render_time; |
|
|
|
|
|
|
|
|
|
AudioStream_F32::transmit(lblock, 0); |
|
|
|
|
AudioStream_F32::release(lblock); |
|
|
|
|
transmit(lblock, 0); |
|
|
|
|
release(lblock); |
|
|
|
|
|
|
|
|
|
in_update = false; |
|
|
|
|
}; |
|
|
|
|