-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a bench_test and make both benches run for only 60s worth of samples
- Loading branch information
Ulf Hammarqvist
committed
Apr 17, 2024
1 parent
bc31614
commit dbe688c
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <cstdio> | ||
#include <cstdint> | ||
|
||
// #include "phasephdgr/synth.hpp" | ||
#include "phasephdgr/examples.hpp" | ||
|
||
#include "effectchain.hpp" | ||
|
||
using namespace PhasePhdgr; | ||
|
||
int main() | ||
{ | ||
const int s = 60; // ~1 minutes | ||
const float fs = 48000; | ||
float bufferL[SYNTH_VOICE_BUFFER_LENGTH]; | ||
float bufferR[SYNTH_VOICE_BUFFER_LENGTH]; | ||
|
||
EffectChain e(PhasePhdgr::getExampleEffectChain(), PhasePhdgr::ComponentRegister(), nullptr); | ||
GlobalData g; | ||
|
||
for (int j = 0; j < s; j++) | ||
{ | ||
for (int i = 0; i < (int)fs; i += SYNTH_VOICE_BUFFER_LENGTH) | ||
{ | ||
memset(bufferL, 0, sizeof(float) * SYNTH_VOICE_BUFFER_LENGTH); | ||
memset(bufferR, 0, sizeof(float) * SYNTH_VOICE_BUFFER_LENGTH); | ||
e.update(bufferL, bufferR, SYNTH_VOICE_BUFFER_LENGTH, fs, g); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters