main.cpp,main.cfg : Added vectOpTest(),scoreFollowTest(),

This commit is contained in:
kevin 2023-02-14 21:15:51 -05:00
parent 48620bd597
commit edffaf20f3
2 changed files with 660 additions and 619 deletions

View File

@ -19,6 +19,7 @@
fileSys: {}, fileSys: {},
numbCvt: {}, numbCvt: {},
object: {}, object: {},
vop:{},
time:{}, time:{},
thread: {}, thread: {},
kbTest1: {}, kbTest1: {},
@ -208,8 +209,12 @@
record_fn_ext: "am", record_fn_ext: "am",
max_midi_msg_count: 32768, max_midi_msg_count: 32768,
midi_timer_period_micro_sec: 15000, midi_timer_period_micro_sec: 15000,
midi_out_device: "Fastlane", //midi_out_device: "Fastlane",
midi_out_port: "Fastlane MIDI A", //midi_out_port: "Fastlane MIDI A",
midi_out_device: "iRig MIDI 2",
midi_out_port: "iRig MIDI 2 MIDI 1",
audio_in_ch_map: [0, 1 ], audio_in_ch_map: [0, 1 ],
audio_out_ch_map: [0, 1 ] audio_out_ch_map: [0, 1 ]
}, },
@ -223,6 +228,8 @@
fmtBufByteN: 4096, fmtBufByteN: 4096,
websockTimeOutMs: 50, // max time out while blocking for a websock event websockTimeOutMs: 50, // max time out while blocking for a websock event
uiCfgFn: "ui.cfg" // default UI resource description uiCfgFn: "ui.cfg" // default UI resource description
idleMsgPeriodMs: 50, // period without messages before an idle message is generated
asyncFl: false
}, },
@ -232,6 +239,8 @@
recvBufByteN: 512 recvBufByteN: 512
array: [ array: [
{ {
enableFl: false,
asyncFl: false,
label: "port1", // User label label: "port1", // User label
device: "/dev/ttyACM0", // Serial device name device: "/dev/ttyACM0", // Serial device name
baud: 38400, baud: 38400,
@ -245,6 +254,7 @@
midi: { midi: {
parserBufByteN: 1024, parserBufByteN: 1024,
asyncFl: false
}, },
audio: { audio: {
@ -254,6 +264,7 @@
groupL: [ groupL: [
{ {
enableFl: true, // (req) enableFl: true, // (req)
asyncFl: true,
label: "main", // (req) User label label: "main", // (req) User label
id: 0, // (req) User id (can also be set at runtime) id: 0, // (req) User id (can also be set at runtime)
srate: 48000, // (req) Sample rate used by all devices in this group srate: 48000, // (req) Sample rate used by all devices in this group
@ -281,6 +292,7 @@
socket: { socket: {
asyncFl: false,
maxSocketCnt: 10, maxSocketCnt: 10,
recvBufByteCnt: 4096, recvBufByteCnt: 4096,
threadTimeOutMs: 50, threadTimeOutMs: 50,
@ -1733,7 +1745,7 @@
} }
} },
stereo_network: { stereo_network: {
ain: { class: audio_in, args:{ default:{dev_label:"main"} } }, ain: { class: audio_in, args:{ default:{dev_label:"main"} } },
@ -1765,7 +1777,7 @@
merge: { class: audio_merge, in:{ in0:wet_gain.out, in1:dry_gain.out }, args:{} }, merge: { class: audio_merge, in:{ in0:wet_gain.out, in1:dry_gain.out }, args:{} },
aout: { class: audio_out, in:{ in:merge.out }, args:{ default:{dev_label:"main"} } }, aout: { class: audio_out, in:{ in:merge.out }, args:{ default:{dev_label:"main"} } },
} },
sine_network: { sine_network: {
framesPerCycle: 64, // time-domain audio cycles frame per cycle framesPerCycle: 64, // time-domain audio cycles frame per cycle
@ -1786,13 +1798,26 @@
merge: { class: audio_merge, in:{ in0:mix.out, in1:splitR.out }, args:{}}, merge: { class: audio_merge, in:{ in0:mix.out, in1:splitR.out }, args:{}},
aout: { class: audio_out, in:{ in:merge.out }, args:{ default:{dev_label:"main"} } }, aout: { class: audio_out, in:{ in:merge.out }, args:{ default:{dev_label:"main"} } },
} },
presets: { presets: {
a: { splitL:hi, splitR:lo }, a: { splitL:hi, splitR:lo },
b: { splitL:lo, splitR:hi } b: { splitL:lo, splitR:hi }
} }
},
score_follow: {
"midi_fname": "~/src/currawong/audio/workshop/beck1/record_4/midi.mid",
"srate": 48000,
"out_dir": "~/temp/score_follow_test"
cfg: {
"score_csv_fname": "~/src/currawong/projects/score_follow/cm_score.csv",
"search_area_locN": 10,
"key_wnd_locN": 7,
}
} }
} }

View File

@ -30,6 +30,8 @@
#include "cwFlow.h" #include "cwFlow.h"
#include "cwPianoScore.h" #include "cwPianoScore.h"
#include "cwIoPresetSelApp.h" #include "cwIoPresetSelApp.h"
#include "cwCmInterface.h"
#include "cwScoreFollower.h"
#if defined(cwWEBSOCK) #if defined(cwWEBSOCK)
#include "cwWebSock.h" #include "cwWebSock.h"
@ -350,6 +352,16 @@ cw::rc_t objectTest( const cw::object_t* cfg, const cw::object_t* args, int argc
return cw::kOkRC; return cw::kOkRC;
} }
cw::rc_t vectOpTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{
int v1[] = { 1,2,1,2,1,2,1,2,1,2 };
int v0[ 10 ];
cw::vop::deinterleave( v0, v1, 5, 2 );
cw::vop::print(v0,10,"%i ");
return cw::kOkRC;
}
cw::rc_t timeTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::time::test(); } cw::rc_t timeTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::time::test(); }
cw::rc_t threadTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::threadTest(); } cw::rc_t threadTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::threadTest(); }
cw::rc_t kbTest1Test( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { cw::kbTest1(); return cw::kOkRC; } cw::rc_t kbTest1Test( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { cw::kbTest1(); return cw::kOkRC; }
@ -394,6 +406,8 @@ cw::rc_t flowTest( const cw::object_t* cfg, const cw::object_t* args
return cw::flow::test(flow_proc_dict,args); return cw::flow::test(flow_proc_dict,args);
} }
cw::rc_t scoreFollowTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::score_follower::test(args); }
#if defined(cwWEBSOCK) #if defined(cwWEBSOCK)
cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::websockSrvTest(cfg); } cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::websockSrvTest(cfg); }
@ -718,6 +732,7 @@ int main( int argc, const char* argv[] )
{ "fileSys", fileSysTest }, { "fileSys", fileSysTest },
{ "numbCvt", numbCvtTest }, { "numbCvt", numbCvtTest },
{ "object", objectTest }, { "object", objectTest },
{ "vop", vectOpTest },
{ "time", timeTest }, { "time", timeTest },
{ "thread", threadTest }, { "thread", threadTest },
{ "kbTest1", kbTest1Test }, { "kbTest1", kbTest1Test },
@ -777,6 +792,7 @@ int main( int argc, const char* argv[] )
{ "flow_pv", flowTest }, { "flow_pv", flowTest },
{ "flow_spec_dist", flowTest }, { "flow_spec_dist", flowTest },
{ "preset_sel", ioPresetSelTest }, { "preset_sel", ioPresetSelTest },
{ "score_follow", scoreFollowTest },
{ "stub", stubTest }, { "stub", stubTest },
{ nullptr, nullptr } { nullptr, nullptr }
}; };