From 67454d169396a75a34c950798f3e9587c79287c8 Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 25 May 2024 08:51:53 -0400 Subject: [PATCH] flow/flow_proc_dict.cfg, flow_test.cfg : Added 'print'. Fixed error in 'audio_file_in.eofFl' spec.. Added 'test_14' to test 'print' proc. --- src/cwtest/cfg/flow/flow_proc_dict.cfg | 12 ++++++-- src/cwtest/cfg/flow/flow_test.cfg | 41 +++++++++++++------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/cwtest/cfg/flow/flow_proc_dict.cfg b/src/cwtest/cfg/flow/flow_proc_dict.cfg index 07e816a..7f49fcc 100644 --- a/src/cwtest/cfg/flow/flow_proc_dict.cfg +++ b/src/cwtest/cfg/flow/flow_proc_dict.cfg @@ -16,7 +16,7 @@ audio_out: { vars: { - dev_label: { type:string, doc:"Audio device label." }, + dev_label: { type:string, doc:"Audio device label." }, in: { type:audio, flags:["src"], doc:"Audio input." } } } @@ -27,7 +27,7 @@ out:{ type:audio, doc:"Audio file output" }, on_off:{ type:bool, value:false, doc:"1=on 0=off" },, seekSecs:{ type:ftime, value:0.0, doc:"Seek to the specified seconds offset." } - eofFl:{ type:bool, eofFl: true, doc:"Set the system 'halt' flag when the audio is completely read."}, + eofFl:{ type:bool, value: true, doc:"Set the system 'halt' flag when the audio is completely read."}, } } @@ -630,6 +630,14 @@ out_gain: { type:coeff, value: 1, doc:"Output gain" }, out: { type:audio, doc:"Audio output." }, } + }, + + print: { + vars: { + in: { type:all, flags:["mult"], doc: "Value to print." }, + eol_fl: { type:all, doc: "Trigger an end-of-line." }, + text: { type:cfg, doc: "List of labels." }, + } } diff --git a/src/cwtest/cfg/flow/flow_test.cfg b/src/cwtest/cfg/flow/flow_test.cfg index 354f3ac..fa8168a 100644 --- a/src/cwtest/cfg/flow/flow_test.cfg +++ b/src/cwtest/cfg/flow/flow_test.cfg @@ -6,15 +6,11 @@ subnet_cfg_fname:"~/src/cwtest/src/cwtest/cfg/flow/flow_subnet_dict.cfg", project_dir:"~/src/cwtest/src/cwtest/cfg/flow/ttest", test_ref_dir:"~/src/cwtest/src/cwtest/cfg/flow/test_ref", - cmp_enable_fl: true, test_cases: { test_0: { - framesPerCycle:64, maxCycleCount:3750, // 5 seconds - printNetworkFl: false, // print the network instance - printClassDictFl: false, // print the class description dictionary network: { @@ -27,7 +23,6 @@ } test_1: { - framesPerCycle: 64, maxCycleCount: 1500, printNetworkFl: false, // print the network instance network: { @@ -36,7 +31,7 @@ lfo: { class: sine_tone, args:{ hz:3, dc:440, gain:110 }} sh: { class: sample_hold, in:{ in:lfo.out } } osc: { class: sine_tone, in:{ hz:sh.out } }, - afout: { class: audio_file_out, in: { in:osc.out } args:{ fname:"/home/kevin/temp/audio_flow_out.wav"} } + afout: { class: audio_file_out, in: { in:osc.out } args:{ fname:"$/audio_flow_out.wav"} } } presets: { @@ -47,7 +42,6 @@ } test_2: { - framesPerCycle: 64, maxCycleCount: 7500, network: { @@ -63,7 +57,6 @@ test_3: { - framesPerCycle: 64, maxCycleCount: 7500, network: { @@ -80,7 +73,6 @@ } test_4: { - framesPerCycle: 64, maxCycleCount: 15000, printNetworkFl: false, @@ -109,7 +101,6 @@ // Same as test_4 but using the system sample rate test_5: { - framesPerCycle: 64, maxCycleCount: 15000, sample_rate: 48000, @@ -137,7 +128,6 @@ // Simple poly test_6: { - framesPerCycle: 64, maxCycleCount: 7500, sample_rate: 48000, printNetworkFl: false, // print the network instance @@ -159,10 +149,13 @@ osc: { class: sine_tone, in:{ hz: sh.out }} } + // Note the use of the trailing underscore to create matching presets + // on all poly channels. Without the underscore the presets would only + // be applied to poly channel 0. presets: { - a: { lfo: { hz:1, dc:880 }, osc: { gain:0.95 } }, - b: { lfo: { hz:2, dc:220 }, osc: { gain:0.75 } }, - c: { lfo: a220 }, + a: { lfo_: { hz:1, dc:880 }, osc_: { gain:0.95 } }, + b: { lfo_: { hz:2, dc:220 }, osc_: { gain:0.75 } }, + c: { lfo_: a220 }, } } } @@ -178,7 +171,6 @@ // Test using xfade_ctl to cross-fade and assign presets. test_7: { - framesPerCycle: 64, maxCycleCount: 7500, sample_rate: 48000, printNetworkFl: false, // print the network instance @@ -238,7 +230,6 @@ // to non-poly procs using the poly index to select sources. // See `in:{ lfo_.dc:dc_list.value_}` test_8: { - framesPerCycle: 64, maxCycleCount: 7500, sample_rate: 48000, printNetworkFl: false, // print the network instance @@ -298,7 +289,6 @@ // Test using a subnet. test_9 : { - framesPerCycle: 64, maxCycleCount: 7500, sample_rate: 48000, printNetworkFl: false, // print the network instance @@ -319,7 +309,6 @@ // Testing using proc instances with explicit suffix ids. // See: list0 and list1 test_10: { - framesPerCycle: 64, maxCycleCount: 15000, network: { @@ -338,7 +327,6 @@ // Test with no exec cycles. // This network only runs the initialization pass. test_11: { - framesPerCycle: 64, maxCycleCount: 0, network: { @@ -352,7 +340,6 @@ // Test the 'out' statement to set feedback connections. test_12: { - framesPerCycle: 64, maxCycleCount: 10, network: { @@ -369,7 +356,6 @@ // Same as test_4 but with a dual-preset. See preset 'd'. test_13: { - framesPerCycle: 64, maxCycleCount: 15000, printNetworkFl: false, @@ -397,6 +383,19 @@ } } + test_14: { + maxCycleCount: 3750, + + network { + procs: { + tmr: { class: timer, args:{ period_ms:1000.0 }}, + cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:3, inc:1, init:0, mode:clip, out_type:uint }} + add: { class: add, in: { in0:cnt.out, in1:cnt.out }, } + + log: { class: print, in: { in0:cnt.out, in1:add.out, eol_fl:add.out }, args:{ text:["a","b","c"] }} + } + } + } } } }