Compare commits

...

2 Commits
main ... dev

Author SHA1 Message Date
9af15ed7a4 [DEV] integrate GLD 2021-12-15 22:41:44 +01:00
289d73c07e [VERSION] update dev tag version 2021-02-16 21:47:38 +01:00
7 changed files with 99 additions and 109 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
__pycache__
.bck
out
target
build
*~
*.swp
*.old

View File

@ -0,0 +1,24 @@
{
"type":"BINARY",
"sub-type":"TEST",
"group-id":"com.atria-soft",
"description":"Chunkware test unit",
"license":"MPL-2",
"license-file":"file://LICENSE",
"maintainer":"file://authors.txt",
"author":"file://authors.txt",
"version":"file://version.txt",
"code-quality":"MEDIUM",
"source": [
"test/main.cpp"
],
"compilation-version": {
"c++": 2017
},
"dependency": [
"audio-algo-chunkware",
"etk",
"test-debug"
]
}

View File

@ -0,0 +1,42 @@
{
"type":"LIBRARY",
"group-id":"com.atria-soft",
"description":"Chunkware algo",
"license":"MPL-2",
"license-file":"file://LICENSE",
"maintainer":"file://authors.txt",
"author":"file://authors.txt",
"version":"file://version.txt",
"code-quality":"MEDIUM",
"source": [
"audio/algo/chunkware/debug.cpp",
"audio/algo/chunkware/Compressor.cpp",
"audio/algo/chunkware/debug.cpp",
"audio/algo/chunkware/EnvelopeDetector.cpp",
"audio/algo/chunkware/AttRelEnvelope.cpp",
"audio/algo/chunkware/Gate.cpp",
"audio/algo/chunkware/GateRms.cpp",
"audio/algo/chunkware/Limiter.cpp"
],
"header": [
"audio/algo/chunkware/Compressor.hpp",
"audio/algo/chunkware/debug.hpp",
"audio/algo/chunkware/EnvelopeDetector.hpp",
"audio/algo/chunkware/AttRelEnvelope.hpp",
"audio/algo/chunkware/Gate.hpp",
"audio/algo/chunkware/GateRms.hpp",
"audio/algo/chunkware/Gain.hpp",
"audio/algo/chunkware/Limiter.hpp"
],
"path":[
"."
],
"compilation-version": {
"c++": 2017
},
"dependency": [
"etk",
"audio"
]
}

View File

@ -1,41 +0,0 @@
#!/usr/bin/python
import lutin.debug as debug
import lutin.tools as tools
def get_type():
return "BINARY"
def get_sub_type():
return "TEST"
def get_desc():
return "test chunkware"
def get_licence():
return "MPL-2"
def get_compagny_type():
return "com"
def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
def configure(target, my_module):
my_module.add_src_file([
'test/main.cpp'
])
my_module.add_depend(['audio-algo-chunkware', 'test-debug'])
return True

View File

@ -1,59 +0,0 @@
#!/usr/bin/python
import lutin.debug as debug
import lutin.tools as tools
def get_type():
return "LIBRARY"
def get_desc():
return "chunkware algo"
def get_licence():
return "BSD-2"
def get_compagny_type():
return "com"
def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
def get_version():
return "version.txt"
def configure(target, my_module):
my_module.add_src_file([
'audio/algo/chunkware/debug.cpp',
'audio/algo/chunkware/Compressor.cpp',
'audio/algo/chunkware/debug.cpp',
'audio/algo/chunkware/EnvelopeDetector.cpp',
'audio/algo/chunkware/AttRelEnvelope.cpp',
'audio/algo/chunkware/Gate.cpp',
'audio/algo/chunkware/GateRms.cpp',
'audio/algo/chunkware/Limiter.cpp'
])
my_module.add_header_file([
'audio/algo/chunkware/Compressor.hpp',
'audio/algo/chunkware/debug.hpp',
'audio/algo/chunkware/EnvelopeDetector.hpp',
'audio/algo/chunkware/AttRelEnvelope.hpp',
'audio/algo/chunkware/Gate.hpp',
'audio/algo/chunkware/GateRms.hpp',
'audio/algo/chunkware/Gain.hpp',
'audio/algo/chunkware/Limiter.hpp'
])
my_module.add_depend(['etk', 'audio'])
my_module.add_path(".")
return True

View File

@ -9,7 +9,10 @@
#include <audio/algo/chunkware/Compressor.hpp>
#include <audio/algo/chunkware/Limiter.hpp>
#include <audio/algo/chunkware/Gate.hpp>
#include <etk/os/FSNode.hpp>
#include <ememory/SharedPtr.hpp>
#include <etk/io/Interface.hpp>
#include <etk/path/Path.hpp>
#include <etk/uri/uri.hpp>
#include <echrono/Steady.hpp>
#include <ethread/Thread.hpp>
#include <ethread/tools.hpp>
@ -91,7 +94,7 @@ void performanceCompressor() {
{
double phase = 0;
double baseCycle = 2.0*M_PI/sampleRate * 1280.0;
for (int32_t iii=0; iii<input.size(); iii++) {
for (size_t iii=0; iii<input.size(); iii++) {
input[iii] = cos(phase) * 5.0;
phase += baseCycle;
if (phase >= 2*M_PI) {
@ -130,7 +133,7 @@ void performanceLimiter() {
{
double phase = 0;
double baseCycle = 2.0*M_PI/sampleRate * 1280.0;
for (int32_t iii=0; iii<input.size(); iii++) {
for (size_t iii=0; iii<input.size(); iii++) {
input[iii] = cos(phase) * 5.0;
phase += baseCycle;
if (phase >= 2*M_PI) {
@ -171,7 +174,7 @@ void performanceGate() {
{
double phase = 0;
double baseCycle = 2.0*M_PI/sampleRate * 1280.0;
for (int32_t iii=0; iii<input.size(); iii++) {
for (size_t iii=0; iii<input.size(); iii++) {
input[iii] = cos(phase) * 5.0;
phase += baseCycle;
if (phase >= 2*M_PI) {
@ -209,7 +212,7 @@ void performanceGate() {
int main(int _argc, const char** _argv) {
// the only one init for etk:
etk::init(_argc, _argv);
etk::String inputName = "";
etk::Path inputName = "";
bool performance = false;
bool perf = false;
int64_t sampleRate = 48000;
@ -242,12 +245,20 @@ int main(int _argc, const char** _argv) {
performanceGate();
return 0;
}
if (inputName == "") {
if (inputName.isEmpty() == true) {
TEST_ERROR("Can not Process missing parameters...");
exit(-1);
}
TEST_INFO("Read input:");
etk::Vector<double> inputData = convert(etk::FSNodeReadAllDataType<int16_t>(inputName));
etk::Vector<int16_t> tmpData;
{
ememory::SharedPtr<etk::io::Interface> fileIO = etk::uri::get(inputName);
fileIO->open(etk::io::OpenMode::Read);
tmpData = fileIO->readAll<int16_t>();
fileIO->close();
}
etk::Vector<double> inputData = convert(tmpData);
TEST_INFO(" " << inputData.size() << " samples");
// resize output :
etk::Vector<double> output;
@ -310,7 +321,15 @@ int main(int _argc, const char** _argv) {
TEST_INFO(" max=" << (float((perfo.getMaxProcessing().get()*sampleRate)/blockSize)/1000000000.0)*100.0 << " %");
TEST_INFO(" avg=" << (float(((perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration())*sampleRate)/blockSize)/1000000000.0)*100.0 << " %");
}
etk::FSNodeWriteAllDataType<int16_t>("output.raw", convert(output));
{
ememory::SharedPtr<etk::io::Interface> fileIO = etk::uri::get(etk::Path("output.raw"));
if (fileIO->open(etk::io::OpenMode::Write) == false) {
return -1;
}
fileIO->writeAll<double>(output);
fileIO->close();
}
return 0;
}

View File

@ -1 +1 @@
1.0.0
1.0.0-dev