From 391d7422b21617cfffdb29315191f7ab665c5cc1 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 21 Feb 2021 08:55:56 -0500 Subject: [PATCH] main.cpp, main.cfg : Added 'midifile' and 'generate_audio' tests. --- src/cwtest/cfg/main.cfg | 20 ++++++++++++++++++++ src/cwtest/main.cpp | 7 ++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/cwtest/cfg/main.cfg b/src/cwtest/cfg/main.cfg index 5d8c5c4..f6e3cb1 100644 --- a/src/cwtest/cfg/main.cfg +++ b/src/cwtest/cfg/main.cfg @@ -200,6 +200,14 @@ y1: [ [9,12,15],[12,17,22],[15,22,29] ], }, + midifile: + { + rpt0: { midiFn:"~/media/audio/midi/988-v25.mid" } + rpt: { midiFn:"~/src/currawong/site/web_part_selection/GUTIM part 1 no colors, single system all sections correcting staves distance.mid"} + csv: { midiFn:"~/src/currawong/site/web_part_selection/GUTIM part 1 no colors, single system all sections correcting staves distance.mid", + csvFn: "~/temp/midi.csv" } + }, + audiofile: { rpt: { fn:"~/temp/temp_sine.wav", begIdx: 0, frmCnt: 10 } @@ -453,6 +461,18 @@ }, + generate_audio: + { + dstFn: "~/temp/click.wav", + dstBits: 32, + dstSrate: 48000, + dstSecs: 711.0, // file duration in secs + op: "click", + + sine: { gain:0.7, hertz:440.0 }, + click: { gain:0.8, decay:0.9, msL:[ 61000,117000,181000,241500,280500,312000,357300,419800,480000,535500,584200,646100,678000,709500 ] } + }, + transform_app: { srcDir: "~/temp/kc_record/xform_only/cut", // location of 'wet' source files diff --git a/src/cwtest/main.cpp b/src/cwtest/main.cpp index e13777e..90f42d4 100644 --- a/src/cwtest/main.cpp +++ b/src/cwtest/main.cpp @@ -31,6 +31,7 @@ #include "cwTime.h" #include "cwMidi.h" +#include "cwMidiFile.h" #include "cwAudioDevice.h" #if defined(cwALSA) @@ -344,6 +345,7 @@ cw::rc_t serialPortSrvTest( const cw::object_t* cfg, const cw::object_t* args cw::rc_t textBufTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::textBuf::test(); } cw::rc_t audioBufTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::buf::test(); } cw::rc_t mtxTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::mtx::test(args); } +cw::rc_t midiFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi::file::test(args); } cw::rc_t audioFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audiofile::test(args); } cw::rc_t audioFileOp( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::test(args); } cw::rc_t audioFileMix( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::mix(args); } @@ -352,6 +354,7 @@ cw::rc_t audioFileCutAndMix( const cw::object_t* cfg, const cw::object_t* args cw::rc_t audioFileParallelMix( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::parallelMix(args); } cw::rc_t audioFileTransformApp(const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::transformApp(args); } cw::rc_t audioFileConvolve( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::convolve(args); } +cw::rc_t audioFileGenerate( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::generate(args); } cw::rc_t fftTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dsp::fft::test(); } cw::rc_t ifftTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dsp::ifft::test(); } cw::rc_t convolveTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dsp::convolve::test(); } @@ -690,14 +693,16 @@ int main( int argc, const char* argv[] ) { "dataset_adapter", datasetAdapterTest }, { "svg", svgTest }, { "mtx", mtxTest }, - { "afop", audioFileOp }, + { "midifile", midiFileTest }, { "audiofile", audioFileTest }, + { "afop", audioFileOp }, { "audio_mix", audioFileMix }, { "select_to_file", audioFileSelToFile }, { "cut_and_mix", audioFileCutAndMix }, { "parallel_mix",audioFileParallelMix }, { "transform_app", audioFileTransformApp }, { "convolve_file", audioFileConvolve }, + { "generate_audio",audioFileGenerate }, { "fft", fftTest }, { "ifft", ifftTest }, { "convolve", convolveTest },