diff --git a/tests/data/pipo.json b/tests/data/pipo.json new file mode 100644 index 0000000000000000000000000000000000000000..055780c32d71b42f6578031f2fdfcae0ed2e6ab7 --- /dev/null +++ b/tests/data/pipo.json @@ -0,0 +1,228 @@ +{ + "docType" : "rapid-mix:signal-processing", + "docVersion" : "1.0.0", + "payload" : + { + "description" : "slice:fft:sum:scale:onseg", + "parameters" : + [ + { + "name" : "slice.size", + "type" : "Int", + "value" : [ 1024 ] + }, + { + "name" : "slice.hop", + "type" : "Int", + "value" : [ 256 ] + }, + { + "name" : "slice.wind", + "type" : "Enum", + "value" : "hann" + }, + { + "name" : "slice.norm", + "type" : "Enum", + "value" : "power" + }, + { + "name" : "fft.size", + "type" : "Int", + "value" : [ 0 ] + }, + { + "name" : "fft.mode", + "type" : "Enum", + "value" : "power" + }, + { + "name" : "fft.norm", + "type" : "Bool", + "value" : 1 + }, + { + "name" : "fft.weighting", + "type" : "Enum", + "value" : "itur468" + }, + { + "name" : "sum.norm", + "type" : "Bool", + "value" : 0 + }, + { + "name" : "sum.colname", + "type" : "String", + "value" : "" + }, + { + "name" : "scale.inmin", + "type" : "Double", + "value" : [ 1 ] + }, + { + "name" : "scale.inmax", + "type" : "Double", + "value" : [ 10 ] + }, + { + "name" : "scale.outmin", + "type" : "Double", + "value" : [ 0 ] + }, + { + "name" : "scale.outmax", + "type" : "Double", + "value" : [ 10 ] + }, + { + "name" : "scale.clip", + "type" : "Bool", + "value" : 0 + }, + { + "name" : "scale.func", + "type" : "Enum", + "value" : "log" + }, + { + "name" : "scale.base", + "type" : "Double", + "value" : [ 10 ] + }, + { + "name" : "scale.minlog", + "type" : "Double", + "value" : [ 1.0000000195414814e-24 ] + }, + { + "name" : "scale.complete", + "type" : "Enum", + "value" : "repeatlast" + }, + { + "name" : "scale.colindex", + "type" : "Int", + "value" : [ 0 ] + }, + { + "name" : "scale.numcols", + "type" : "Int", + "value" : [ 0 ] + }, + { + "name" : "onseg.colindex", + "type" : "Int", + "value" : [ 0 ] + }, + { + "name" : "onseg.numcols", + "type" : "Int", + "value" : [ -1 ] + }, + { + "name" : "onseg.filtersize", + "type" : "Int", + "value" : [ 3 ] + }, + { + "name" : "onseg.threshold", + "type" : "Double", + "value" : [ 9 ] + }, + { + "name" : "onseg.odfmode", + "type" : "Enum", + "value" : "mean" + }, + { + "name" : "onseg.mininter", + "type" : "Double", + "value" : [ 50 ] + }, + { + "name" : "onseg.startisonset", + "type" : "Bool", + "value" : 1 + }, + { + "name" : "onseg.duration", + "type" : "Bool", + "value" : 1 + }, + { + "name" : "onseg.durthresh", + "type" : "Double", + "value" : [ 0 ] + }, + { + "name" : "onseg.offthresh", + "type" : "Double", + "value" : [ -120 ] + }, + { + "name" : "onseg.maxsize", + "type" : "Double", + "value" : [ 0 ] + }, + { + "name" : "onseg.min", + "type" : "Bool", + "value" : 0 + }, + { + "name" : "onseg.max", + "type" : "Bool", + "value" : 1 + }, + { + "name" : "onseg.mean", + "type" : "Bool", + "value" : 0 + }, + { + "name" : "onseg.stddev", + "type" : "Bool", + "value" : 0 + }, + { + "name" : "onseg.odfoutput", + "type" : "Bool", + "value" : 0 + } + ], + "streamAttributes" : + { + "input" : + { + "domain" : 0, + "hasTimeTags" : 0, + "hasVarSize" : false, + "height" : 1, + "labels" : true, + "maxFrames" : 1, + "offset" : 0, + "rate" : 1000, + "width" : 1 + }, + "output" : + { + "domain" : 0, + "hasTimeTags" : 1, + "hasVarSize" : false, + "height" : 1, + "labels" : true, + "maxFrames" : 1, + "offset" : 0, + "rate" : 3.90625, + "width" : 2 + } + } + }, + "target" : + { + "name" : "pipo", + "version" : 0.20000000000000001 + } +} diff --git a/tests/src/test_rapidPiPo.cpp b/tests/src/test_rapidPiPo.cpp index d0379b2c7c30539e53da89dc6eb030644495f3d1..f44467e6bea777e80236aa838be314c0d1762368 100644 --- a/tests/src/test_rapidPiPo.cpp +++ b/tests/src/test_rapidPiPo.cpp @@ -15,7 +15,7 @@ #include "catch.hpp" #include "signalProcessing.h" -//#define MAX_PATH_SIZE 256 +#define MAX_PATH_SIZE 256 //=============================== ONSEG TEST =================================// @@ -31,7 +31,7 @@ SCENARIO("Test rapidPiPoHost", "[signalProcessing]") // std::cout << std::string(cwd) << std::endl; // but here we just add the file to the Copy File(s) Build Phase - buffer.load("./DnB-loop-175BPM.wav", 0); + buffer.load("./data/DnB-loop-175BPM.wav", 0); // ( source : http://freesound.org/people/yewbic/sounds/40107/ ) buffer.reset(); // (no real need to do this here) @@ -51,6 +51,7 @@ SCENARIO("Test rapidPiPoHost", "[signalProcessing]") // this one is not part of the default collection : // PiPoCollection::addToCollection("chroma", new PiPoCreator<PiPoMaximChroma>); + //* host.setGraph("slice:fft:sum:scale:onseg"); host.setAttr("slice.size", 1024); @@ -85,8 +86,22 @@ SCENARIO("Test rapidPiPoHost", "[signalProcessing]") { std::cout << "- " << attrs[i] << std::endl; } + //*/ + + //char pathStrBuf[MAX_PATH_SIZE]; + //char *cwd = getcwd(pathStrBuf, sizeof(pathStrBuf)); + //std::string filePath = std::string(cwd) + "/hello.json"; + //std::string filePath = ${PROJECT_DIR}; + std::string filePath = "./data/pipo.json"; + std::cout << filePath << std::endl; + + //host.writeJSON(filePath); + host.readJSON(filePath); + //host.putJSON(jj); + + //std::string jj = host.getJSON(); + //std::cout << jj << std::endl; - std::cout << host.getJSON() << std::endl; // set another chain : // pipoHost.setChain("chroma"); diff --git a/tests/test_project.xcodeproj/project.pbxproj b/tests/test_project.xcodeproj/project.pbxproj index 2b40e7d71e4becfdfd5fff6cbba4caac6c57ee36..fcfc561bd615ffc8920858cac0936da82dd3840f 100644 --- a/tests/test_project.xcodeproj/project.pbxproj +++ b/tests/test_project.xcodeproj/project.pbxproj @@ -37,7 +37,6 @@ 311BA31D1EDC7ADE00244DAC /* maxiMFCC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE2C5A191ED8450C00E9FAFA /* maxiMFCC.cpp */; }; 311BA31E1EDC7ADE00244DAC /* maximilian.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE2C5A1F1ED8450C00E9FAFA /* maximilian.cpp */; }; 311BA3211EDC7B2400244DAC /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 311BA3201EDC7B2400244DAC /* Accelerate.framework */; }; - 311BA3241EDC7BA800244DAC /* DnB-loop-175BPM.wav in CopyFiles */ = {isa = PBXBuildFile; fileRef = 311BA3231EDC7BA400244DAC /* DnB-loop-175BPM.wav */; }; 311BA3251EDCE80B00244DAC /* jsoncpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE2C5E081ED8450E00E9FAFA /* jsoncpp.cpp */; }; 319C94A11FC5BFA80055BE40 /* PiPoHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319C93FD1FC49BAA0055BE40 /* PiPoHost.cpp */; }; 319C94A21FC5C0C10055BE40 /* PiPoCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319C947C1FC49D490055BE40 /* PiPoCollection.cpp */; }; @@ -155,7 +154,6 @@ dstPath = ""; dstSubfolderSpec = 16; files = ( - 311BA3241EDC7BA800244DAC /* DnB-loop-175BPM.wav in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -218,6 +216,7 @@ 311BA2FC1EDC6F1900244DAC /* xmm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xmm.h; path = xmm/src/xmm.h; sourceTree = "<group>"; }; 311BA3201EDC7B2400244DAC /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 311BA3231EDC7BA400244DAC /* DnB-loop-175BPM.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = "DnB-loop-175BPM.wav"; path = "data/DnB-loop-175BPM.wav"; sourceTree = "<group>"; }; + 318E7A361FD748D900FEEB7E /* pipo.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = pipo.json; path = data/pipo.json; sourceTree = "<group>"; }; 319C93ED1FC49B5C0055BE40 /* BayesianFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BayesianFilter.cpp; path = pipo/modules/bayesfilter/src/BayesianFilter.cpp; sourceTree = "<group>"; }; 319C93EE1FC49B5C0055BE40 /* BayesianFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BayesianFilter.h; path = pipo/modules/bayesfilter/src/BayesianFilter.h; sourceTree = "<group>"; }; 319C93EF1FC49B5C0055BE40 /* filter_utilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = filter_utilities.cpp; path = pipo/modules/bayesfilter/src/filter_utilities.cpp; sourceTree = "<group>"; }; @@ -621,6 +620,7 @@ 311BA3221EDC7B9A00244DAC /* data */ = { isa = PBXGroup; children = ( + 318E7A361FD748D900FEEB7E /* pipo.json */, 311BA3231EDC7BA400244DAC /* DnB-loop-175BPM.wav */, ); name = data;