diff --git a/Makefile.am b/Makefile.am index 82bca23..f4bfeec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,6 +22,7 @@ AM_LDFLAGS = # debug/release switches if DEBUG AM_CFLAGS += -g + # -Wextra -Werror -Wconversion -fsanitize=address AM_CXXFLAGS += -g -Wall -fsanitize=undefined else AM_CFLAGS += -O3 diff --git a/src/cwtest/cfg/main.cfg b/src/cwtest/cfg/main.cfg index b6b99d2..29cff7c 100644 --- a/src/cwtest/cfg/main.cfg +++ b/src/cwtest/cfg/main.cfg @@ -29,6 +29,13 @@ spscBuf: {}, spscQueueTmpl: {}, + nbmpscQueue: { + blkN: 4, + blkByteN: 1024, + testDurMs: 2000, + threadN: 2 + } + websockSrv: { physRootDir: "~/src/cwtest/src/libcw/html/websockSrvTest", dfltHtmlPageFn: "test_websocket.html", @@ -40,7 +47,7 @@ midiDevice: { appNameStr: "test_app", fileDevName: "file_dev", - fileDevReadAheadMicros: 1000, + fileDevReadAheadMicros: 3000, parseBufByteCnt: 1024, testFileLabel: "file_0", testFileEnableFl: true, @@ -57,7 +64,28 @@ ] }, - + /* + midiSource: { + fname: "~/temp/test.mid", + src: { + ticks_per_quarter: 480, + noteL: [ + { tempo : 120 }, + { bar: 1 } + { meter: [ 4, 4 ] }, + { voiceL: [ [ + { b : [ Cs3, mf ] }, // 1st beat : qtr note + { b : [ [E1 B3] , p ] }, // 2nd beat : two 8ths at p + { b : [ [E2 [A1 B2]] , mf ] }, // 3rd beat : 8th and two 16ths + { b : [ [E3 [A1 [B2 p]]] , mf ] }, // 4th beat : 8th and two 16ths w/ dyn + { b : [ [E4 [R r.]] + ]] + { bar: 2 } + ] + } + }, + */ + midiFileDev: { fname: "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data1/beck2/record_5/midi.mid" }, @@ -927,6 +955,11 @@ } + gutim_reg: { + dir: "~/temp/cw_reg/reg.csv" + + }, + audio_transforms: {}, // Convert the the 'am' files in 'inDir' to MIDI and CSV files @@ -935,10 +968,16 @@ // All output files are written in the same directory as the 'am' files. am_to_midi_file: [ - { enable_fl: true, player_name: "beck", prefix_label:"beck_1", sess_numb:1, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/beck1" }, - { enable_fl: true, player_name: "beck", prefix_label:"beck_2", sess_numb:2, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/beck2" }, - { enable_fl: true, player_name: "taka", prefix_label:"taka_1", sess_numb:1, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/taka1" }, - { enable_fl: true, player_name: "taka", prefix_label:"taka_2", sess_numb:2, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/taka2" } + { enable_fl: false, player_name: "beck", prefix_label:"beck_1", sess_numb:1, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/beck1" }, + { enable_fl: false, player_name: "beck", prefix_label:"beck_2", sess_numb:2, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/beck2" }, + { enable_fl: false, player_name: "taka", prefix_label:"taka_1", sess_numb:1, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/taka1" }, + { enable_fl: false, player_name: "taka", prefix_label:"taka_2", sess_numb:2, beg_loc: 4232, end_loc: 4707, dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/data/taka2" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 120, end_loc: 146, dir: "~/temp/shiau_uen/segment_0" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 888, end_loc: 929, dir: "~/temp/shiau_uen/segment_1" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 2287, end_loc: 2454, dir: "~/temp/shiau_uen/segment_2" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 3765, end_loc: 3883, dir: "~/temp/shiau_uen/segment_3" }, + { enable_fl: false, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 5407, end_loc: 5462, dir: "~/temp/shiau_uen/segment_4" }, + { enable_fl: true, player_name: "ding", prefix_label:"ding_1", sess_numb:1, beg_loc: 6608, end_loc: 6677, dir: "~/temp/shiau_uen/segment_5" } ], audio_file_proc: { diff --git a/src/cwtest/main.cpp b/src/cwtest/main.cpp index c89cd45..20a0214 100644 --- a/src/cwtest/main.cpp +++ b/src/cwtest/main.cpp @@ -17,6 +17,7 @@ #include "cwKeyboard.h" #include "cwSpScBuf.h" #include "cwSpScQueueTmpl.h" +#include "cwNbMpScQueue.h" #include "cwThreadMach.h" #include "cwSerialPort.h" #include "cwSerialPortSrv.h" @@ -40,6 +41,7 @@ #include "cwPerfMeas.h" #include "cwPianoScore.h" +#include "cwGutimReg.h" #include "cwIoPresetSelApp.h" @@ -415,6 +417,7 @@ cw::rc_t kbTest2Test( const cw::object_t* cfg, const cw::object_t* args cw::rc_t kbTest3Test( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { cw::kbTest3(); return cw::kOkRC; } cw::rc_t spscBuf( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::spsc_buf::test(); } cw::rc_t spscQueueTmpl( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::testSpScQueueTmpl(); } +cw::rc_t nbMpScQueue( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::nbmpscq::test(args); } cw::rc_t serialPortSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::serialPortSrvTest(); } 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(); } @@ -435,6 +438,7 @@ cw::rc_t fftTest( const cw::object_t* cfg, const cw::object_t* args 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(); } cw::rc_t pianoScoreTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::perf_score::test(args); } +cw::rc_t gutimRegTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::gutim::reg::test(args); } cw::rc_t audioTransformsTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::dsp::test(args); } cw::rc_t amToMidiFile( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi_record_play::am_to_midi_file(args); } cw::rc_t audioFileProc( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::file_processor(args); } @@ -786,6 +790,7 @@ int main( int argc, const char* argv[] ) { "kbTest3", kbTest3Test }, { "spscBuf", spscBuf }, { "spscQueueTmpl", spscQueueTmpl }, + { "nbmpscQueue", nbMpScQueue }, { "websockSrv", websockSrvTest }, { "serialSrv", serialPortSrvTest }, { "midiDeviceReport", midiDeviceReport }, @@ -834,6 +839,7 @@ int main( int argc, const char* argv[] ) { "ifft", ifftTest }, { "convolve", convolveTest }, { "piano_score", pianoScoreTest }, + { "gutim_reg", gutimRegTest }, { "audio_transforms", audioTransformsTest }, { "am_to_midi_file", amToMidiFile }, { "audio_file_proc", audioFileProc },