Merge branch 'poly'

This commit is contained in:
kevin 2024-11-29 17:42:26 -05:00
commit 0a46805d04
50 changed files with 10818 additions and 1027 deletions

3
.gitignore vendored
View File

@ -9,6 +9,9 @@ data
data1 data1
data_perf_vel_study data_perf_vel_study
midi_record midi_record
cur
old
.deps .deps
autom4te.cache autom4te.cache

View File

@ -22,8 +22,8 @@ AM_LDFLAGS =
# debug/release switches # debug/release switches
if DEBUG if DEBUG
AM_CFLAGS += -g AM_CFLAGS += -g
# -Wextra -Werror -Wconversion -fsanitize=address # -Wextra -Werror -Wconversion -fsanitize=address -lasan -fsanitize=thread
AM_CXXFLAGS += -g -Wall -fsanitize=undefined AM_CXXFLAGS += -g -Wall -Wextra -Wno-unused -fsanitize=undefined
else else
AM_CFLAGS += -O3 AM_CFLAGS += -O3
AM_CXXFLAGS += -O3 AM_CXXFLAGS += -O3
@ -84,7 +84,7 @@ if cwWEBSOCK
src_cwtest_cwtest_LDADD += -lwebsockets src_cwtest_cwtest_LDADD += -lwebsockets
endif endif
src_cwtest_cwtest_LDADD += -lsatlas # src_cwtest_cwtest_LDADD += -lsatlas
# src_cwtest_cwtest_CPPFLAGS = -I$(srcdir)/src/libcw $(AM_CPPFLAGS) # src_cwtest_cwtest_CPPFLAGS = -I$(srcdir)/src/libcw $(AM_CPPFLAGS)
bin_PROGRAMS += src/cwtest/cwtest bin_PROGRAMS += src/cwtest/cwtest

157
README.md
View File

@ -1,4 +1,159 @@
libcw Testing and Development App # libcw Testing and Development App
Command line:
```
cwtest <file.cfg> <label>
```
Where `<file.cfg>` refers to a libcw configuration file file with the form:
```
{
test: {
`program_0`: {
a:1
b:"hello"
},
`program_1`: {
arg0:["abc","def"]
b:{ a:73, z:[19] }
}
}
```
`<label>` refers to a specific set of parameters which are associated with a library function.
See `main.cpp` `mode_array[]` for the mapping of labels to functions.
The goal of `cwtest` is to be able to easily exercize `libcw` functions with a flexible
sets of parameters. The configuration file provides the parameters.
## MIDI
# midiDeviceReport
List The current set of MIID hardware devices and their ports.
```
cwtest ~/src/cwtest/src/cwtest/cfg/main.cfg midiDeviceReport
```
# midiDevice
Interactive testing of the MIDI input file device start/pause/unpause/stop functions.
Compares the time between MIDI events as generated by the device to the actual time between the
events as listed in the file.
```
cwtest ~/src/cwtest/src/cwtest/cfg/main.cfg midiDevice
```
## Serial
```
cwtest ~/src/cwtest/src/cwtest/cfg/main.cfg midiDeviceReport
```
See `serialPortSrvTest()` in `cwSerialPortSrv.cpp`.
This is an interactive test of the serial port send/receive functions.
The test function continuously transmits ASCII values '0' through 'z' to external devices `/dev/ttyACM0` and '/dev/ttyACM1`.
Those devices should increment the received value and send it back, where it is receieved and printed to the console.
Firmware to run on ATMEGA328 based devices, like the Arduino Uno, is provided in `study/serial/arduino_xmt_recv/main.c`.
## wesockSrv
```
cwtest ~/src/cwtest/src/cwtest/cfg/main.cfg websockSrv
```
See `websockSrvTest()` in `cwWebSockSvr.cpp`.
Interactive websocket server testing application.
Run the app and navigate in a web browser to `localhost:5687` to run the application.
## nbmpscQueue
```
cwtest ~/src/cwtest/src/cwtest/cfg/main.cfg nbmpscQueue
```
See `test()` in cwNbMpScQueue.cpp.
Run the non-blocking, multiple producer, single consumer queue for 'testDurMs' millisecdons
and write the result into 'out_fname'. This is the queue used by the websocket implementation
(See cwWebSock) to support incoming calls form multiple threads without blocking the calling threads.
## audioDevAlsa
```
cwtest ~/src/cwtest/src/cwtest/cfg/main.cfg audioDevAlsa
```
See `report()` in `cwAudioDeviceAlsa.cpp`.
Generate a list of devices and device attributes directly from the ALSA sub-system.
## audioDevRpt
```
cwtest ~/src/cwtest/src/cwtest/cfg/main.cfg audioDevRpt
```
See `report()` in `cwAudioDevice.cpp`.
Generate a list of devices and device attributes from libcw. This will include audio file based devices.
## Run Unit Tests:
These test are run by the libcw testing framework in cwTest.h/cpp.
The configuraton for the unit tests is in `src/cwtest/src/cfg/test/main.cfg`.
1. Add a new test:
- Create a function like this: rc_t my_test_func(const test_args_t& args);
- Add the module name, function pair to the `_test_map[]` in cwTest.cpp.
- Add an entry to the test parameters cfg. below.
+ Name the test case (e.g. `test_0`) and give the test parameters.
+ On the call to my_test_func() the args.module_args is set to the 'module_args' dictionary defined in the cfg.
+ Likewise args.test_args is set to the 'test_args' dictionary referenced by the test name label 'e.g. test_0:{ my_arg:1 }'.
- Run the test like this: `cwtest test/main.cfg test /my_module test_0 echo` to see the results of the test run.
The results of this run will be written into `/cur/my_test/test_0/log.txt`
- Once the results have been validated copy the output from 'cur' to the `/ref/my_test/test_0/log.txt.`
- Verify that the test passes: `cwtest test/main.cfg test /my_module test_0 compare`
2. The test spec. is recursive. Modules can be listed inside of modules. (e.g. 'lex' and 'flow').
3. If a module spec. does not have an embedded
'module' or 'module_args' then the cases may
be listed without a 'cases' label.
(e.g. 'filesys','object', 'vop')
4. Command line args:
Parameter | Description
----------------|------------------------------------------------------------------
<module_path> | 'all' (required) The module path always begins with a '/'.
<test_label> | 'all' (required)
'gen_report' | Print modulue/test label.
'compare' | Run compare pass.
'echo' | Print the generated test output to the console.
'args' | All command line args after 'args' are passed to the tests.
5. Example command lines:
```
cwtest ~/src/cwtest/src/cwtest/cfg/test/main.cfg test /lex test_0 gen
cwtest ~/src/cwtest/src/cwtest/cfg/test/main.cfg test /flow test_0 compare
```
# GDB Setup: # GDB Setup:

View File

@ -0,0 +1,630 @@
{
balance: {
vars: {
in: { type:coeff, value:0.5, doc:"Input vaue" },
out: { type:coeff, doc:"Ouput value. Same as input value."},
inv_out: { type:coeff, doc:"1.0 minus output value."}
}
}
audio_in: {
vars: {
dev_label: { type:string, doc:"Audio device label." },
out: { type:audio, doc:"Audio output" },
}
}
audio_out: {
vars: {
dev_label: { type:string, doc:"Audio device label." },
in: { type:audio, flags:["src"], doc:"Audio input." }
}
}
audio_file_in: {
vars: {
fname: { type:string, doc:"Audio file name." },
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, value: true, doc:"Set the system 'halt' flag when the audio is completely read."},
}
}
audio_file_out: {
vars: {
fname: { type:string, doc:"Audio file name." },
bits: { type:uint, value:32u, doc:"Audio file word width. (8,16,24,32,0=float32)."},
in: { type:audio, flags:["src"], doc:"Audio file input." }
}
}
audio_gain: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
gain: { type:coeff, value:1.0, doc:"Gain coefficient." }
out: { type:audio, doc:"Audio output." },
}
}
audio_split: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
select: { type:cfg, doc:"Give a list of integers where each integer selects an output channel for the associated input channel." }
igain: { type:coeff, value:1.0, doc:"Audio gain for each input channel." }
ogain: { type:coeff, value:1.0, doc:"Audio gain for each output channel." }
out: { type:audio, doc:"Audio output." },
}
presets:
{
mute_off: { gain:1 },
mute_on: { gain:0 },
}
}
audio_duplicate: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input."},
duplicate: { type: uint, doc:"Count of times to repeat this channel." },
gain: { type: coeff, value:1.0, doc:"Audio gain." },
out: { type:audio, doc:"Audio output containing repeat * input channel count channels."}
}
}
audio_merge: {
vars: {
in: { type:audio, flags:["src", "mult"], doc:"Audio input channel." },
gain: { type:coeff, value: 1, flags:["src", "mult"], doc:"Input channel gain." },
out_gain: { type:coeff, value: 1, doc:"Output gain" },
out: { type:audio, doc:"Audio output. Channel count is the sum of the input channel count." },
}
}
audio_mix: {
vars: {
in0: { type:audio, flags:["src"], doc:"First audio input." },
in1: { type:audio, flags:["src"], doc:"Second audio input." },
gain0: { type:coeff, value:0.5, doc:"Audio gain for input 0." },
gain1: { type:coeff, value:0.5, doc:"Audio gain for input 1." },
out: { type:audio, doc:"Audio output. Channel count is max of the input signal channels." },
}
}
audio_delay: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
maxDelayMs: { type:ftime, value:1000.0 doc:"Maximum possible delay in milliseconds." },
delayMs: { type:ftime, doc:"Delay in milliseconds." },
out: { type:audio, doc:"Audio output." },
}
}
sine_tone: {
vars: {
srate: { type:srate, value:0, doc:"Sine tone sample rate. 0=Use default system sample rate"}
chCnt: { type:uint, value:2, doc:"Output signal channel count."},
hz: { type:coeff, value:440.0, doc:"Frequency in Hertz."},
phase: { type:coeff, value:0.0, doc:"Offset phase in radians."},
dc: { type:coeff, value:0.0, doc:"DC offset applied after gain."},
gain: { type:coeff, value:0.8, doc:"Signal frequency."},
out: { type:audio, doc:"Audio output" },
}
presets: {
a220 : { hz:220 },
a440 : { hz:440 },
a880 : { hz:880 },
mono: { chCnt:1, gain:0.75 }
}
}
pv_analysis: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
maxWndSmpN: { type:uint, value: 512, doc:"Maximum window sample count." },
wndSmpN: { type:uint, value: 512, doc:"Window sample count." },
hopSmpN: { type:uint, value: 128, doc:"Hop sample count." },
hzFl: { type:bool, value: false, doc:"Calculate frequency via the method of phase changeof each bin." },
out: { type:spectrum, doc:"Spectrum output." }
}
presets: {
dry: {
wndSmpN: 512,
hopSmpN: 128
}
kc: {
wndSmpN: 512,
hopSmpN: 128
}
a: {
wndSmpN: 512,
hopSmpN: 128
}
b: {
wndSmpN: 512,
hopSmpN: 128
}
c: {
wndSmpN: 512,
hopSmpN: 128
}
d: {
wndSmpN: 512,
hopSmpN: 128
}
f_1: {
wndSmpN: 512,
hopSmpN: 128
}
f_2: {
wndSmpN: 512,
hopSmpN: 128
}
f_3: {
wndSmpN: 512,
hopSmpN: 128
}
f_4: {
wndSmpN: 512,
hopSmpN: 128
}
g: {
wndSmpN: 512,
hopSmpN: 128
}
g_a: {
wndSmpN: 512,
hopSmpN: 128
}
g_1_a: {
wndSmpN: 512,
hopSmpN: 128
}
g_1_d: {
wndSmpN: 512,
hopSmpN: 128
}
}
}
pv_synthesis: {
vars: {
in: { type:spectrum, flags:["src"], doc:"Spectrum input." },
out: { type:audio, doc:"Audio output." }
}
}
spec_dist: {
vars: {
in: { type:spectrum, flags:["src"], doc:"Spectrum input." },
bypass: { type:bool, value: false, doc:"Copy input to output without transform."},
ceiling: { type:coeff, value: 30.0, doc:"Ceiling parameter."},
expo: { type:coeff, value: 2.0, doc:"Exponent parameter."},
thresh: { type:coeff, value: 54.0, doc:"Threshold parameter."},
upr: { type:coeff, value: -0.7, doc:"Upper slope parameter."},
lwr: { type:coeff, value: 2.0, doc:"Lower slope parameter."},
mix: { type:coeff, value: 0.0, doc:"Basic/Bump Mix parameter."},
out: { type:spectrum, doc:"Spectrum output." },
}
presets: {
dry: {
}
kc: {
ceiling: 20.0,
expo: 2.0,
thresh: 65.0,
upr: 0.0,
lwr: 2.0,
mix: 0.0
}
a: {
ceiling: 20.0
expo: 2.0
thresh: 60.0
upr: [ -1.1, -0.99],
lwr: 2.0
mix: 0.0
}
b: {
ceiling: 20.0
expo: 2.0
thresh: [ 77.0, 74.0 ],
upr: -0.5
lwr: [ 3.0, 2.0 ],
mix: 0.0
}
c: {
ceiling: 20.0
expo: 2.0
thresh: 80.0
upr: -0.5
lwr: 5.0
mix: 0.0
}
d: {
ceiling: 20.0
expo: 2.0
thresh: 70.0
upr: [ -3.9, 04.5]
lwr: 4.0
mix: 0.0
}
f_1: {
ceiling: 20.0
expo: 2.0
thresh: 50.0
upr: -3.0
lwr: 1.0
mix: 0.0
}
f_2: {
ceiling: 20.0
expo: 2.0
thresh: 60.0
upr: -3.0
lwr: 1.0
mix: 0.0
}
f_3: {
ceiling: 20.0
expo: 2.0
thresh: 55.0
upr: -3.0
lwr: 1.0
mix: 0.0
}
f_4: {
ceiling: 20.0
expo: 2.0
thresh: 55.0
upr: -5.0
lwr: 1.0
mix: 0.0
}
g: {
ceiling: 40.0
expo: 8.0
thresh: [60.0 64.0]
upr: -0.7
lwr: 8.0
mix: 1.0
}
g_a: {
ceiling: 40.0
expo: 2.0
thresh: [50.0 54.0]
upr: -0.7
lwr: 2.0
mix: 1.0
}
g_1_a: {
ceiling: 20.0
expo: 2.0
thresh: [50.0 54.0]
upr: -0.7
lwr: 8.0
mix: 1.0
}
g_1_d: {
ceiling: [60.0 64.0]
expo: [ 7.0 5.0]
thresh: [40.0 34.0]
upr: [-0.4 -0.3]
lwr: [ 7.0 5.0]
mix: 1.0
}
}
}
compressor: {
vars: {
in: { type:audio, flags:["src"] true, doc:"Audio input." },
bypass: { type:bool, value: false, doc:"Bypass the compressor."},
igain: { type:coeff, value: 1.0, doc:"Input gain."},
thresh: { type:coeff, value: 90.0, doc:"Attack threshold in dB."},
ratio: { type:coeff, value: 2.0, doc:"Compression ratio."},
atk_ms: { type:coeff, value: 20.0, doc:"Attack time in milliseconds."},
rls_ms: { type:coeff, value: 20.0, doc:"Release time in milliseconds."},
wnd_ms: { type:coeff, value: 200.0, doc:"RMS calc. window length in milliseconds."},
maxWnd_ms: { type:coeff, value: 1000.0, doc:"Maximim (allocated) window length in milliseconds."},
ogain: { type:coeff, value: 1.0, doc:"Output gain."},
out: { type:audio, doc:"Audio output." },
}
presets: {
dflt: {
igain: 3.0
thresh: 60.0
ratio: 5.0
atk_ms: 5.0
rls_ms: 20.0
wnd_ms:100.0
ogain: 1.0
}
kc: {
bypass: false
igain: 3.0
thresh: 80.0
ratio: 2.0
atk_ms: 20.0
rls_ms: 1000.0
wnd_ms: 200.0
ogain: 1.0
}
input: {
bypass: false
igain: 2.0
thresh: 30.0
ratio: 12.0
atk_ms: 5.0
rls_ms: 20.0
wnd_ms: 20.0
ogain: 0.5
}
dry: {
}
a: {
igain: 6.0
ogain: 1.0
}
b: {
igain: 10.0
ogain: 1.0
}
c: {
igain: 11.0
ogain: 1.0
}
d: {
igain: 9.0
ogain: 1.0
}
f_1: {
igain: 6.0
ogain: 1.0
}
f_2: {
igain: 6.0
ogain: 1.0
}
f_3: {
igain: 6.0
ogain: 1.0
}
f_4: {
igain: 6.0
ogain: 1.0
}
g: {
igain: 10.0
ogain: 0.75
}
g_a: {
igain: 10.0
ogain: 0.75
}
g_1_a: {
igain: 10.0
ogain: 0.75
}
g_1_d: {
igain: 10.0
ogain: 0.75
}
}
}
limiter: {
vars: {
in: { type:audio, flags:["src"] true, doc:"Audio input." },
bypass: { type:bool, value: false, doc:"Bypass the limiter."},
igain: { type:coeff, value: 1.0, doc:"Input gain."},
thresh: { type:coeff, value: 0.0, doc:"Linear (0.0-1.0) threshold."},
ogain: { type:coeff, value: 1.0, doc:"Output gain."},
out: { type:audio, doc:"Audio output." },
}
presets: {
dflt: {
bypass: false,
igain: 1.0
thresh: 0.9,
ogain: 1.0
}
}
}
dc_filter: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
bypass: { type:bool, value: false, doc:"Bypass the DC filter."},
gain: { type:coeff, value: 1.0, doc:"Output gain."},
out: { type:audio, doc:"Audio output." },
}
presets: {
dflt: {
bypass: false,
gain: 1.0
}
}
}
audio_meter: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
dbFl: { type:bool, value: true, doc:"Output in Decibels." },
wndMs: { type:ftime, value: 100.0, doc:"RMS window length." },
peakDb: { type:coeff, value: -10.0, doc:"Peak threshold." },
out: { type:coeff, value: 0.0, doc:"Meter output." },
peakFl: { type:bool, value: false, doc:"Peak output." }
clipFl: { type:bool, value: false, doc:"Clip indicator output."}
}
}
subnet: {
vars: {
}
}
poly: {
vars: {
count: { type:uint, doc:"Count of network duplicates." },
order: { type:string, value:"net", doc:"Execution order 'net'=net first 'proc'=proc first" }
}
}
sample_hold: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input source." },
period_ms: { type:ftime, value:50, doc:"Sample period in milliseconds." },
out: { type:sample, value:0.0, doc:"First value in the sample period." },
mean: { type:sample, value:0.0, doc:"Mean value of samples in period." },
}
}
number: {
vars: {
value: { type:numeric, value:0.0, doc:"Input and output value."},
store: { type:numeric, value:0.0, doc:"Store but don't emit until the next exec."}
}
}
timer: {
vars: {
srate: { type:srate, value:0, flags["src"], doc:"Sample rate to use as the time base. 0=Use default system sample rate." },
period_ms: { type:ftime, value:100, doc:"Timer period in milliseconds." },
out: { type:bool, value:false, doc:"Output pulse." },
}
}
counter: {
vars: {
trigger: { type:bool, flags["src"], doc:"Counter increments with each toggle of trigger." },
reset: { type:bool, value:false, doc:"Reset the counter to the initial value." },
init: { type:numeric, value:0.0, doc:"Counter initial value." },
min: { type:numeric, value:0.0, doc:"Minimum output value." },
max: { type:numeric, value:10.0, doc:"Maximum output value." },
inc: { type:numeric, value:1.0, doc:"Incrment value." },
repeat_fl: { type:bool, value:true, doc:"Repeat on reaching the limits." },
mode: { type:string, value:"modulo", doc:"limit mode: 'modulo'=wrap, 'reverse'=count in opposite direction, 'clip'=repeat limit value."},
out_type: { type:string, value:double, flags["init"], doc:"The type of the output value." },
out: { type:runtime, value:0.0, doc:"Counter output value."},
}
}
// All elements of the list must belong to the same of three possible types:
// string,cfg,numeric (uint,int,float,double)
list: {
vars: {
in: { type:uint, flags:["src"], doc:"List selection index." },
list: { type:cfg, doc:"List as a 'cfg' object." },
out: { type:runtime, doc:"List output value." },
value:{ type:runtime, flags["mult"], doc:"List 'mult' output per list value." },
}
}
add: {
vars: {
in: { type:numeric, flags:["src","mult"], doc:"Operands" },
otype: { type:string, value:double, flags:["init"], doc:"The type of the output value." },
out: { type:runtime, flags:["no_src"], doc:"Result" },
}
}
preset: {
vars: {
in: { type:string, flags:["src"], doc:"Preset to select." },
}
}
xfade_ctl: {
poly_limit_cnt: 1,
// Notes:
// 1. It would be better to setup the source net-proc as a 'in' variable with type 'net'.
// 2. The only purpose for the 'srateSrc' is to get the sample rate of the system.
vars: {
net: { type:string, doc:"Proc name of the poly network."},
netSfxId: { type:uint, value: 0, doc:"Label sfx id of the source poly instance."},
srateSrc: { type:audio, flags:["src"], doc:"Audio source to derive the sample rate."},
durMs: { type:uint, value:1000, doc:"Cross-fade duration in milliseconds" },
trigger: { type:all, doc:"Start cross-fade." },
preset: { type:string, doc:"Preset to apply to the poly network." },
gain: { type:coeff, flags:["mult"], value:0, doc:"Cross-fade gain 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." },
}
}
}

View File

@ -0,0 +1,34 @@
{
mod_osc: {
vars: {
hz: { proxy:hz_lfo.dc, doc:"Audio frequency" },
hz_mod_hz: { proxy:hz_lfo.hz, doc:"Frequency modulator hz" },
hz_mod_depth: { proxy:hz_lfo.gain, doc:"Frequency modulator depth" },
amp_mod_hz: { proxy:amp_lfo.hz, doc:"Amplitude modulator hz" },
amp_mod_depth: { proxy:amp_lfo.gain, doc:"Amplutide modulator depth."},
mo_out: { proxy:ogain.out flags:[out] doc:"Oscillator output."},
},
network: {
procs: {
hz_lfo: { class: sine_tone, args: { chCnt:1 }}
hz_sh: { class: sample_hold, in:{ in:hz_lfo.out }}
amp_lfo: { class: sine_tone, args: { chCnt:1 }}
amp_sh: { class: sample_hold, in:{ in:amp_lfo.out }}
osc: { class: sine_tone, in:{ hz: hz_sh.out }}
ogain: { class: audio_gain, in:{ in:osc.out, gain:amp_sh.out}}
}
presets: {
net_a: { hz_lfo: { dc:220, gain:55 }, amp_lfo: { gain:0.8 } },
net_b: { hz_lfo: { dc:110, gain:25 }, amp_lfo: { gain:0.7 } },
}
}
}
}

View File

@ -0,0 +1,401 @@
{
test: {
flow_test: {
proc_cfg_fname: "~/src/cwtest/src/cwtest/cfg/flow/flow_proc_dict.cfg",
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",
test_cases: {
test_0: {
maxCycleCount:3750, // 5 seconds
network: {
procs: {
osc: { class: sine_tone },
afout: { class: audio_file_out, in: { in:osc.out } args:{ fname:"$/audio_flow_out.wav"}
}
}
}
}
test_1: {
maxCycleCount: 1500,
printNetworkFl: false, // print the network instance
network: {
procs: {
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:"$/audio_flow_out.wav"} }
}
presets: {
a: { lfo:a220, osc: { gain:0.8 } },
b: { lfo:{ dc:220, gain:25 }, osc: { gain:0.5 } }
}
}
}
test_2: {
maxCycleCount: 7500,
network: {
procs: {
srate: { class: number, log:{value:0} args:{ value:48000f } },
tmr: { class: timer, in: { srate:srate.value}, log:{out:0} args:{ period_ms:1000.0 } },
cnt: { class: counter, in: { trigger:tmr.out }, log:{out:0} args:{ min:0, max:3, inc:1, init:0, mode:clip, out_type:uint, repeat_fl:false } },
list: { class: list, in: { in:cnt.out }, log:{out:0} args:{ list:[a,b,c,d] }}
}
}
}
test_3: {
maxCycleCount: 7500,
network: {
procs: {
srate: { class: number, log:{value:0} args:{ value:48000f } },
tmr: { class: timer, in: { srate:srate.value}, log:{out:0} args:{ period_ms:1000.0 } },
cnt: { class: counter, in: { trigger:tmr.out }, log:{out:0} args:{ min:0, max:3, inc:1, init:0, mode:clip, repeat_fl:false, out_type:uint } },
x0v: { class: number, log:{value:0} args:{ value:2 }},
x1v: { class: number, log:{value:0} args:{ value:3 }},
add: { class: add, in: { in0:x0v.value, in1:x1v.value, in2:cnt.out }, log:{out:0} args:{ otype:int }}
}
}
}
test_4: {
maxCycleCount: 15000,
printNetworkFl: false,
network: {
procs: {
srate: { class: number, log:{value:0} args:{ value:48000.0} },
tmr: { class: timer, in: { srate:srate.value } log:{srate:0} args:{ period_ms:2000 } },
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:2, inc:1, init:0, mode:clip, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c ] }},
ps: { class: preset, in: { in:list.out } }
lfo: { class: sine_tone, in:{ srate:srate.value }, log:{srate:0} args: { hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out } }
osc: { class: sine_tone, in:{ hz:sh.out, srate:srate.value }}
afout: { class: audio_file_out, in:{ in:osc.out } args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
a: { lfo: { hz:1.0, dc:880 }, osc: { gain:0.95 } },
b: { lfo: { hz:2.0, dc:220 }, osc: { gain:0.75 } },
c: { lfo: a220 }
}
}
}
// Same as test_4 but using the system sample rate
test_5: {
maxCycleCount: 15000,
sample_rate: 48000,
network: {
procs: {
tmr: { class: timer, log:{srate:0}, args:{ period_ms:2000 } },
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:2, inc:1, init:0, mode:clip, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c ] }},
ps: { class: preset, in: { in:list.out } }
lfo: { class: sine_tone, log:{srate:0} args: { chCnt:1, hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out } }
osc: { class: sine_tone, in:{ hz:sh.out } log:{srate:0} }
afout: { class: audio_file_out, in: { in:osc.out } args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
a: { lfo: { hz:1, dc:880 }, osc: { gain:0.95 } },
b: { lfo: { hz:2, dc:220 }, osc: { gain:0.75 } },
c: { lfo: a220 },
}
}
}
// Simple poly
test_6: {
maxCycleCount: 7500,
sample_rate: 48000,
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
procs: {
osc_poly: {
class: poly,
args: { count:3 }
network: {
procs: {
lfo: { class: sine_tone, args: { chCnt:1, hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out }}
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 },
}
}
}
poly_merge: { class: poly_merge, in:{ in_:osc_poly.osc_.out}, args:{ gain:1, out_gain:0.5 }},
afout: { class: audio_file_out, in: { in:poly_merge.out } args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
}
}
}
// Test using xfade_ctl to cross-fade and assign presets.
test_7: {
maxCycleCount: 7500,
sample_rate: 48000,
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
procs: {
tmr: { class: timer, args:{ period_ms:2000 } },
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:2, inc:1, init:0, mode:reverse, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c ] }},
osc_poly: {
class: poly,
args: { count:3 }
network: {
procs: {
lfo: { class: sine_tone, args: { chCnt:1, hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out }}
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 },
}
}
}
xfade_ctl: { class: xfade_ctl, in:{ srateSrc:osc_poly.osc.out, preset:list.out, trigger:list.out },
log:{trigger:0},
args:{ net:osc_poly, durMs:1000, preset:a }} ,
poly_merge: { class: poly_merge, in:{ in_:osc_poly.osc_.out, gain_:xfade_ctl.gain_ },
args:{ out_gain:0.5 }},
afout: { class: audio_file_out, in:{ in:poly_merge.out }
args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
}
}
}
// Test using xfade_ctl to assign presets and connecting poly procs
// to non-poly procs using the poly index to select sources.
// See `in:{ lfo_.dc:dc_list.value_}`
test_8: {
maxCycleCount: 7500,
sample_rate: 48000,
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
procs: {
tmr: { class: timer, args:{ period_ms:2000 } },
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:2, inc:1, init:0, mode:reverse, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c ] }},
dc_list: { class: list, args: { in:0, list:[ 110f,220f,440f ]}}
osc_poly: {
class: poly,
args: { count:3 }
network: {
procs: {
lfo: { class: sine_tone, in:{ _.dc:_.dc_list.value_}, args: { chCnt:1, hz:3, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out }}
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 }, osc_: { gain:0.95 } },
b: { lfo_: { hz:2 }, osc_: { gain:0.75 } },
c: { lfo_: a220 },
}
}
}
xfade_ctl: { class: xfade_ctl, in:{ srateSrc:osc_poly.osc.out, preset:list.out, trigger:list.out },
log:{trigger:0},
args:{ net:osc_poly, durMs:1000, preset:a }},
poly_merge: { class: poly_merge, in:{ in_:osc_poly.osc_.out, gain_:xfade_ctl.gain_ },
args:{ out_gain:0.5 }},
afout: { class: audio_file_out, in:{ in:poly_merge.out }
args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
}
}
}
// Test using a subnet.
test_9 : {
maxCycleCount: 7500,
sample_rate: 48000,
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
procs: {
sub_osc: { class: mod_osc args:{ hz:220, hz_mod_hz:3, hz_mod_depth:55, amp_mod_hz:2, amp_mod_depth:0.5 }},
afout: { class: audio_file_out, in:{ in:sub_osc.mo_out }
args:{ fname:"$/audio_flow_out.wav"}}
}
}
presets: {
}
}
// Testing using proc instances with explicit suffix ids.
// See: list0 and list1
test_10: {
maxCycleCount: 15000,
network: {
procs: {
tmr: { class: timer, args:{ period_ms:1000.0 }},
cnt: { class: counter, in: { trigger:tmr.out }, log:{out:0}, args:{ min:0, max:1, inc:1, init:0, mode:clip, repeat_fl:false, out_type:uint }},
list0: { class: list, args:{ in:2 list:[1,2,3] }},
list1: { class: list, args:{ in:0, list:[10,20,30] }},
add: { class: add, in: { in0:list0.out, in1:list1.out, in2:cnt.out }, log:{out:0} args:{ otype:int }}
}
}
},
// Test with no exec cycles.
// This network only runs the initialization pass.
test_11: {
maxCycleCount: 0,
network: {
procs: {
a: { class: number, log:{value:0}, args:{ value:1 }},
b: { class: number, log:{value:0}, args:{ value:2 }},
add: { class: add, in: { in0:a.value, in1:b.value }, log:{out:0}, args:{ otype:int }}
}
}
},
// Test the 'out' statement to set feedback connections.
test_12: {
maxCycleCount: 10,
network: {
procs: {
a: { class: number, log:{value:0}, args:{ value:1 }},
b: { class: number, log:{value:0}, args:{ value:2 }},
add: { class: add, in: { in0:a.value, in1:b.value }, out: { out:b.store },
log:{out:0}, args:{ otype:int }}
}
}
},
// Same as test_4 but with a dual-preset. See preset 'd'.
test_13: {
maxCycleCount: 15000,
printNetworkFl: false,
network: {
procs: {
srate: { class: number, log:{value:0} args:{ value:48000.0 }} ,
tmr: { class: timer, in: { srate:srate.value } log:{srate:0} args:{ period_ms:2000 }},
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:3, inc:1, init:0, mode:clip, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c,d ] }},
ps: { class: preset, in: { in:list.out } }
lfo: { class: sine_tone, in:{ srate:srate.value }, log:{srate:0,hz:0,dc:0} args: { hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out }}
osc: { class: sine_tone, in:{ hz:sh.out, srate:srate.value }}
afout: { class: audio_file_out, in:{ in:osc.out } args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
a: { lfo: { hz:1.0, dc:880 }, osc: { gain:0.95 } },
b: { lfo: { hz:2.0, dc:220 }, osc: { gain:0.75 } },
c: { lfo: a220 },
d: [ a,b,0.5 ]
}
}
}
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"] }}
}
}
}
}
}
}

View File

@ -1,10 +1,9 @@
{ {
balance: { balance: {
vars: { vars: {
in: { type:real, value:0.5, doc:"Input vaue" }, in: { type:coeff, value:0.5, doc:"Input vaue" },
out: { type:real, doc:"Ouput value. Same as input value."}, out: { type:coeff, doc:"Ouput value. Same as input value."},
inv_out: { type:real, doc:"1.0 minus output value."} inv_out: { type:coeff, doc:"1.0 minus output value."}
} }
} }
@ -22,20 +21,20 @@
} }
} }
audioFileIn: { audio_file_in: {
vars: { vars: {
fname: { type:string, doc:"Audio file name." }, fname: { type:string, doc:"Audio file name." },
out:{ type:audio, doc:"Audio file output" }, out:{ type:audio, doc:"Audio file output" },
on_off:{ type:bool, value:false, doc:"1=on 0=off" },, on_off:{ type:bool, value:false, doc:"1=on 0=off" },,
seekSecs:{ type:real, value:0.0, doc:"Seek to the specified seconds offset." } 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, eofFl: true, doc:"Set the system 'halt' flag when the audio is completely read."},
} }
} }
audioFileOut: { audio_file_out: {
vars: { vars: {
fname: { type:string, doc:"Audio file name." }, fname: { type:string, doc:"Audio file name." },
bits: { type:uint, value:32, doc:"Audio file word width. (8,16,24,32,0=float32)."}, bits: { type:uint, value:32u, doc:"Audio file word width. (8,16,24,32,0=float32)."},
in: { type:audio, flags:["src"], doc:"Audio file input." } in: { type:audio, flags:["src"], doc:"Audio file input." }
} }
} }
@ -43,7 +42,7 @@
audio_gain: { audio_gain: {
vars: { vars: {
in: { type:audio, flags:["src"], doc:"Audio input." }, in: { type:audio, flags:["src"], doc:"Audio input." },
gain: { type:real, value:1.0, doc:"Gain coefficient." } gain: { type:coeff, value:1.0, doc:"Gain coefficient." }
out: { type:audio, doc:"Audio output." }, out: { type:audio, doc:"Audio output." },
} }
} }
@ -51,9 +50,10 @@
audio_split: { audio_split: {
vars: { vars: {
in: { type:audio, flags:["src"], doc:"Audio input." }, in: { type:audio, flags:["src"], doc:"Audio input." },
select: { type:bool, doc:"Enable/Disable each channel" } select: { type:int, doc:"Give a list of integers where each integer selects an output channel for the associated input channel." }
gain: { type:real, value:1.0, doc:"Audio gain for each selected (output) channel." } igain: { type:coeff, value:1.0, doc:"Audio gain for each input channel." }
out: { type:audio, doc:"Audio output." }, ogain: { type:coeff, value:1.0, doc:"Audio gain for each output channel." }
out: { type:audio, doc:"Audio output." },
} }
presets: presets:
@ -67,7 +67,7 @@
vars: { vars: {
in: { type:audio, flags:["src"], doc:"Audio input."}, in: { type:audio, flags:["src"], doc:"Audio input."},
duplicate: { type: uint, doc:"Count of times to repeat this channel." }, duplicate: { type: uint, doc:"Count of times to repeat this channel." },
gain: { type: real, value:1.0, doc:"Audio gain." }, gain: { type: coeff, value:1.0, doc:"Audio gain." },
out: { type:audio, doc:"Audio output containing repeat * input channel count channels."} out: { type:audio, doc:"Audio output containing repeat * input channel count channels."}
} }
} }
@ -82,7 +82,7 @@
in5: { type:audio, flags:["src","src_opt"], doc:"Sixth audio input." }, in5: { type:audio, flags:["src","src_opt"], doc:"Sixth audio input." },
in6: { type:audio, flags:["src","src_opt"], doc:"Seventh audio input." }, in6: { type:audio, flags:["src","src_opt"], doc:"Seventh audio input." },
in7: { type:audio, flags:["src","src_opt"], doc:"Eigth audio input." }, in7: { type:audio, flags:["src","src_opt"], doc:"Eigth audio input." },
gain: { type:real, value:1.0, doc:"Audio gain for each selected (output) channel." } gain: { type:coeff, value:1.0, doc:"Audio gain for each selected (output) channel." }
out: { type:audio, doc:"Audio output. Channel count is the sum of the input channel count." }, out: { type:audio, doc:"Audio output. Channel count is the sum of the input channel count." },
} }
} }
@ -91,8 +91,8 @@
vars: { vars: {
in0: { type:audio, flags:["src"], doc:"First audio input." }, in0: { type:audio, flags:["src"], doc:"First audio input." },
in1: { type:audio, flags:["src"], doc:"Second audio input." }, in1: { type:audio, flags:["src"], doc:"Second audio input." },
gain0: { type:real, value:0.5, doc:"Audio gain for input 0." }, gain0: { type:coeff, value:0.5, doc:"Audio gain for input 0." },
gain1: { type:real, value:0.5, doc:"Audio gain for input 1." }, gain1: { type:coeff, value:0.5, doc:"Audio gain for input 1." },
out: { type:audio, doc:"Audio output. Channel count is max of the input signal channels." }, out: { type:audio, doc:"Audio output. Channel count is max of the input signal channels." },
} }
} }
@ -100,8 +100,8 @@
audio_delay: { audio_delay: {
vars: { vars: {
in: { type:audio, flags:["src"], doc:"Audio input." }, in: { type:audio, flags:["src"], doc:"Audio input." },
maxDelayMs: { type:real, value:1000.0 doc:"Maximum possible delay in milliseconds." }, maxDelayMs: { type:ftime, value:1000.0 doc:"Maximum possible delay in milliseconds." },
delayMs: { type:real, doc:"Delay in milliseconds." }, delayMs: { type:ftime, doc:"Delay in milliseconds." },
out: { type:audio, doc:"Audio output." }, out: { type:audio, doc:"Audio output." },
} }
} }
@ -109,16 +109,19 @@
sine_tone: { sine_tone: {
vars: { vars: {
srate: { type:real, value:48000.0, doc:"Sine tone sample rate."} srate: { type:srate, value:0, doc:"Sine tone sample rate. 0=Use default system sample rate"}
chCnt: { type:uint, value:2, doc:"Output signal channel count."}, chCnt: { type:uint, value:2, doc:"Output signal channel count."},
hz: { type:real, value:440.0, doc:"Frequency in Hertz."}, hz: { type:coeff, value:440.0, doc:"Frequency in Hertz."},
gain: { type:real, value:0.8, doc:"Signal frequency."}, phase: { type:coeff, value:0.0, doc:"Offset phase in radians."},
out: { type:audio, doc:"Audio output" }, dc: { type:coeff, value:0.0, doc:"DC offset applied after gain."},
gain: { type:coeff, value:0.8, doc:"Signal frequency."},
out: { type:audio, doc:"Audio output" },
} }
presets: { presets: {
a: { hz:220 }, a220 : { hz:220 },
b: { hz:880 }, a440 : { hz:440 },
a880 : { hz:880 },
} }
} }
@ -218,12 +221,12 @@
in: { type:spectrum, flags:["src"], doc:"Spectrum input." }, in: { type:spectrum, flags:["src"], doc:"Spectrum input." },
bypass: { type:bool, value: false, doc:"Copy input to output without transform."}, bypass: { type:bool, value: false, doc:"Copy input to output without transform."},
ceiling: { type:real, value: 30.0, doc:"Ceiling parameter."}, ceiling: { type:coeff, value: 30.0, doc:"Ceiling parameter."},
expo: { type:real, value: 2.0, doc:"Exponent parameter."}, expo: { type:coeff, value: 2.0, doc:"Exponent parameter."},
thresh: { type:real, value: 54.0, doc:"Threshold parameter."}, thresh: { type:coeff, value: 54.0, doc:"Threshold parameter."},
upr: { type:real, value: -0.7, doc:"Upper slope parameter."}, upr: { type:coeff, value: -0.7, doc:"Upper slope parameter."},
lwr: { type:real, value: 2.0, doc:"Lower slope parameter."}, lwr: { type:coeff, value: 2.0, doc:"Lower slope parameter."},
mix: { type:real, value: 0.0, doc:"Basic/Bump Mix parameter."}, mix: { type:coeff, value: 0.0, doc:"Basic/Bump Mix parameter."},
out: { type:spectrum, doc:"Spectrum output." }, out: { type:spectrum, doc:"Spectrum output." },
@ -359,14 +362,14 @@
vars: { vars: {
in: { type:audio, flags:["src"] true, doc:"Audio input." }, in: { type:audio, flags:["src"] true, doc:"Audio input." },
bypass: { type:bool, value: false, doc:"Bypass the compressor."}, bypass: { type:bool, value: false, doc:"Bypass the compressor."},
igain: { type:real, value: 1.0, doc:"Input gain."}, igain: { type:coeff, value: 1.0, doc:"Input gain."},
thresh: { type:real, value: 90.0, doc:"Attack threshold in dB."}, thresh: { type:coeff, value: 90.0, doc:"Attack threshold in dB."},
ratio: { type:real, value: 2.0, doc:"Compression ratio."}, ratio: { type:coeff, value: 2.0, doc:"Compression ratio."},
atk_ms: { type:real, value: 20.0, doc:"Attack time in milliseconds."}, atk_ms: { type:coeff, value: 20.0, doc:"Attack time in milliseconds."},
rls_ms: { type:real, value: 20.0, doc:"Release time in milliseconds."}, rls_ms: { type:coeff, value: 20.0, doc:"Release time in milliseconds."},
wnd_ms: { type:real, value: 200.0, doc:"RMS calc. window length in milliseconds."}, wnd_ms: { type:coeff, value: 200.0, doc:"RMS calc. window length in milliseconds."},
maxWnd_ms: { type:real, value: 1000.0, doc:"Maximim (allocated) window length in milliseconds."}, maxWnd_ms: { type:coeff, value: 1000.0, doc:"Maximim (allocated) window length in milliseconds."},
ogain: { type:real, value: 1.0, doc:"Output gain."}, ogain: { type:coeff, value: 1.0, doc:"Output gain."},
out: { type:audio, doc:"Audio output." }, out: { type:audio, doc:"Audio output." },
} }
@ -475,9 +478,9 @@
vars: { vars: {
in: { type:audio, flags:["src"] true, doc:"Audio input." }, in: { type:audio, flags:["src"] true, doc:"Audio input." },
bypass: { type:bool, value: false, doc:"Bypass the limiter."}, bypass: { type:bool, value: false, doc:"Bypass the limiter."},
igain: { type:real, value: 1.0, doc:"Input gain."}, igain: { type:coeff, value: 1.0, doc:"Input gain."},
thresh: { type:real, value: 0.0, doc:"Linear (0.0-1.0) threshold."}, thresh: { type:coeff, value: 0.0, doc:"Linear (0.0-1.0) threshold."},
ogain: { type:real, value: 1.0, doc:"Output gain."}, ogain: { type:coeff, value: 1.0, doc:"Output gain."},
out: { type:audio, doc:"Audio output." }, out: { type:audio, doc:"Audio output." },
} }
@ -496,7 +499,7 @@
vars: { vars: {
in: { type:audio, flags:["src"], doc:"Audio input." }, in: { type:audio, flags:["src"], doc:"Audio input." },
bypass: { type:bool, value: false, doc:"Bypass the DC filter."}, bypass: { type:bool, value: false, doc:"Bypass the DC filter."},
gain: { type:real, value: 1.0, doc:"Output gain."}, gain: { type:coeff, value: 1.0, doc:"Output gain."},
out: { type:audio, doc:"Audio output." }, out: { type:audio, doc:"Audio output." },
} }
@ -513,13 +516,121 @@
vars: { vars: {
in: { type:audio, flags:["src"], doc:"Audio input." }, in: { type:audio, flags:["src"], doc:"Audio input." },
dbFl: { type:bool, value: true, doc:"Output in Decibels." }, dbFl: { type:bool, value: true, doc:"Output in Decibels." },
wndMs: { type:real, value: 100.0, doc:"RMS window length." }, wndMs: { type:ftime, value: 100.0, doc:"RMS window length." },
peakDb: { type:real, value: -10.0, doc:"Peak threshold." }, peakDb: { type:coeff, value: -10.0, doc:"Peak threshold." },
out: { type:real, value: 0.0, doc:"Meter output." }, out: { type:coeff, value: 0.0, doc:"Meter output." },
peakFl: { type:bool, value: false, doc:"Peak output." } peakFl: { type:bool, value: false, doc:"Peak output." }
clipFl: { type:bool, value: false, doc:"Clip indicator output."} clipFl: { type:bool, value: false, doc:"Clip indicator output."}
} }
} }
subnet: {
vars: {
}
}
poly: {
vars: {
count: { type:uint, doc:"Count of network duplicates." },
order: { type:string, value:"net", doc:"Execution order 'net'=net first 'proc'=proc first" }
}
}
sample_hold: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input source." },
period_ms: { type:ftime, value:50, doc:"Sample period in milliseconds." },
out: { type:sample, value:0.0, doc:"First value in the sample period." },
mean: { type:sample, value:0.0, doc:"Mean value of samples in period." },
}
}
number: {
vars: {
value: { type:numeric, value:0.0, doc:"Input and output value."},
store: { type:numeric, value:0.0, doc:"Store but don't emit until the next exec."}
}
}
timer: {
vars: {
srate: { type:srate, value:0, flags["src"], doc:"Sample rate to use as the time base. 0=Use default system sample rate." },
period_ms: { type:ftime, value:100, doc:"Timer period in milliseconds." },
out: { type:bool, value:false, doc:"Output pulse." },
}
}
counter: {
vars: {
trigger: { type:bool, flags["src"], doc:"Counter increments with each toggle of trigger." },
reset: { type:bool, value:false, doc:"Reset the counter to the initial value." },
init: { type:numeric, value:0.0, doc:"Counter initial value." },
min: { type:numeric, value:0.0, doc:"Minimum output value." },
max: { type:numeric, value:10.0, doc:"Maximum output value." },
inc: { type:numeric, value:1.0, doc:"Incrment value." },
repeat_fl: { type:bool, value:true, doc:"Repeat on reaching the limits." },
mode: { type:string, value:"modulo", doc:"limit mode: 'modulo'=wrap, 'reverse'=count in opposite direction, 'clip'=repeat limit value."},
out_type: { type:string, value:double, flags["init"], doc:"The type of the output value." },
out: { type:runtime, value:0.0, doc:"Counter output value."},
}
}
// All elements of the list must belong to the same of three possible types:
// string,cfg,numeric (uint,int,float,double)
list: {
vars: {
in: { type:uint, flags:["src"], doc:"List selection index." },
list: { type:cfg, doc:"List as a 'cfg' object." },
out: { type:runtime, doc:"List output value." },
value:{ type:runtime, flags["mult"], doc:"List 'mult' output per list value." },
}
}
add: {
vars: {
in: { type:numeric, flags:["src","mult"], doc:"Operands" },
otype: { type:string, value:double, flags:["init"], doc:"The type of the output value." },
out: { type:runtime, flags:["no_src"], doc:"Result" },
}
}
preset: {
vars: {
in: { type:string, flags:["src"], doc:"Preset to select." },
}
}
xfade_ctl: {
poly_limit_cnt: 1,
// Notes:
// 1. It would be better to setup the source net-proc as a 'in' variable with type 'net'.
// 2. The only purpose for the 'srateSrc' is to get the sample rate of the system.
vars: {
net: { type:string, doc:"Proc name of the poly network."},
netSfxId: { type:uint, value: 0, doc:"Label sfx id of the source poly instance."},
srateSrc: { type:audio, flags:["src"], doc:"Audio source to derive the sample rate."},
durMs: { type:uint, value:1000, doc:"Cross-fade duration in milliseconds" },
trigger: { type:all, doc:"Start cross-fade." },
preset: { type:string, doc:"Preset to apply to the poly network." },
gain: { type:coeff, flags:["mult"], value:0, doc:"Cross-fade gain output." }
}
},
poly_merge: {
vars: {
in: { type:audio, flags:["src", "mult"], doc:"Audio input channel." },
gain: { type:coeff, value: 0, flags:["src", "mult"], doc:"Input channel gain." },
out_gain: { type:coeff, value: 1, doc:"Output gain" },
out: { type:audio, doc:"Audio output." },
}
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,280 @@
import csv
import copy
def no_cvt(x):
return x
def int_cvt( x):
return int(x) if x else None
def float_cvt(x):
return float(x) if x else None
def parse_csv( fname ):
rowL = []
cvtD = {"opcode":no_cvt,
"meas":int_cvt,
"index":int_cvt,
"voice":int_cvt,
"loc":int_cvt,
"eloc":int_cvt,
"oloc":int_cvt,
"tick":int_cvt,
"sec":float_cvt,
"dur":float_cvt,
"rval":float_cvt,
"dots":int_cvt,
"sci_pitch":no_cvt,
"dmark":no_cvt,
"dlevel":int_cvt,
"status":int_cvt,
"d0":int_cvt,
"d1":int_cvt,
"bar":int_cvt,
"section":int_cvt,
"bpm":int_cvt,
"grace":no_cvt,
"tie":no_cvt,
"onset":no_cvt,
"pedal":no_cvt,
"dyn":no_cvt,
"even":no_cvt,
"tempo":no_cvt}
sostN = 0
dampN = 0
with open(fname) as f:
rdr = csv.DictReader(f)
for row in rdr:
r = { label:cvtD[label](val) for label,val in row.items() }
if r['opcode'] == 'ped':
if r['d0'] == 64:
dampN += 1
else:
sostN ++ 1
rowL.append(r)
print('damp:',dampN,'sost:',sostN);
return rowL
def gen_cut_list( rowL, meas_cutL ):
cutL = []
in_sect_flag = False
sectL_idx = 0
beg_cut_row_idx = None
for i,r in enumerate(rowL):
if r['opcode'] == 'bar':
if not in_sect_flag and r['meas'] == meas_cutL[sectL_idx][0]:
in_sect_flag = True
beg_cut_row_idx = i
elif in_sect_flag and r['meas'] == (meas_cutL[sectL_idx][1]+1):
in_sect_flag = False
cutL.append( (meas_cutL[sectL_idx][0], meas_cutL[sectL_idx][1], beg_cut_row_idx, i+1) )
sectL_idx += 1
if sectL_idx >= len(meas_cutL):
break
return cutL
def print_approx_cut_list( rowL, approx_cutL ):
for cut in approx_cutL:
print( rowL[cut[2]]['meas'],rowL[cut[2]]['loc'], rowL[cut[3]]['meas'],rowL[cut[3]]['loc'] )
def gen_gate_matrices( rowL ):
noteM = []
pedalM = []
damp_idx = 0
sost_idx = 1
noteStateL = [False]*128
pedalStateL = [False]*2
note_on_cnt = 0
pedal_on_cnt = 0
note_off_cnt = 0
pedal_off_cnt = 0
for i,r in enumerate(rowL):
if r['opcode'] == 'non' and r['d0']:
noteStateL[r['d0']] = True
note_on_cnt += 1
elif r['opcode'] == 'nof':
noteStateL[r['d0']] = False
note_off_cnt += 1
elif r['opcode'] == 'ped':
down_fl = r['d1']!=0
ped_idx = damp_idx if r['d0']==64 else sost_idx
pedalStateL[ped_idx] = down_fl
if down_fl:
pedal_on_cnt += 1
else:
pedal_off_cnt += 1
noteM.append(copy.copy(noteStateL))
pedalM.append(copy.copy(pedalStateL))
print("notes:",note_on_cnt,note_off_cnt,"pedals:",pedal_on_cnt,pedal_off_cnt)
return noteM, pedalM
def insert_off_message( xL, gateL, opcode ):
cnt = 0
# take the first note-off row as a prototype note off record
proto_row = None
for r in xL:
if r['opcode'] == opcode:
proto_row = copy.copy(r)
proto_row['meas'] = xL[-1]['meas']
proto_row['sec'] = xL[-1]['sec']
proto_row['tick'] = 0;
proto_row['d0'] = 0;
break;
for i,flag in enumerate(gateL):
if flag:
proto_row['index'] = xL[-1]['index'] + 1
if opcode == 'nof':
proto_row['d0'] = i
elif opcode == 'ped':
proto_row['d1'] = 64 if i==0 else 66
xL.append( copy.copy(proto_row) )
cnt += 1
return cnt
def fix_meas_numbers( rowL ):
meas = 1
src_measL = sorted(set([ r['meas'] for r in rowL]))
meas_mapD = { meas:i+1 for i,meas in enumerate(src_measL) }
for row in rowL:
row['meas'] = meas_mapD[ row['meas'] ]
def gen_raw_output_list( rowL, cutL, noteM, pedalM ):
def _update_secs( rL, base_secs ):
dsec = 0.0
sec0 = None
sec = 0
for i,r in enumerate(rL):
if r['sec']:
if sec0:
dsec = r['sec'] - sec0
sec0 = r['sec']
sec += dsec
r['sec'] = sec + base_secs
outL = []
base_secs = 0.0
for b_meas,e_meas,bri,eri in cutL:
xL = rowL[bri:eri]
note_cnt = insert_off_message(xL,noteM[eri-1],'nof')
pedal_cnt = insert_off_message(xL,pedalM[eri-1],'ped')
_update_secs(xL,base_secs)
base_secs = xL[-1]['sec']
outL += xL
print(b_meas,e_meas,note_cnt,pedal_cnt,xL[-1]['opcode'])
return outL
def write_output_file( fname, rowL ):
fieldnamesL = ["opcode","meas","index","voice","loc","eloc","oloc","tick","sec","dur","rval","dots","sci_pitch","dmark","dlevel","status","d0","d1","bar","section","bpm","grace","tie","onset","pedal","dyn","even","tempo"]
with open(fname,"w") as f:
wtr = csv.DictWriter(f,fieldnamesL)
wtr.writeheader()
for r in rowL:
wtr.writerow(r)
if __name__ == "__main__":
"""
1 - 7
215 - 218
241 - 247
272 - 283
290 - 295 (first beat of 290 is converted to a rest)
333 - 343
352 - 365 (tie to first note in 352 is deleted)
375 - 391
398 - 400
405 - 433 (last chord is converted to whole notes with fermata, measure is now 9/4)
11m
"""
meas_cutL = [
(1,7),
(215,218),
(241,247),
(272,283),
(290,295),
(333,343),
(352,365),
(375,391),
(398,400),
(405,433)
]
in_fname = "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data/score/20231028/temp.csv"
out_fname = "10_min_demo.csv"
rowL = parse_csv(in_fname)
cutL = gen_cut_list(rowL,meas_cutL)
print_approx_cut_list(rowL,cutL)
if True:
noteM, pedalM = gen_gate_matrices( rowL )
outL = gen_raw_output_list( rowL, cutL, noteM, pedalM )
fix_meas_numbers(outL)
write_output_file(out_fname,outL)

View File

@ -0,0 +1,22 @@
| 5918 5919 |
| 5974 5975 |
| 5982 5985 |
| 5999 6000 |
| 6004 6005 |
| 6022 6025 |
| 6028 6032 |
| 6038 6051 |
| 6056 6057 |
| 6060 6071 |
meas loc meas loc oloc oloc
1 0 8 61 1 to 26
215 4973 218 5163 2074 to 2190 section: 5974
241 6004 248 6394 2602 to 2818
272 7936 284 8448 3554 to 3832
290 8677 296 8821 3962 to 4047
333 10398 344 10753 4862 to 5036
352 11255 366 11760 5315 to 5597
375 12271 392 13217 5936 to 6425
398 13558 401 13732 6608 to 6677
405 13953 434 15354 6781

View File

@ -1,401 +0,0 @@
{
test: {
preset_sel: {
params: {
score_fn: "~/src/cwtest/src/cwtest/cfg/gutim_full/temp.csv",
perfDirL: [
{
dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data1/beck1",
fname:"play_score_w_vt.csv",
vel_table:[
],
},
{
dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data1/beck2",
fname:"play_score_w_vt.csv",
vel_table:[
],
},
{
dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data1/taka1",
fname:"play_score_w_vt.csv",
vel_table:[
],
},
{
dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data1/taka2",
fname:"play_score_w_vt.csv",
vel_table:[
],
},
{
dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data/score",
fname:"temp.csv",
vel_table: [
{ "device":"piano", "name":"spirio" }, // VSL uses Ivory vel table
{ "device":"sampler", "name":"ivory" }
]
}
]
record_dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/preset_select",
record_fn: "m1_458_trans_5",
record_fn_ext: "txt",
flow_proc_dict_fn: "~/src/cwtest/src/cwtest/cfg/gutim_full/flow_proc_dict.cfg",
vel_table_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/vel_table/vel_table_perf.json"
vel_table_backup_dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/vel_table/backup"
//crossFadeSrate: 48000.0, // TODO: move to flow cfg. and set via 'system default sample rate'
crossFadeCount: 3,
beg_play_loc: 1, //0, //12431, // coda 11499,
end_play_loc: 16354, //59, //14726, // coda 12426,
live_mode_fl: false,
dflt_perf_label: "beck_1_5",
run_dur_secs: 0,
enable_recording_fl: false,
midi_record_dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/midi_record",
midi_record_folder: "shiau_uen",
sf_reset_loc: 1,
score_follower: {
enable_flag: false,
score_csv_fname: "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/temp.csv",
search_area_locN: 10,
key_wnd_locN: 7,
track_print_fl: false, // print output from the sfTrack unit
track_results_backtrack_fl: false,
dyn_ref: [
{ mark: "silent", level:0, vel:1 },
{ mark:"pppp-", level:1, vel:3 },
{ mark:"pppp", level:2, vel:5 },
{ mark:"pppp+", level:3, vel:7 },
{ mark:"ppp-", level:4, vel:10 },
{ mark:"ppp", level:5, vel:15 },
{ mark:"ppp+", level:6, vel:20 },
{ mark:"pp-", level:7, vel:25 },
{ mark:"pp", level:8, vel:30 },
{ mark:"pp+", level:9, vel:35 },
{ mark:"p-", level:10, vel:40 },
{ mark:"p", level:11, vel:45 },
{ mark:"p+", level:12, vel:50 },
{ mark:"mp-", level:13, vel:55 },
{ mark:"mp", level:14, vel:60 },
{ mark:"mp+", level:15, vel:65 },
{ mark:"mf-", level:16, vel:70 },
{ mark:"mf", level:17, vel:75 },
{ mark:"mf+", level:18, vel:80 },
{ mark:"f-", level:19, vel:85 },
{ mark:"f", level:20, vel:90 },
{ mark:"f+", level:21, vel:95 },
{ mark:"ff", level:22, vel:100 },
{ mark:"ff+", level:23, vel:105 },
{ mark:"fff", level:24, vel:115 },
{ mark:"fff+", level:25, vel:120 },
{ mark:"ffff", level:26, vel:125 },
]
},
presets: {
preset_labelL: [ "dry", "a", "b", "c", "d", "f1", "f2", "f3", "f4", "g", "ga", "g1a", "g1d" ],
alt_labelL: [ "A","B","C","D","E","F","G" ],
default_gain: 1.0,
default_wet_dry_gain: 0.5,
default_fade_ms: 50.0,
default_preset: "dry",
default_master_wet_in_gain: 1.0,
default_master_wet_out_gain: 1.0,
default_master_dry_gain: 1.0,
default_master_sync_delay_ms: 400, // spirio 400
},
midi_play_record: {
max_midi_msg_count: 32768,
midi_timer_period_micro_sec: 15000,
all_off_delay_ms: 2500, // delay after stop time to turn off all notes
log_in_flag: false,
log_out_flag: false,
half_pedal_flag: false,
min_damper_down_time_ms: 0,
midi_device_list: [
{
// SAMPLER
enableFl: true,
label: "sampler",
//midi_out_device: "Fastlane",
//midi_out_port: "Fastlane MIDI B",
//midi_out_device: "MIDIFACE 2x2",
//midi_out_port: "MIDIFACE 2x2 Midi Out 1",
midi_out_device: "Scarlett 18i20 USB",
midi_out_port: "Scarlett 18i20 USB MIDI 1",
//midi_out_device: "PipeWire-RT-Event",
//midi_out_port: "input",
force_damper_down_fl: false,
force_damper_down_threshold: 35,
force_damper_down_velocity: 80,
scale_chord_notes_enable_fl: false,
scale_chord_notes_factor: 0.05,
},
{
//SPIRIO
enableFl: true,
label: "piano",
//midi_out_device: "Fastlane",
//midi_out_port: "Fastlane MIDI A",
//midi_out_device: "MIDIFACE 2x2",
//midi_out_port: "MIDIFACE 2x2 Midi Out 2",
midi_out_device: "iRig MIDI 2",
midi_out_port: "iRig MIDI 2 MIDI 1",
//midi_out_device: "PC-300",
//midi_out_port: "PC-300 MIDI 1",
//midi_out_device: "PipeWire-RT-Event",
//midi_out_port: "input",
// pedal down velocity input/output mapping
/*
pedal: {
up_id: 0,
up_vel: 0,
down_id: 127,
down_vel: 0,
half_down_id: 64,
half_down_vel: 43,
half_up_id: 63,
half_up_vel: 43
},
*/
force_damper_down_fl: false,
force_damper_down_threshold: 35,
force_damper_down_velocity: 80,
scale_chord_notes_enable_fl: false,
scale_chord_notes_factor: 0.5,
},
],
}
},
io: {
callbackMutexTimeOutMs: 100,
}
ui: {
enableFl: true,
physRootDir: "~/src/cwtest/src/libcw/html/preset_sel",
dfltPageFn: "index.html",
port: 5687,
rcvBufByteN: 2048,
xmtBufByteN: 2048,
fmtBufByteN: 4096,
websockTimeOutMs: 25, // max time out while blocking for a websock event
queueBlkCnt: 8,
queueBlkByteCnt: 32768,
idleMsgPeriodMs: 50, // period without messages before an idle message is generated
uiCfgFn: "ui.cfg", // default UI resource description
asyncFl: false
},
serial: {
enableFl: false,
pollPeriodMs: 50,
recvBufByteN: 512,
array: [
{
enableFl: false,
asyncFl: false,
label: "port1", // User label
device: "/dev/ttyUSB0", // Serial device name
baud: 115200,
bits: 8,
stop: 1,
parity: "no",
}
]
},
midi: {
enableFl: true,
asyncFl: true,
parseBufByteCnt: 1024,
appNameStr: "cwtest",
fileDevName: "file_dev",
fileDevReadAheadMicros: 3000,
testFileLabel: "file_0",
testFileEnableFl: false
file_ports: [
{ "label":"file_0",
//"file": "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data1/beck1/record_4/midi.mid",
"enable_fl": false },
]
},
audio: {
enableFl: true,
meterMs: 50, // audio meter filter length and meter callback period
threadTimeOutMs: 50, // audio thread cond var time out
groupL: [
{
enableFl: true, // (req)
asyncFl: true,
label: "main", // (req) User label
id: 0, // (req) User id (can also be set at runtime)
srate: 48000, // (req) Sample rate used by all devices in this group
dspFrameCnt: 64 // (req) Size of DSP processing buffers
}
],
deviceL: [
{
// System device name
device: "Scarlett 18i20 USB USB Audio",
//device: "USB Audio CODEC USB Audio",
//device: "HDA Intel PCH CS4208 Analog",
activeFl: true, // (req)
meterFl: true, // (opt)
label: "main", // (req) User label
userId: 0, // (opt) User id (can also be set at runtime)
framesPerCycle: 512, // (req) Samples per audio device cycle
cycleCnt: 3, // (req) Count of device cycle buffers.
inGroup: "main", // (opt) All devices in a group must be 'ready' to source
outGroup: "main", // (opt) or sink data before an audio callback is made for that group
}
]
},
socket: {
enableFl: false,
asyncFl: false,
maxSocketCnt: 10,
recvBufByteCnt: 4096,
threadTimeOutMs: 50,
socketL: [],
}
flow: {
framesPerCycle: 64, // time-domain audio cycles frame per cycle (must match audio 'dspFrameCnt')
multiPriPresetProbFl: false, // Use probability to select primary multi-preset
multiSecPresetProbFl: false, // Use probability to select secondary multi-preset
multiPresetInterpFl: false, // Interpolate between two selected multi-presets
maxCycleCount: 0, // 0 disables maxCycleCount
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
aud_in: { class: audio_in, args:{ default:{dev_label:"main"} } },
// select the first six channels: ivory, mic, vsl
split_in: { class: audio_split, in:{ in:aud_in.out } args:{ default:{select[1,1,1,1,1,1 ]}} }
// delay the incoming audio signal to sync it with the piano
sync_delay { class: audio_delay, in: { in:split_in.out }, args:{ default:{ delayMs:400 } }}
// select the first two channels to feed into the transform
sync_split: { class: audio_split, in:{ in:sync_delay.out } args:{ default:{select[1,1]}} }
mstr_wet_in_gain: { class: audio_gain, in:{ in:sync_split.out } }
// wet signal processing chain
wet_in_gain: { class: audio_gain, in:{ in:mstr_wet_in_gain.out } },
pva: { class: pv_analysis, in:{ in:wet_in_gain.out }, args:{ default:{ wndSmpN:512, hopSmpN:128, hzFl:false } } },
sd: { class: spec_dist, in:{ in:pva.out }, preset:kc, args:{ bypass:false } },
pvs: { class: pv_synthesis, in:{ in:sd.out } },
cmp: { class: compressor, in:{ in:pvs.out }, preset:kc, args:{ bypass:false } },
wet_out_gain: { class: audio_gain, in:{ in:cmp.out } },
//wet_out_gain: { class: audio_gain, in:{ in:pvs.out } },
mute_wet: { class: audio_gain, in:{ in:wet_out_gain.out } },
// apply the wet/dry gain balance
wd_bal: { class: balance, args{}},
wet_bal_gain: { class: audio_gain, in:{ in:mute_wet.out, gain:wd_bal.out } },
dry_bal_gain: { class: audio_gain, in:{ in:sync_split.out, gain:wd_bal.inv_out } },
mstr_wet_out_gain: { class: audio_gain, in:{ in:wet_bal_gain.out } }
mstr_dry_out_gain: { class: audio_gain, in:{ in:dry_bal_gain.out } },
// merge the wet/dry signals into a single 4 channel signal
merge: { class: audio_merge, in:{ in0:mstr_wet_out_gain.out, in1:mstr_dry_out_gain.out, in2:mstr_wet_out_gain.out, in3:mstr_dry_out_gain.out } },
aout: { class: audio_out, in:{ in:merge.out }, args:{ default:{dev_label:"main"} } },
//af_merge { class: audio_merge, in:{ in0:mstr_wet_out_gain.out, in1:sync_delay.out } },
//af_out: { class: audioFileOut, in:{ in:af_merge.out }, args:{ default:{fname:"/home/kevin/temp/temp.wav"}}},
}
presets: {
dry: { pva:dry, sd:dry, cmp:dry, mute_wet:{ gain:0.0 } },
a: { pva:a, sd:a, cmp:a, mute_wet:{ gain:1.0 } },
b: { pva:b, sd:b, cmp:b, mute_wet:{ gain:1.0 } },
c: { pva:c, sd:c, cmp:c, mute_wet:{ gain:1.0 } },
d: { pva:d, sd:d, cmp:d, mute_wet:{ gain:1.0 } },
f1: { pva:f_1, sd:f_1, cmp:f_1, mute_wet:{ gain:1.0 } },
f2: { pva:f_2, sd:f_2, cmp:f_2, mute_wet:{ gain:1.0 } },
f3: { pva:f_3, sd:f_3, cmp:f_3, mute_wet:{ gain:1.0 } },
f4: { pva:f_4, sd:f_4, cmp:f_4, mute_wet:{ gain:1.0 } },
g: { pva:g, sd:g, cmp:g, mute_wet:{ gain:1.0 } },
ga: { pva:g_a sd:g_a, cmp:g_a, mute_wet:{ gain:1.0 } },
g1a: { pva:g_1_a sd:g_1_a, cmp:g_1_a, mute_wet:{ gain:1.0 } },
g1d: { pva:g_1_d sd:g_1_d, cmp:g_1_d, mute_wet:{ gain:1.0 } }
}
}
}
}

View File

@ -1,382 +0,0 @@
{
test: {
preset_sel: {
params: {
score_fn: "~/src/cwtest/src/cwtest/cfg/score/temp.csv",
perfDirL: [
{
dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data/score",
fname:"temp.csv",
vel_table: [
{ "device":"piano", "name":"spirio" }, // VSL uses Ivory vel table
{ "device":"sampler", "name":"ivory" }
]
},
{
dir:"~/src/cwtest/src/cwtest/cfg/gutim_full/data/score_scriabin",
fname:"temp_with_scriabin_0.csv",
vel_table: [
{ "device":"piano", "name":"spirio" }, // VSL uses Ivory vel table
{ "device":"sampler", "name":"ivory" }
]
},
]
record_dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/preset_select",
record_fn: "m1_458_trans_5_scriabin",
record_fn_ext: "txt",
flow_proc_dict_fn: "~/src/cwtest/src/cwtest/cfg/gutim_full/flow_proc_dict.cfg",
vel_table_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/vel_table/vel_table_perf.json"
vel_table_backup_dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/vel_table/backup"
//crossFadeSrate: 48000.0, // TODO: move to flow cfg. and set via 'system default sample rate'
crossFadeCount: 3,
beg_play_loc: 1, //0, //12431, // coda 11499,
end_play_loc: 16354, //59, //14726, // coda 12426,
live_mode_fl: false,
dflt_perf_label: "beck_1_5",
run_dur_secs: 0,
enable_recording_fl: false,
midi_record_dir: "~/src/cwtest/src/cwtest/cfg/gutim_full/midi_record",
midi_record_folder: "shiau_uen",
sf_reset_loc: 1,
score_follower: {
enable_flag: false,
score_csv_fname: "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/temp.csv",
search_area_locN: 10,
key_wnd_locN: 7,
track_print_fl: false, // print output from the sfTrack unit
track_results_backtrack_fl: false,
dyn_ref: [
{ mark: "silent", level:0, vel:1 },
{ mark:"pppp-", level:1, vel:3 },
{ mark:"pppp", level:2, vel:5 },
{ mark:"pppp+", level:3, vel:7 },
{ mark:"ppp-", level:4, vel:10 },
{ mark:"ppp", level:5, vel:15 },
{ mark:"ppp+", level:6, vel:20 },
{ mark:"pp-", level:7, vel:25 },
{ mark:"pp", level:8, vel:30 },
{ mark:"pp+", level:9, vel:35 },
{ mark:"p-", level:10, vel:40 },
{ mark:"p", level:11, vel:45 },
{ mark:"p+", level:12, vel:50 },
{ mark:"mp-", level:13, vel:55 },
{ mark:"mp", level:14, vel:60 },
{ mark:"mp+", level:15, vel:65 },
{ mark:"mf-", level:16, vel:70 },
{ mark:"mf", level:17, vel:75 },
{ mark:"mf+", level:18, vel:80 },
{ mark:"f-", level:19, vel:85 },
{ mark:"f", level:20, vel:90 },
{ mark:"f+", level:21, vel:95 },
{ mark:"ff", level:22, vel:100 },
{ mark:"ff+", level:23, vel:105 },
{ mark:"fff", level:24, vel:115 },
{ mark:"fff+", level:25, vel:120 },
{ mark:"ffff", level:26, vel:125 },
]
},
presets: {
preset_labelL: [ "dry", "a", "b", "c", "d", "f1", "f2", "f3", "f4", "g", "ga", "g1a", "g1d" ],
alt_labelL: [ "A","B","C","D","E","F","G" ],
default_gain: 1.0,
default_wet_dry_gain: 0.5,
default_fade_ms: 50.0,
default_preset: "dry",
default_master_wet_in_gain: 1.0,
default_master_wet_out_gain: 1.0,
default_master_dry_gain: 1.0,
default_master_sync_delay_ms: 400, // spirio 400
},
midi_play_record: {
max_midi_msg_count: 32768,
midi_timer_period_micro_sec: 15000,
all_off_delay_ms: 2500, // delay after stop time to turn off all notes
log_in_flag: false,
log_out_flag: false,
half_pedal_flag: false,
min_damper_down_time_ms: 0,
midi_device_list: [
{
// SAMPLER
enableFl: true,
label: "sampler",
//midi_out_device: "Fastlane",
//midi_out_port: "Fastlane MIDI B",
//midi_out_device: "MIDIFACE 2x2",
//midi_out_port: "MIDIFACE 2x2 Midi Out 1",
midi_out_device: "Scarlett 18i20 USB",
midi_out_port: "Scarlett 18i20 USB MIDI 1",
//midi_out_device: "PipeWire-RT-Event",
//midi_out_port: "input",
force_damper_down_fl: false,
force_damper_down_threshold: 35,
force_damper_down_velocity: 80,
scale_chord_notes_enable_fl: false,
scale_chord_notes_factor: 0.05,
},
{
//SPIRIO
enableFl: true,
label: "piano",
//midi_out_device: "Fastlane",
//midi_out_port: "Fastlane MIDI A",
//midi_out_device: "MIDIFACE 2x2",
//midi_out_port: "MIDIFACE 2x2 Midi Out 2",
midi_out_device: "iRig MIDI 2",
midi_out_port: "iRig MIDI 2 MIDI 1",
//midi_out_device: "PC-300",
//midi_out_port: "PC-300 MIDI 1",
//midi_out_device: "PipeWire-RT-Event",
//midi_out_port: "input",
// pedal down velocity input/output mapping
/*
pedal: {
up_id: 0,
up_vel: 0,
down_id: 127,
down_vel: 0,
half_down_id: 64,
half_down_vel: 43,
half_up_id: 63,
half_up_vel: 43
},
*/
force_damper_down_fl: false,
force_damper_down_threshold: 35,
force_damper_down_velocity: 80,
scale_chord_notes_enable_fl: false,
scale_chord_notes_factor: 0.5,
},
],
}
},
io: {
callbackMutexTimeOutMs: 100,
}
ui: {
enableFl: true,
physRootDir: "~/src/cwtest/src/libcw/html/preset_sel",
dfltPageFn: "index.html",
port: 5687,
rcvBufByteN: 2048,
xmtBufByteN: 2048,
fmtBufByteN: 4096,
websockTimeOutMs: 25, // max time out while blocking for a websock event
queueBlkCnt: 8,
queueBlkByteCnt: 32768,
idleMsgPeriodMs: 50, // period without messages before an idle message is generated
uiCfgFn: "ui.cfg", // default UI resource description
asyncFl: false
},
serial: {
enableFl: false,
pollPeriodMs: 50,
recvBufByteN: 512,
array: [
{
enableFl: false,
asyncFl: false,
label: "port1", // User label
device: "/dev/ttyUSB0", // Serial device name
baud: 115200,
bits: 8,
stop: 1,
parity: "no",
}
]
},
midi: {
enableFl: true,
asyncFl: true,
parseBufByteCnt: 1024,
appNameStr: "cwtest",
fileDevName: "file_dev",
fileDevReadAheadMicros: 3000,
testFileLabel: "file_0",
testFileEnableFl: false
file_ports: [
{ "label":"file_0",
//"file": "/home/kevin/src/cwtest/src/cwtest/cfg/gutim_full/data1/beck1/record_4/midi.mid",
"enable_fl": false },
]
},
audio: {
enableFl: true,
meterMs: 50, // audio meter filter length and meter callback period
threadTimeOutMs: 50, // audio thread cond var time out
groupL: [
{
enableFl: true, // (req)
asyncFl: true,
label: "main", // (req) User label
id: 0, // (req) User id (can also be set at runtime)
srate: 48000, // (req) Sample rate used by all devices in this group
dspFrameCnt: 64 // (req) Size of DSP processing buffers
}
],
deviceL: [
{
// System device name
device: "Scarlett 18i20 USB USB Audio",
//device: "USB Audio CODEC USB Audio",
//device: "HDA Intel PCH CS4208 Analog",
activeFl: true, // (req)
meterFl: true, // (opt)
label: "main", // (req) User label
userId: 0, // (opt) User id (can also be set at runtime)
framesPerCycle: 512, // (req) Samples per audio device cycle
cycleCnt: 3, // (req) Count of device cycle buffers.
inGroup: "main", // (opt) All devices in a group must be 'ready' to source
outGroup: "main", // (opt) or sink data before an audio callback is made for that group
}
]
},
socket: {
enableFl: false,
asyncFl: false,
maxSocketCnt: 10,
recvBufByteCnt: 4096,
threadTimeOutMs: 50,
socketL: [],
}
flow: {
framesPerCycle: 64, // time-domain audio cycles frame per cycle (must match audio 'dspFrameCnt')
multiPriPresetProbFl: false, // Use probability to select primary multi-preset
multiSecPresetProbFl: false, // Use probability to select secondary multi-preset
multiPresetInterpFl: false, // Interpolate between two selected multi-presets
maxCycleCount: 0, // 0 disables maxCycleCount
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
aud_in: { class: audio_in, args:{ default:{dev_label:"main"} } },
// select the first six channels: ivory, mic, vsl
split_in: { class: audio_split, in:{ in:aud_in.out } args:{ default:{select[1,1,1,1,1,1 ]}} }
// delay the incoming audio signal to sync it with the piano
sync_delay { class: audio_delay, in: { in:split_in.out }, args:{ default:{ delayMs:400 } }}
// select the first two channels to feed into the transform
sync_split: { class: audio_split, in:{ in:sync_delay.out } args:{ default:{select[1,1]}} }
mstr_wet_in_gain: { class: audio_gain, in:{ in:sync_split.out } }
// wet signal processing chain
wet_in_gain: { class: audio_gain, in:{ in:mstr_wet_in_gain.out } },
pva: { class: pv_analysis, in:{ in:wet_in_gain.out }, args:{ default:{ wndSmpN:512, hopSmpN:128, hzFl:false } } },
sd: { class: spec_dist, in:{ in:pva.out }, preset:kc, args:{ bypass:false } },
pvs: { class: pv_synthesis, in:{ in:sd.out } },
cmp: { class: compressor, in:{ in:pvs.out }, preset:kc, args:{ bypass:false } },
wet_out_gain: { class: audio_gain, in:{ in:cmp.out } },
//wet_out_gain: { class: audio_gain, in:{ in:pvs.out } },
mute_wet: { class: audio_gain, in:{ in:wet_out_gain.out } },
// apply the wet/dry gain balance
wd_bal: { class: balance, args{}},
wet_bal_gain: { class: audio_gain, in:{ in:mute_wet.out, gain:wd_bal.out } },
dry_bal_gain: { class: audio_gain, in:{ in:sync_split.out, gain:wd_bal.inv_out } },
mstr_wet_out_gain: { class: audio_gain, in:{ in:wet_bal_gain.out } }
mstr_dry_out_gain: { class: audio_gain, in:{ in:dry_bal_gain.out } },
// merge the wet/dry signals into a single 4 channel signal
merge: { class: audio_merge, in:{ in0:mstr_wet_out_gain.out, in1:mstr_dry_out_gain.out, in2:mstr_wet_out_gain.out, in3:mstr_dry_out_gain.out } },
aout: { class: audio_out, in:{ in:merge.out }, args:{ default:{dev_label:"main"} } },
//af_merge { class: audio_merge, in:{ in0:mstr_wet_out_gain.out, in1:sync_delay.out } },
//af_out: { class: audioFileOut, in:{ in:af_merge.out }, args:{ default:{fname:"/home/kevin/temp/temp.wav"}}},
}
presets: {
dry: { pva:dry, sd:dry, cmp:dry, mute_wet:{ gain:0.0 } },
a: { pva:a, sd:a, cmp:a, mute_wet:{ gain:1.0 } },
b: { pva:b, sd:b, cmp:b, mute_wet:{ gain:1.0 } },
c: { pva:c, sd:c, cmp:c, mute_wet:{ gain:1.0 } },
d: { pva:d, sd:d, cmp:d, mute_wet:{ gain:1.0 } },
f1: { pva:f_1, sd:f_1, cmp:f_1, mute_wet:{ gain:1.0 } },
f2: { pva:f_2, sd:f_2, cmp:f_2, mute_wet:{ gain:1.0 } },
f3: { pva:f_3, sd:f_3, cmp:f_3, mute_wet:{ gain:1.0 } },
f4: { pva:f_4, sd:f_4, cmp:f_4, mute_wet:{ gain:1.0 } },
g: { pva:g, sd:g, cmp:g, mute_wet:{ gain:1.0 } },
ga: { pva:g_a sd:g_a, cmp:g_a, mute_wet:{ gain:1.0 } },
g1a: { pva:g_1_a sd:g_1_a, cmp:g_1_a, mute_wet:{ gain:1.0 } },
g1d: { pva:g_1_d sd:g_1_d, cmp:g_1_d, mute_wet:{ gain:1.0 } }
}
}
}
}

View File

@ -14,19 +14,14 @@
test: { test: {
variadicTpl: {}, variadicTpl: {},
lex:{},
fileSys: {},
numbCvt: {},
object: {},
objectToJson: {},
vop:{},
time:{},
thread: {}, thread: {},
kbTest1: {}, kbTest1: {},
kbTest2: {}, kbTest2: {},
kbTest3: {}, kbTest3: {},
spscBuf: {}, spscBuf: {},
spscQueueTmpl: {}, spscQueueTmpl: {},
@ -39,21 +34,35 @@
} }
websockSrv: { websockSrv: {
physRootDir: "~/src/cwtest/src/libcw/html/websockSrvTest",
dfltHtmlPageFn: "test_websocket.html", physRootDir: "~/src/cwtest/src/libcw/html/websockSrvTest", // path to 'dfltHtmlPageFn'
dfltHtmlPageFn: "test_websocket.html", // websockets enabled HTML/JS app
port: 5687, // websocket port
rcvBufByteN: 128, // incoming msg's larger than this will be broken into multiple parts
xmtBufByteN: 128, // outgoing msg's larger than this will be broken into multiple parts
queueBlkCnt: 3, // count of memory blocks in the non-blocking queue (See: cwNbMpScQueue)
queueBlkByteCnt: 4096, // size of each non-blocking memory block
timeOutMs: 50, // milliseconds to block waiting for incoming websock messages
}, },
serialSrv: {}, serialSrv: {},
midiDeviceReport: {}, midiDeviceReport: {},
// Test the MIDI file input device. See cwMidiDeviceTest.cpp
// Compares the time between MIDI events in a file to the time between
// the same events from the file device.
midiDevice: { midiDevice: {
appNameStr: "test_app", appNameStr: "test_app",
fileDevName: "file_dev", fileDevName: "file_dev",
fileDevReadAheadMicros: 3000, fileDevReadAheadMicros: 3000,
parseBufByteCnt: 1024, parseBufByteCnt: 1024,
testFileLabel: "file_0", enableBufFl:true,
bufferMsgCnt:4096,
filterRtSenseFl:true
testFileLabel: "file_0", //
testFileEnableFl: true, testFileEnableFl: true,
file_ports: [ file_ports: [
{ "label":"file_0", { "label":"file_0",
@ -66,35 +75,7 @@
] ]
}, },
/*
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"
},
textBuf: {},
audioBuf: {},
audioDev: {},
audioDevAlsa: {}, audioDevAlsa: {},
audioDevRpt: {}, // print a list of audio device audioDevRpt: {}, // print a list of audio device
@ -629,6 +610,8 @@
}, },
lazy: {},
svg: { svg: {
desc:"Create an SVG/HTML test file.", desc:"Create an SVG/HTML test file.",
@ -1024,8 +1007,6 @@
}, },
audio_transforms: {},
// Convert the the 'am' files in 'inDir' to MIDI and CSV files // Convert the the 'am' files in 'inDir' to MIDI and CSV files
// named 'midi.mid' and 'midi.csv'. // named 'midi.mid' and 'midi.csv'.
// The 'beg_loc' and 'end_loc' will be written to a file named 'meta.cfg'. // The 'beg_loc' and 'end_loc' will be written to a file named 'meta.cfg'.

View File

@ -0,0 +1,593 @@
{
module_args: {
proc_cfg_fname: "~/src/cwtest/src/libcw/flow/proc_dict.cfg",
subnet_cfg_fname:"~/src/cwtest/src/libcw/flow/subnet_dict.cfg",
},
cases: {
test_0: {
maxCycleCount:3750, // 5 seconds
network: {
procs: {
osc: { class: sine_tone },
afout: { class: audio_file_out, in: { in:osc.out } args:{ fname:"$/audio_flow_out.wav"}
}
}
}
}
test_1: {
maxCycleCount: 1500,
printNetworkFl: false, // print the network instance
network: {
procs: {
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:"$/audio_flow_out.wav"} }
}
presets: {
a: { lfo:a220, osc: { gain:0.8 } },
b: { lfo:{ dc:220, gain:25 }, osc: { gain:0.5 } }
}
}
}
test_2: {
maxCycleCount: 7500,
network: {
procs: {
srate: { class: number, log:{out:0} args:{ in:48000.0f } },
tmr: { class: timer, in: { srate:srate.out}, log:{out:0} args:{ period_ms:1000.0 } },
cnt: { class: counter, in: { trigger:tmr.out }, log:{out:0} args:{ min:0, max:3, inc:1, init:0, mode:clip, out_type:uint, repeat_fl:false } },
list: { class: list, in: { in:cnt.out }, log:{out:0} args:{ list:[a,b,c,d] }}
}
}
}
test_3: {
maxCycleCount: 7500,
network: {
procs: {
srate: { class: number, log:{out:0} args:{ in:48000f } },
tmr: { class: timer, in: { srate:srate.out}, log:{out:0} args:{ period_ms:1000.0 } },
cnt: { class: counter, in: { trigger:tmr.out }, log:{out:0} args:{ min:0, max:3, inc:1, init:0, mode:clip, repeat_fl:false, out_type:uint } },
x0v: { class: number, log:{out:0} args:{ in:2 }},
x1v: { class: number, log:{out:0} args:{ in:3 }},
add: { class: add, in: { in0:x0v.out, in1:x1v.out, in2:cnt.out }, log:{out:0} args:{ otype:int }}
}
}
}
test_4: {
maxCycleCount: 15000,
printNetworkFl: false,
network: {
procs: {
srate: { class: number, log:{in:0} args:{ in:48000.0f} },
tmr: { class: timer, in: { srate:srate.out } log:{srate:0} args:{ period_ms:2000 } },
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:2, inc:1, init:0, mode:clip, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c ] }},
ps: { class: preset, in: { in:list.out } }
lfo: { class: sine_tone, in:{ srate:srate.out }, log:{srate:0} args: { hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out } }
osc: { class: sine_tone, in:{ hz:sh.out, srate:srate.out }}
afout: { class: audio_file_out, in:{ in:osc.out } args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
a: { lfo: { hz:1.0, dc:880 }, osc: { gain:0.95 } },
b: { lfo: { hz:2.0, dc:220 }, osc: { gain:0.75 } },
c: { lfo: a220 }
}
}
}
// Same as test_4 but using the system sample rate
test_5: {
maxCycleCount: 15000,
sample_rate: 48000,
network: {
procs: {
tmr: { class: timer, log:{srate:0}, args:{ period_ms:2000 } },
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:2, inc:1, init:0, mode:clip, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c ] }},
ps: { class: preset, in: { in:list.out } }
lfo: { class: sine_tone, log:{srate:0} args: { chCnt:1, hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out } }
osc: { class: sine_tone, in:{ hz:sh.out } log:{srate:0} }
afout: { class: audio_file_out, in: { in:osc.out } args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
a: { lfo: { hz:1, dc:880 }, osc: { gain:0.95 } },
b: { lfo: { hz:2, dc:220 }, osc: { gain:0.75 } },
c: { lfo: a220 },
}
}
}
// Simple poly
test_6: {
maxCycleCount: 7500,
sample_rate: 48000,
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
procs: {
osc_poly: {
class: poly,
args: { count:3 }
network: {
procs: {
lfo: { class: sine_tone, args: { chCnt:1, hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out }}
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 },
}
}
}
poly_merge: { class: audio_merge, in:{ in_:osc_poly.osc_.out}, args:{ gain:1, out_gain:0.5 }},
afout: { class: audio_file_out, in: { in:poly_merge.out } args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
}
}
}
// Test using xfade_ctl to cross-fade and assign presets.
test_7: {
maxCycleCount: 7500,
sample_rate: 48000,
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
procs: {
tmr: { class: timer, args:{ period_ms:2000 } },
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:2, inc:1, init:0, mode:reverse, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c ] }},
osc_poly: {
class: poly,
args: { count:3 }
network: {
procs: {
lfo: { class: sine_tone, args: { chCnt:1, hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out }}
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 },
}
}
}
xfade_ctl: { class: xfade_ctl, in:{ srateSrc:osc_poly.osc.out, preset:list.out, trigger:list.out },
log:{trigger:0},
args:{ net:osc_poly, durMs:1000, preset:a }} ,
poly_merge: { class: audio_merge, in:{ in_:osc_poly.osc_.out, gain_:xfade_ctl.gain_ },
args:{ out_gain:0.5 }},
afout: { class: audio_file_out, in:{ in:poly_merge.out }
args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
}
}
}
// Test using xfade_ctl to assign presets and connecting poly procs
// to non-poly procs using the poly index to select sources.
// See `in:{ lfo_.dc:dc_list.value_}`
test_8: {
maxCycleCount: 7500,
sample_rate: 48000,
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
procs: {
tmr: { class: timer, args:{ period_ms:2000 } },
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:2, inc:1, init:0, mode:reverse, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c ] }},
dc_list: { class: list, args: { in:0, list:[ 110f,220f,440f ]}}
osc_poly: {
class: poly,
args: { count:3 }
network: {
procs: {
lfo: { class: sine_tone, in:{ _.dc:_.dc_list.value_}, args: { chCnt:1, hz:3, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out }}
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 }, osc_: { gain:0.95 } },
b: { lfo_: { hz:2 }, osc_: { gain:0.75 } },
c: { lfo_: a220 },
}
}
}
xfade_ctl: { class: xfade_ctl, in:{ srateSrc:osc_poly.osc.out, preset:list.out, trigger:list.out },
log:{trigger:0},
args:{ net:osc_poly, durMs:1000, preset:a }},
poly_merge: { class: audio_merge, in:{ in_:osc_poly.osc_.out, gain_:xfade_ctl.gain_ },
args:{ out_gain:0.5 }},
afout: { class: audio_file_out, in:{ in:poly_merge.out }
args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
}
}
}
// Test using a subnet.
test_9 : {
maxCycleCount: 7500,
sample_rate: 48000,
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
procs: {
sub_osc: { class: mod_osc args:{ hz:220, hz_mod_hz:3, hz_mod_depth:55, amp_mod_hz:2, amp_mod_depth:0.5 }},
afout: { class: audio_file_out, in:{ in:sub_osc.mo_out }
args:{ fname:"$/audio_flow_out.wav"}}
}
}
}
// Testing using proc instances with explicit suffix ids.
// See: list0 and list1
test_10: {
maxCycleCount: 15000,
network: {
procs: {
tmr: { class: timer, args:{ period_ms:1000.0 }},
cnt: { class: counter, in: { trigger:tmr.out }, log:{out:0}, args:{ min:0, max:2, inc:1, init:0, mode:clip, repeat_fl:false, out_type:uint }},
list0: { class: list, args:{ in:2 list:[1,2,3] }},
list1: { class: list, args:{ in:0, list:[10,20,30] }},
add: { class: add, in: { in0:list0.out, in1:list1.out, in2:cnt.out }, log:{out:0} args:{ otype:int }}
}
}
},
// Test with no exec cycles.
// This network only runs the initialization pass.
test_11: {
maxCycleCount: 0,
network: {
procs: {
a: { class: number, log:{out:0}, args:{ in:1 }},
b: { class: number, log:{out:0}, args:{ in:2 }},
add: { class: add, in: { in0:a.out, in1:b.out }, log:{out:0}, args:{ otype:int }}
}
}
},
/*
This test is broken because the only time that 'add' outputs a value
is when one of it's inputs changes value, and in this case that is
that only occurs when 'add' is being constructed - prior to the
feedback connection being created.
// Test the 'out' statement to set feedback connections.
test_12: {
maxCycleCount: 10,
network: {
procs: {
a: { class: number, log:{out:0}, args:{ in:1 }},
b: { class: number, log:{out:0}, args:{ in0:0, in1:2 }},
add: { class: add, in: { in0:a.out, in1:b.out }, out: { out:b.in0 },
log:{out:0}, args:{ otype:int }}
}
}
},
*/
// Same as test_4 but with a dual-preset. See preset 'd'.
test_13: {
maxCycleCount: 15000,
printNetworkFl: false,
network: {
procs: {
srate: { class: number, log:{out:0} args:{ in:48000.0f }} ,
tmr: { class: timer, in: { srate:srate.out } log:{srate:0} args:{ period_ms:2000 }},
cnt: { class: counter, in: { trigger:tmr.out }, args:{ min:0, max:3, inc:1, init:0, mode:clip, out_type:uint }}
list: { class: list, in: { in:cnt.out }, args:{ list:[ a,b,c,d ] }},
ps: { class: preset, in: { in:list.out } }
lfo: { class: sine_tone, in:{ srate:srate.out }, log:{srate:0,hz:0,dc:0} args: { hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out }}
osc: { class: sine_tone, in:{ hz:sh.out, srate:srate.out }}
afout: { class: audio_file_out, in:{ in:osc.out } args:{ fname:"$/audio_flow_out.wav"} }
}
presets: {
a: { lfo: { hz:1.0, dc:880 }, osc: { gain:0.95 } },
b: { lfo: { hz:2.0, dc:220 }, osc: { gain:0.75 } },
c: { lfo: a220 },
d: [ a,b,0.5 ]
}
}
}
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"] }}
}
}
}
//------------------ caw example test cases
// Demonstrate a simple two processor network.
demo_01_sine_file: {
durLimitSecs:5.0,
network: {
procs: {
osc: { class: sine_tone },
af: { class: audio_file_out, in: { in:osc.out } args:{ fname:"$/out.wav"} }
}
}
}
// Demonstrate simple signal processing and how to apply a processor class prefix.
demo_02_mod_sine: {
durLimitSecs:5.0,
network: {
procs: {
lfo: { class: sine_tone, args:{ hz:3, dc:440, gain:110 }}
sh: { class: sample_hold, in:{ in:lfo.out } }
osc: { class: sine_tone, preset:mono, in:{ hz:sh.out } },
af: { class: audio_file_out, in: { in:osc.out } args:{ fname:"$/out.wav"} }
}
}
}
// Demonstrate applying a preset at initialization time.
demo_03_presets: {
durLimitSecs:5.0,
preset: "a",
network: {
procs: {
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 } },
af: { class: audio_file_out, in: { in:osc.out } args:{ fname:"$/out.wav"} }
}
presets:
{
a: { lfo: { hz:1.0, dc:880 }, osc: { gain:0.95 } },
b: { lfo: { hz:2.0, dc:220 }, osc: { gain:0.75 } },
c: { lfo: a880 },
d: [ a,b,0.5 ]
}
}
}
// Demonstrate the `print` processor and event programming.
demo_04_program: {
durLimitSecs: 10.0,
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:modulo } },
print: { class: print, in: { in:cnt.out, eol_fl:cnt.out }, args:{ text:["my","count"] }}
}
}
}
// Demonstrate 'mult' inputs.
demo_05_mult_inputs: {
durLimitSecs: 10.0,
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:modulo } },
numb: { class: number, args:{ in:3 }},
sum: { class: add, in: { in0:cnt.out, in1:numb.out } },
print: { class: print, in: { in0:cnt.out, in1:sum.out, eol_fl:sum.out }, args:{ text:["cnt","add","count"] }}
}
}
}
// Demonstrate different forms of the in-stmt
demo_06_mult_conn: {
durLimitSecs: 5.0,
network: {
procs: {
osc: { class: sine_tone, args: { chCnt:6, hz:[110,220,440,880,1760, 3520] }},
split: { class: audio_split, in:{ in:osc.out }, args: { select:[ 0,0, 1,1, 2,2 ] } },
// Create merge.in0,in1,in2 by iterating across all outputs of 'split'.
merge_a: { class: audio_merge, in:{ in_:split.out_ } },
af_a: { class: audio_file_out, in:{ in:merge_a.out }, args:{ fname:"$/out_a.wav" }}
// Create merge.in0,in1 and connect them to split.out0 and split.out1
merge_b: { class: audio_merge, in:{ in_:split.out0_2 } },
af_b: { class: audio_file_out, in:{ in:merge_b.out }, args:{ fname:"$/out_b.wav" }}
// Create merge.in0,in1 and connect them both to split.out1
merge_c: { class: audio_merge, in:{ in0_2:split.out1 } },
af_c: { class: audio_file_out, in:{ in:merge_c.out }, args:{ fname:"$/out_c.wav" }}
}
}
}
// Demonstrate creating processors with explicit sfx-ids and connecting to them with a single in-stmt.
demo_07_proc_suffix: {
durLimitSecs: 5.0,
network: {
procs: {
osc: { class: sine_tone, args: { chCnt:6, hz:[110,220,440,880,1760, 3520] }},
split: { class: audio_split, in:{ in:osc.out }, args: { select:[ 0,0, 1,1, 2,2 ] } },
// Create 3 audio gain controls with explicit sfx-ids
g0: { class:audio_gain, in:{ in:split0.out0 }, args:{ gain:0.9} },
g1: { class:audio_gain, in:{ in:split0.out1 }, args:{ gain:0.5} },
g2: { class:audio_gain, in:{ in:split0.out2 }, args:{ gain:0.1} },
// Create audio-merge inputs and connect them to 3 consecutive gain controls
// by iterating the in-stmt over the source proc sfx-id.
merge: { class: audio_merge, in:{ in_:g_.out } },
af: { class: audio_file_out, in:{ in:merge.out }, args:{ fname:"$/out_a.wav" }}
}
}
}
// Demonstrate instantiating 'mult' variables from the an 'args' statement.
demo_08_mix: {
durLimitSecs:5.0,
network: {
procs: {
osc_a: { class: sine_tone, args: { hz:110 } },
osc_b: { class: sine_tone, args: { hz:220 } },
// Instantiate gain:0 and gain:1 to control the input gain of in:0 and in:1.
mix: { class: audio_mix, in: { in0:osc_a.out, in1:osc_b.out }, args:{ igain0:[0.8, 0], igain1:[0, 0.2] } },
af: { class: audio_file_out, in: { in:mix.out } args:{ fname:"$/out.wav"} }
}
}
}
// Demonstrate a network with a polyphonic subnet.
demo_09_simple_poly: {
durLimitSecs: 5.0,
network: {
procs: {
g_list: { class: list, args: { in:0, list:[ 110f,220f,440f ]}},
dc_list: { class: list, args: { in:0, list:[ 220f,440f,880f ]}},
osc_poly: {
class: poly,
args: { count:3 }, // Create 3 instances of 'network'.
network: {
procs: {
lfo: { class: sine_tone, in:{ _.dc:_.dc_list.value_, _.gain:_.g_list.value_ } args: { chCnt:1, hz:3 }},
sh: { class: sample_hold, in:{ in:lfo.out }},
osc: { class: sine_tone, in:{ hz: sh.out }},
}
}
}
// Iterate over the instances of `osc_poly.osc_.out` to create one `audio_merge`
// input for every output from the polyphonic network.
merge: { class: audio_merge, in:{ in_:osc_poly.osc_.out}, args:{ gain:1, out_gain:0.5 }},
af: { class: audio_file_out, in:{ in:merge.out } args:{ fname:"$/out.wav"} }
}
}
}
}
}

View File

@ -0,0 +1,84 @@
{
test: {
test: {
base_dir: "~/src/cwtest/src/cwtest/cfg/test",
resource_dir:"rsrc",
output_dir:"cur",
ref_dir:"ref",
// Notes:
// 0. Add a new test:
// - Create a function like this: rc_t my_test_func(const test_args_t& args);
// - Add the module name, function pair to the `_test_map[]` in cwTest.cpp.
// - Add an entry to the test parameters cfg. below.
// + Name the test case (e.g. `test_0`) and give the test parameters.
// + On the call to my_test_func() the args.module_args is set to the 'module_args' dictionary defined in the cfg.
// + Likewise args.test_args is set to the 'test_args' dictionary referenced by the test name label 'e.g. test_0:{ my_arg:1 }'.
//
// - Run the test like this: `cwtest test/main.cfg test /my_module test_0 echo` to see the results of the test run.
// The results of this run will be written into /cur/my_test/test_0/log.txt
//
// - Once the results have been validated copy the output from 'cur' to the `/ref/my_test/test_0/log.txt.`
//
// - Verify that the test passes: `cwtest test/main.cfg test /my_module test_0 compare`
//
// 1. The test spec. is recursive. Modules can be listed
// inside of modules. (e.g. 'lex' and 'flow').
//
// 2. If a module spec. does not have an embedded
// 'module' or 'module_args' then the cases may
// be listed without a 'cases' label.
// (e.g. 'filesys','object', 'vop')
//
// 3. Command line args:
// <module_path> | 'all' (required) The module path always begins with a '/'.
// <test_label> | 'all' (required)
// 'gen_report' Print modulue/test label.
// 'compare' Run compare pass.
// 'echo' Print the generated test output to the console.
// 'args' All command line args after 'args' are passed to the tests.
//
// 4. Example command lines:
// r ~/src/cwtest/src/cwtest/cfg/test/main.cfg test /lex test_0 compare
// r ~/src/cwtest/src/cwtest/cfg/test/main.cfg test /flow test_0 compare
test: {
module_args: {}
modules: {
lex:{ module_args:{}, cases: { test_0:{} } },
filesys:{ test_0:{}},
object:{ basic:{}, to_json:{} },
vop:{ test_0:{} },
time:{ test_0:{} },
textBuf: { test_0:{} },
audioBuf:{ test_0:{} }
mtx:{ test_0: {
m0: [ [0,3], [1,4], [2,5] ],
m1: [ [0,1,2],[3,4,5] ],
m2: [ [[0,1],[2,3]], [[4,5],[6,7]], [[8,9],[10,11]] ],
m3: [ 0,1,2 ],
m4: [ [10,13], [11,14], [12,15] ],
y0: [ [5,14],[14,50] ],
y1: [ [9,12,15],[12,17,22],[15,22,29] ],
} },
flow:"flow_test.cfg",
flow_value:{ test_0:{} },
wt_bank: { test_0: {
wtb_cfg_fname:"/home/kevin/temp/wt1/bank",
}}
audio_transform: { wnd_func:{}, ola:{}, shift_buf:{}, wt_osc:{}, wt_seq_osc:{}, multi_ch_wt_seq_osc:{} },
wt_note: { test_0:{} },
thread_tasks: { test_0:{} },
numeric_convert: { test_0:{} }
}
}
}
}
}

View File

@ -0,0 +1 @@
: 0.000000 : 1.000000 : 2.000000 : 3.000000 : 4.000000 : 5.000000 : 6.000000 : 7.000000 : 8.000000 : 9.000000 : 10.000000 : 11.000000 : 12.000000 : 13.000000 : 14.000000 : 15.000000 : 16.000000 : 17.000000 : 18.000000 : 19.000000 : 20.000000 : 21.000000 : 22.000000 : 23.000000 : 24.000000 : 25.000000 : 26.000000 : 27.000000 : 28.000000 : 29.000000 : 30.000000 : 31.000000 : 32.000000 : 33.000000 : 34.000000 : 35.000000 : 36.000000 : 37.000000 : 38.000000 : 39.000000 : 40.000000 : 41.000000 : 42.000000 : 43.000000 : 44.000000 : 45.000000 : 46.000000 : 47.000000 : 48.000000 : 49.000000 : 50.000000 : 51.000000 : 52.000000 : 53.000000 : 54.000000 : 55.000000 : 56.000000 : 57.000000 : 58.000000 : 59.000000 : 60.000000 : 61.000000 : 62.000000 : 63.000000 : 64.000000 : 65.000000 : 66.000000 : 67.000000 : 68.000000 : 69.000000 : 70.000000 : 71.000000 : 72.000000 : 73.000000 : 74.000000 : 75.000000 : 76.000000 : 77.000000 : 78.000000 : 79.000000 : 80.000000 : 81.000000 : 82.000000 : 83.000000 : 84.000000 : 85.000000 : 86.000000 : 87.000000 : 88.000000 : 89.000000 : 90.000000 : 91.000000 : 92.000000 : 93.000000 : 94.000000 : 95.000000 : 96.000000 : 97.000000 : 98.000000 : 99.000000 : 100.000000 : 101.000000 : 102.000000 : 103.000000 : 104.000000 : 105.000000 : 106.000000 : 107.000000 : 108.000000 : 109.000000 : 110.000000 : 111.000000 : 112.000000 : 113.000000 : 114.000000 : 115.000000 : 116.000000 : 117.000000 : 118.000000 : 119.000000 : 120.000000 : 121.000000 : 122.000000 : 123.000000 : 124.000000 : 125.000000 : 126.000000 : 127.000000 : 128.000000 : 129.000000 : 130.000000 : 131.000000 : 132.000000 : 133.000000 : 134.000000 : 135.000000 : 136.000000 : 137.000000 : 138.000000 : 139.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 : 0.000000 :

View File

@ -0,0 +1 @@
: dir:../../../src/libcw: fn: cwFileSys: ext:cpp: fn: ../../../src/libcw/cwFileSys.cpp: ~/src/foo /home/kevin/src/foo

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,3 @@
info: : Activated preset:a
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,12 @@
: my : 0.000000 : count
info: : Entering runtime.
: my : 1.000000 : count
: my : 2.000000 : count
: my : 0.000000 : count
: my : 1.000000 : count
: my : 2.000000 : count
: my : 0.000000 : count
: my : 1.000000 : count
: my : 2.000000 : count
: my : 0.000000 : count
info: : 'maxCycleCnt' reached: 7500. Shutting down flow.

View File

@ -0,0 +1,12 @@
: cnt : 0.000000 : add : 3.000000 : count
info: : Entering runtime.
: cnt : 1.000000 : add : 4.000000 : count
: cnt : 2.000000 : add : 5.000000 : count
: cnt : 0.000000 : add : 3.000000 : count
: cnt : 1.000000 : add : 4.000000 : count
: cnt : 2.000000 : add : 5.000000 : count
: cnt : 0.000000 : add : 3.000000 : count
: cnt : 1.000000 : add : 4.000000 : count
: cnt : 2.000000 : add : 5.000000 : count
: cnt : 0.000000 : add : 3.000000 : count
info: : 'maxCycleCnt' reached: 7500. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 1500. Shutting down flow.

View File

@ -0,0 +1,6 @@
: cycle: 0 : cnt: 0: out: 0 vid: 12 ch: -1 : : : u:0 :
: cycle: 0 : add: 0: out: 0 vid: 0 ch: -1 : : : i:13 :
info: : Entering runtime.
: cycle: 750 : cnt: 0: out: 0 vid: 12 ch: -1 : : : u:1 : dst:add:0.in:2:
: cycle: 750 : add: 0: out: 0 vid: 0 ch: -1 : : : i:14 :
info: : 'maxCycleCnt' reached: 15000. Shutting down flow.

View File

@ -0,0 +1,7 @@
: cycle: 0 : a: 0: out: 0 vid: 2 ch: -1 : : : <invalid>:
: cycle: 0 : a: 0: out: 0 vid: 2 ch: -1 : : : i:1 :
: cycle: 0 : b: 0: out: 0 vid: 2 ch: -1 : : : <invalid>:
: cycle: 0 : b: 0: out: 0 vid: 2 ch: -1 : : : i:2 :
: cycle: 0 : add: 0: out: 0 vid: 0 ch: -1 : : : i:3 :
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 0. Shutting down flow.

View File

@ -0,0 +1,25 @@
: cycle: 0 : a: 0: value: 0 vid: 0 ch: -1 : : : i:1 :
: cycle: 0 : b: 0: value: 0 vid: 0 ch: -1 : : : i:2 :
: cycle: 0 : add: 0: out: 0 vid: 0 ch: -1 : : : i:3 : dst:b:0.store:0:
info: : Entering runtime.
: cycle: 0 : b: 0: value: 0 vid: 0 ch: -1 : : : i:3 : dst:add:0.in:1:
: cycle: 0 : add: 0: out: 0 vid: 0 ch: -1 : : : i:4 : dst:b:0.store:0:
: cycle: 1 : b: 0: value: 0 vid: 0 ch: -1 : : : i:4 : dst:add:0.in:1:
: cycle: 1 : add: 0: out: 0 vid: 0 ch: -1 : : : i:5 : dst:b:0.store:0:
: cycle: 2 : b: 0: value: 0 vid: 0 ch: -1 : : : i:5 : dst:add:0.in:1:
: cycle: 2 : add: 0: out: 0 vid: 0 ch: -1 : : : i:6 : dst:b:0.store:0:
: cycle: 3 : b: 0: value: 0 vid: 0 ch: -1 : : : i:6 : dst:add:0.in:1:
: cycle: 3 : add: 0: out: 0 vid: 0 ch: -1 : : : i:7 : dst:b:0.store:0:
: cycle: 4 : b: 0: value: 0 vid: 0 ch: -1 : : : i:7 : dst:add:0.in:1:
: cycle: 4 : add: 0: out: 0 vid: 0 ch: -1 : : : i:8 : dst:b:0.store:0:
: cycle: 5 : b: 0: value: 0 vid: 0 ch: -1 : : : i:8 : dst:add:0.in:1:
: cycle: 5 : add: 0: out: 0 vid: 0 ch: -1 : : : i:9 : dst:b:0.store:0:
: cycle: 6 : b: 0: value: 0 vid: 0 ch: -1 : : : i:9 : dst:add:0.in:1:
: cycle: 6 : add: 0: out: 0 vid: 0 ch: -1 : : : i:10 : dst:b:0.store:0:
: cycle: 7 : b: 0: value: 0 vid: 0 ch: -1 : : : i:10 : dst:add:0.in:1:
: cycle: 7 : add: 0: out: 0 vid: 0 ch: -1 : : : i:11 : dst:b:0.store:0:
: cycle: 8 : b: 0: value: 0 vid: 0 ch: -1 : : : i:11 : dst:add:0.in:1:
: cycle: 8 : add: 0: out: 0 vid: 0 ch: -1 : : : i:12 : dst:b:0.store:0:
: cycle: 9 : b: 0: value: 0 vid: 0 ch: -1 : : : i:12 : dst:add:0.in:1:
: cycle: 9 : add: 0: out: 0 vid: 0 ch: -1 : : : i:13 : dst:b:0.store:0:
info: : 'maxCycleCnt' reached: 10. Shutting down flow.

View File

@ -0,0 +1,21 @@
: cycle: 0 : srate: 0: out: 0 vid: 2 ch: -1 : : : <invalid>:
: cycle: 0 : srate: 0: out: 0 vid: 2 ch: -1 : : : f:48000.000000 :
: cycle: 0 : tmr: 0: srate: 0 vid: 0 ch: -1 : extern : : f:48000.000000 : src:srate:0.out:0:
: cycle: 0 : lfo: 0: srate: 0 vid: 0 ch: -1 : extern : : f:48000.000000 : src:srate:0.out:0:
: cycle: 0 : lfo: 0: hz: 0 vid: 2 ch: -1 : : : f:3.000000 :
: cycle: 0 : lfo: 0: dc: 0 vid: 4 ch: -1 : : : f:440.000000 :
info: : Entering runtime.
: cycle: 0 : lfo: 0: hz: 0 vid: 2 ch: -1 : : : f:1.000000 :
: cycle: 0 : lfo: 0: dc: 0 vid: 4 ch: -1 : : : f:880.000000 :
info: : Activated preset:a
: cycle: 1500 : lfo: 0: hz: 0 vid: 2 ch: -1 : : : f:2.000000 :
: cycle: 1500 : lfo: 0: dc: 0 vid: 4 ch: -1 : : : f:220.000000 :
info: : Activated preset:b
: cycle: 3000 : lfo: 0: hz: 0 vid: 2 ch: -1 : : : f:220.000000 :
info: : Activated preset:c
: cycle: 4500 : lfo: 0: hz: 0 vid: 2 ch: -1 : : : f:1.500000 :
: cycle: 4500 : lfo: 0: hz: 0 vid: 2 ch: -1 : : : f:1.500000 :
: cycle: 4500 : lfo: 0: dc: 0 vid: 4 ch: -1 : : : f:550.000000 :
: cycle: 4500 : lfo: 0: dc: 0 vid: 4 ch: -1 : : : f:550.000000 :
info: : Activated preset:d
info: : 'maxCycleCnt' reached: 15000. Shutting down flow.

View File

@ -0,0 +1,7 @@
: a : 0 : b : 0.000000 : c
info: : Entering runtime.
: a : 1 : b : 2.000000 : c
: a : 2 : b : 4.000000 : c
: a : 3 : b : 6.000000 : c
: a : 3 : b : 6.000000 : c
info: : 'maxCycleCnt' reached: 3750. Shutting down flow.

View File

@ -0,0 +1,20 @@
: cycle: 0 : srate: 0: out: 0 vid: 2 ch: -1 : : : <invalid>:
: cycle: 0 : srate: 0: out: 0 vid: 2 ch: -1 : : : f:48000.000000 :
: cycle: 0 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false :
: cycle: 0 : cnt: 0: out: 0 vid: 12 ch: -1 : : : u:0 :
: cycle: 0 : list: 0: out: 0 vid: 2 ch: -1 : : : a :
info: : Entering runtime.
: cycle: 750 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
: cycle: 750 : cnt: 0: out: 0 vid: 12 ch: -1 : : : u:1 : dst:list:0.in:0:
: cycle: 750 : list: 0: out: 0 vid: 2 ch: -1 : : : b :
: cycle: 1500 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false : dst:cnt:0.trigger:0:
: cycle: 1500 : cnt: 0: out: 0 vid: 12 ch: -1 : : : u:2 : dst:list:0.in:0:
: cycle: 1500 : list: 0: out: 0 vid: 2 ch: -1 : : : c :
: cycle: 2250 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
: cycle: 3000 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false : dst:cnt:0.trigger:0:
: cycle: 3750 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
: cycle: 4500 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false : dst:cnt:0.trigger:0:
: cycle: 5250 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
: cycle: 6000 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false : dst:cnt:0.trigger:0:
: cycle: 6750 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
info: : 'maxCycleCnt' reached: 7500. Shutting down flow.

View File

@ -0,0 +1,24 @@
: cycle: 0 : srate: 0: out: 0 vid: 2 ch: -1 : : : <invalid>:
: cycle: 0 : srate: 0: out: 0 vid: 2 ch: -1 : : : f:48000.000000 :
: cycle: 0 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false :
: cycle: 0 : cnt: 0: out: 0 vid: 12 ch: -1 : : : u:0 :
: cycle: 0 : x0v: 0: out: 0 vid: 2 ch: -1 : : : <invalid>:
: cycle: 0 : x0v: 0: out: 0 vid: 2 ch: -1 : : : i:2 :
: cycle: 0 : x1v: 0: out: 0 vid: 2 ch: -1 : : : <invalid>:
: cycle: 0 : x1v: 0: out: 0 vid: 2 ch: -1 : : : i:3 :
: cycle: 0 : add: 0: out: 0 vid: 0 ch: -1 : : : i:5 :
info: : Entering runtime.
: cycle: 750 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
: cycle: 750 : cnt: 0: out: 0 vid: 12 ch: -1 : : : u:1 : dst:add:0.in:2:
: cycle: 750 : add: 0: out: 0 vid: 0 ch: -1 : : : i:6 :
: cycle: 1500 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false : dst:cnt:0.trigger:0:
: cycle: 1500 : cnt: 0: out: 0 vid: 12 ch: -1 : : : u:2 : dst:add:0.in:2:
: cycle: 1500 : add: 0: out: 0 vid: 0 ch: -1 : : : i:7 :
: cycle: 2250 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
: cycle: 3000 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false : dst:cnt:0.trigger:0:
: cycle: 3750 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
: cycle: 4500 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false : dst:cnt:0.trigger:0:
: cycle: 5250 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
: cycle: 6000 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:false : dst:cnt:0.trigger:0:
: cycle: 6750 : tmr: 0: out: 0 vid: 3 ch: -1 : : : b:true : dst:cnt:0.trigger:0:
info: : 'maxCycleCnt' reached: 7500. Shutting down flow.

View File

@ -0,0 +1,8 @@
: cycle: 0 : srate: 0: in: 0 vid: 3 ch: -1 : : : f:48000.000000 :
: cycle: 0 : tmr: 0: srate: 0 vid: 0 ch: -1 : extern : : f:48000.000000 : src:srate:0.out:0:
: cycle: 0 : lfo: 0: srate: 0 vid: 0 ch: -1 : extern : : f:48000.000000 : src:srate:0.out:0:
info: : Entering runtime.
info: : Activated preset:a
info: : Activated preset:b
info: : Activated preset:c
info: : 'maxCycleCnt' reached: 15000. Shutting down flow.

View File

@ -0,0 +1,8 @@
: cycle: 0 : tmr: 0: srate: 0 vid: 0 ch: -1 : : : f:48000.000000 :
: cycle: 0 : lfo: 0: srate: 0 vid: 0 ch: -1 : : : f:0.000000 :
: cycle: 0 : osc: 0: srate: 0 vid: 0 ch: -1 : : : f:0.000000 :
info: : Entering runtime.
info: : Activated preset:a
info: : Activated preset:b
info: : Activated preset:c
info: : 'maxCycleCnt' reached: 15000. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 7500. Shutting down flow.

View File

@ -0,0 +1,12 @@
: cycle: 0 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : a : src:list:0.out:0:
info: : Entering runtime.
info: : Activated preset:a
: cycle: 1500 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : b : src:list:0.out:0:
info: : Activated preset:b
: cycle: 3000 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : c : src:list:0.out:0:
info: : Activated preset:c
: cycle: 4500 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : b : src:list:0.out:0:
info: : Activated preset:b
: cycle: 6000 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : a : src:list:0.out:0:
info: : Activated preset:a
info: : 'maxCycleCnt' reached: 7500. Shutting down flow.

View File

@ -0,0 +1,12 @@
: cycle: 0 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : a : src:list:0.out:0:
info: : Entering runtime.
info: : Activated preset:a
: cycle: 1500 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : b : src:list:0.out:0:
info: : Activated preset:b
: cycle: 3000 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : c : src:list:0.out:0:
info: : Activated preset:c
: cycle: 4500 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : b : src:list:0.out:0:
info: : Activated preset:b
: cycle: 6000 : xfade_ctl: 0: trigger: 0 vid: 4 ch: -1 : extern : : a : src:list:0.out:0:
info: : Activated preset:a
info: : 'maxCycleCnt' reached: 7500. Shutting down flow.

View File

@ -0,0 +1,2 @@
info: : Entering runtime.
info: : 'maxCycleCnt' reached: 7500. Shutting down flow.

View File

@ -0,0 +1,32 @@
info: : ln:1 col:1 tok:<int> '123' len:3
info: : Number: int:123 dbl:123.000000 unsigned:0 float:0
info: : ln:1 col:4 tok:<ident> 'ident0' len:6
info: : ln:1 col:10 tok:<space> '
' len:2
info: : ln:2 col:3 tok:<real> '123.456' len:7
info: : Number: int:123 dbl:123.456000 unsigned:0 float:0
info: : ln:2 col:10 tok:<space> '
' len:1
info: : ln:3 col:2 tok:<ident> 'ident0' len:6
info: : ln:3 col:8 tok:<space> '
' len:1
info: : ln:4 col:2 tok:<hex> '0xa12' len:5
info: : Number: int:2578 dbl:2578.000000 unsigned:0 float:0
info: : ln:4 col:7 tok:+ '+' len:1
info: : ln:4 col:8 tok:<real> '.2' len:2
info: : Number: int:0 dbl:0.200000 unsigned:0 float:0
info: : ln:4 col:10 tok:<space> '
' len:24
info: : ln:5 col:25 tok:<lcmt> '// comment
' len:12
info: : ln:6 col:2 tok:<bcmt> '/* block
comment */' len:20
info: : ln:7 col:12 tok:<qstr> 'quoted string' len:13
info: : ln:7 col:27 tok:<ident> 'ident1' len:6
info: : ln:7 col:33 tok:<space> ' ' len:1
info: : ln:7 col:34 tok:<real> '1234.56f' len:8
info: : Number: int:1234 dbl:1234.560000 unsigned:0 float:1
info: : ln:7 col:42 tok:<int> '345u' len:4
info: : Number: int:345 dbl:345.000000 unsigned:1 float:0
info: : ln:7 col:46 tok:<space> ' ' len:23
info: : ln:7 col:69 tok:<lcmt> '// last line comment' len:20

View File

@ -0,0 +1,69 @@
: offset: 3
: m0 :: 3 : 2 :
: 0 | : 0.000 : 3.000 :
: 1 | : 1.000 : 4.000 :
: 2 | : 2.000 : 5.000 :
: m1 :: 2 : 3 :
: 0 | : 0.000 : 1.000 : 2.000 :
: 1 | : 3.000 : 4.000 : 5.000 :
: m2 :: 3 : 2 : 2 :
: 0
: 0 | : 0.000 : 1.000 :
: 1 | : 2.000 : 3.000 :
: 1
: 0 | : 4.000 : 5.000 :
: 1 | : 6.000 : 7.000 :
: 2
: 0 | : 8.000 : 9.000 :
: 1 | : 10.000 : 11.000 :
: m3 :: 3 :
: 0.000 : 1.000 : 2.000 :
: m4 :: 3 : 2 :
: 0 | : 10.000 : 13.000 :
: 1 | : 11.000 : 14.000 :
: 2 | : 12.000 : 15.000 :
: y0 :: 2 : 2 :
: 0 | : 5.000 : 14.000 :
: 1 | : 14.000 : 50.000 :
: y1 :: 3 : 3 :
: 0 | : 9.000 : 12.000 : 15.000 :
: 1 | : 12.000 : 17.000 : 22.000 :
: 2 | : 15.000 : 22.000 : 29.000 :
: y0 :: 2 : 2 :
: 0 | : 5.000 : 14.000 :
: 1 | : 14.000 : 50.000 :
: y1 :: 3 : 3 :
: 0 | : 9.000 : 12.000 : 15.000 :
: 1 | : 12.000 : 17.000 : 22.000 :
: 2 | : 15.000 : 22.000 : 29.000 :
: m0 :: 3 : 2 :
: 0 | : 0.000 : 3.000 :
: 1 | : 1.000 : 4.000 :
: 2 | : 2.000 : 5.000 :
: y2 :: 6 : 2 :
: 0 | : 0.000 : 3.000 :
: 1 | : 1.000 : 4.000 :
: 2 | : 2.000 : 5.000 :
: 3 | : 10.000 : 13.000 :
: 4 | : 11.000 : 14.000 :
: 5 | : 12.000 : 15.000 :
: m0 :: 3 : 2 :
: 0 | : 0.000 : 3.000 :
: 1 | : 1.000 : 4.000 :
: 2 | : 2.000 : 5.000 :
: m4 :: 3 : 2 :
: 0 | : 10.000 : 13.000 :
: 1 | : 11.000 : 14.000 :
: 2 | : 12.000 : 15.000 :
: y3 :: 3 : 4 :
: 0 | : 0.000 : 3.000 : 10.000 : 13.000 :
: 1 | : 1.000 : 4.000 : 11.000 : 14.000 :
: 2 | : 2.000 : 5.000 : 12.000 : 15.000 :
: y4 - slice :: 1 : 4 :
: 0 | : 0.000 : 3.000 : 10.000 : 13.000 :
: y4 - mod :: 1 : 4 :
: 0 | : 0.000 : 2.000 : 10.000 : 13.000 :
: y5 -(one_hot(y4)) :: 3 : 4 :
: 0 | : 1.000 : 0.000 : 0.000 : 0.000 :
: 1 | : 0.000 : 1.000 : 1.000 : 0.000 :
: 2 | : 0.000 : 0.000 : 0.000 : 1.000 :

View File

@ -0,0 +1,2 @@
: 127 127
: 123 3.400000

View File

@ -0,0 +1,19 @@
: value:2
: {
: : : : a: : : 1: ,
: : : : b: : : 2: ,
: : : : c: : : [: : : : : : 1.230000: ,: : : : : : 4.560000: : ]: ,
: : : : d: : : true: ,
: : : : e: : : false: ,
: : : : f: : : true: ,
: }: G: 1 2
: R: 1 2 : 1 0 1
: 91 : { "a" : 1, "b" : 2, "c" : [ 1.230000, 4.560000 ] , "d" : true, "e" : false, "f" : true }
: {
: : : : a: : : 1: ,
: : : : b: : : 2: ,
: : : : c: : : [: : : : : : 1.230000: ,: : : : : : 4.560000: : ]: ,
: : : : d: : : true: ,
: : : : e: : : false: ,
: : : : f: : : true: ,
: }

View File

@ -0,0 +1 @@
: { "A" : "Abc", "B" : 1.234000, "v0" : [ 1.230000, 2.340000, 3.450000 ] , "v1" : [ -1, 0, 1, 2, 3, 4 ] }

View File

@ -0,0 +1,2 @@
: Hello
foo

View File

@ -0,0 +1,6 @@
: dMs:1000 : GTE:0 LTE:1
: 2 500000000
: 1 750000000
: 1 250000000
: usec:5000
: sleep 1000 ms

View File

@ -0,0 +1 @@
: 1 : 1 : 1 : 1 : 1 : 2 : 2 : 2 : 2 : 2 :

View File

@ -1,12 +1,12 @@
#include "cwCommon.h" #include "cwCommon.h"
#include "cwLog.h" #include "cwLog.h"
#include "cwCommonImpl.h" #include "cwCommonImpl.h"
#include "cwTest.h"
#include "cwMem.h" #include "cwMem.h"
#include "cwFile.h" #include "cwFile.h"
#include "cwVariant.h" #include "cwVariant.h"
#include "cwFileSys.h" #include "cwFileSys.h"
#include "cwTextBuf.h" #include "cwTextBuf.h"
#include "cwLex.h"
#include "cwText.h" #include "cwText.h"
#include "cwNumericConvert.h" #include "cwNumericConvert.h"
#include "cwObject.h" #include "cwObject.h"
@ -33,8 +33,6 @@
#include "cwTime.h" #include "cwTime.h"
#include "cwMidi.h" #include "cwMidi.h"
#include "cwMidiDecls.h" #include "cwMidiDecls.h"
#include "cwFlowDecl.h"
#include "cwFlow.h"
#include "cwDynRefTbl.h" #include "cwDynRefTbl.h"
#include "cwScoreParse.h" #include "cwScoreParse.h"
@ -108,8 +106,6 @@
#include "cwMidiState.h" #include "cwMidiState.h"
#include "cwSvgMidi.h" #include "cwSvgMidi.h"
//#include "cwNbMem.h"
#include <iostream> #include <iostream>
unsigned calc( unsigned n ) unsigned calc( unsigned n )
@ -277,6 +273,8 @@ char* optionalNewFile( const cw::object_t* args, const char* label )
{ return instantiatePathVariable(args,label,kVarOptionalFl); } { return instantiatePathVariable(args,label,kVarOptionalFl); }
cw::rc_t variadicTplTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) cw::rc_t variadicTplTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{ {
print("a", 1, "b", 3.14, "c",5L); print("a", 1, "b", 3.14, "c",5L);
@ -301,121 +299,7 @@ cw::rc_t variadicTplTest( const cw::object_t* cfg, const cw::object_t* args, int
} }
cw::rc_t testTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::test::test(args,argc,argv); }
cw::rc_t fileSysTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{
cw::filesys::pathPart_t* pp = cw::filesys::pathParts(__FILE__);
cwLogInfo("dir:%s",pp->dirStr);
cwLogInfo("fn: %s",pp->fnStr);
cwLogInfo("ext:%s",pp->extStr);
char* fn = cw::filesys::makeFn( pp->dirStr, pp->fnStr, pp->extStr, nullptr );
cwLogInfo("fn: %s",fn);
cw::mem::release(pp);
cw::mem::release(fn);
const char myPath[] = "~/src/foo";
char* expPath = cw::filesys::expandPath(myPath);
cwLogInfo("%s %s",myPath,expPath);
cw::mem::release(expPath);
return cw::kOkRC;
}
cw::rc_t numbCvtTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{
int8_t x0 = 3;
int x1 = 127;
cw::numeric_convert( x1, x0 );
printf("%i %i\n",x0,x1);
int v0 = -1;
double v1 = -1;
cw::string_to_number("123",v0);
cw::string_to_number("3.4",v1);
printf("%i %f\n",v0,v1 );
return cw::kOkRC;
}
cw::rc_t objectTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{
cw::object_t* o;
const char s [] = "{ a:1, b:2, c:[ 1.23, 4.56 ], d:true, e:false, f:true }";
cw::objectFromString(s,o);
int v;
o->get("b",v);
printf("value:%i\n",v);
o->print();
int a = 0;
int b = 0;
o->getv("a",a,"b",b);
printf("G: %i %i\n",a,b);
const unsigned bufN = 128;
char buf[bufN];
unsigned i = o->to_string(buf,bufN);
printf("%i : %s\n",i, buf);
cw::object_t* oo = o->duplicate();
oo->print();
oo->free();
o->free();
return cw::kOkRC;
}
cw::rc_t objectToJsonTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{
double v0[] = {1.23,2.34,3.45};
unsigned v0N = sizeof(v0)/sizeof(v0[0]);
int v1[] = {-1,0,1,2,3,4};
unsigned v1N = sizeof(v1)/sizeof(v1[0]);
cw::object_t* d = cw::newDictObject();
d->putv("A","Abc","B",1.234);
d->put_numeric_list("v0",v0,v0N);
d->put_numeric_list("v1",v1,v1N);
char* s = d->to_string();
printf("%s\n",s);
cw::mem::release(s);
d->free();
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 lexTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::lex::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; }
cw::rc_t kbTest2Test( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { cw::kbTest2(); return cw::kOkRC; } cw::rc_t kbTest2Test( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { cw::kbTest2(); return cw::kOkRC; }
@ -424,10 +308,7 @@ cw::rc_t spscBuf( const cw::object_t* cfg, const cw::object_t* args
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 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 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 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(); }
cw::rc_t audioDevFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::device::file::test(args); } cw::rc_t audioDevFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::device::file::test(args); }
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 b23TreeTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::b23::test(args); } cw::rc_t b23TreeTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::b23::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 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 audioFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audiofile::test(args); }
@ -444,14 +325,12 @@ cw::rc_t ifftTest( const cw::object_t* cfg, const cw::object_t* args
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 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 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 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 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); } 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); }
cw::rc_t pvocFileProc( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::pvoc_file_processor(args); } cw::rc_t pvocFileProc( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::afop::pvoc_file_processor(args); }
cw::rc_t socketMdnsTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::net::mdns::test(); } cw::rc_t socketMdnsTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::net::mdns::test(); }
cw::rc_t dnsSdTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::net::dnssd::test(); } cw::rc_t dnsSdTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::net::dnssd::test(); }
cw::rc_t euConTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::eucon::test(); } cw::rc_t euConTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::eucon::test(); }
cw::rc_t flowTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::flow::test(args); }
cw::rc_t scoreFollowTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::score_follow_test::test(args); } cw::rc_t scoreFollowTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::score_follow_test::test(args); }
cw::rc_t svgMidiFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::svg_midi::test_midi_file(args); } cw::rc_t svgMidiFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::svg_midi::test_midi_file(args); }
@ -460,7 +339,7 @@ cw::rc_t csvTest( const cw::object_t* cfg, const cw::object_t* args,
cw::rc_t scoreTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::score_test::test(args); } cw::rc_t scoreTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::score_test::test(args); }
cw::rc_t translateFrags( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::preset_sel::translate_frags(args); } cw::rc_t translateFrags( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::preset_sel::translate_frags(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(args); }
cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::ui::test(args); } cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::ui::test(args); }
#if defined(cwALSA) #if defined(cwALSA)
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::io::test(args); } cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::io::test(args); }
@ -468,13 +347,6 @@ cw::rc_t ioMinTest( const cw::object_t* cfg, const cw::object_t* args, i
cw::rc_t ioAudioMidiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio_midi_app::main(args); } cw::rc_t ioAudioMidiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio_midi_app::main(args); }
cw::rc_t ioPresetSelTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) cw::rc_t ioPresetSelTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{ {
/*
cw::rc_t rc;
const cw::object_t* flow_proc_dict = nullptr;
if((rc = cfg->getv("flow_proc_dict",flow_proc_dict)) != cw::kOkRC )
return cwLogError(rc,"The 'flow_proc_dict' specification object was not found.");
*/
return cw::preset_sel_app::main(args,argc-1,argv+1); return cw::preset_sel_app::main(args,argc-1,argv+1);
} }
#else #else
@ -498,7 +370,6 @@ cw::rc_t ioPresetSelTest( const cw::object_t* cfg, const cw::object_t* args, i
#if defined(cwALSA) #if defined(cwALSA)
cw::rc_t midiDeviceReport( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi::device::testReport();} cw::rc_t midiDeviceReport( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi::device::testReport();}
cw::rc_t midiDeviceTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi::device::test(args);} cw::rc_t midiDeviceTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi::device::test(args);}
cw::rc_t midiFileDevTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi::device::file_dev::test( args );}
cw::rc_t audioDevTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::device::test( args ); } cw::rc_t audioDevTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::device::test( args ); }
cw::rc_t audioDevTestTone( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::device::test_tone( args ); } cw::rc_t audioDevTestTone( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::device::test_tone( args ); }
cw::rc_t audioDevAlsaTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::device::alsa::report(); } cw::rc_t audioDevAlsaTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio::device::alsa::report(); }
@ -507,7 +378,6 @@ cw::rc_t audioDevRpt( const cw::object_t* cfg, const cw::object_t* args
cw::rc_t _no_alsa() { return cwLogError(cw::kResourceNotAvailableRC,"ALSA based functionality not included in this build."); } cw::rc_t _no_alsa() { return cwLogError(cw::kResourceNotAvailableRC,"ALSA based functionality not included in this build."); }
cw::rc_t midiDeviceReport( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa();} cw::rc_t midiDeviceReport( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa();}
cw::rc_t midiDeviceTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa();} cw::rc_t midiDeviceTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa();}
cw::rc_t midiFileDevTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa();}
cw::rc_t audioDevTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa(); } cw::rc_t audioDevTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa(); }
cw::rc_t audioDevTestTone( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa(); } cw::rc_t audioDevTestTone( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa(); }
cw::rc_t audioDevAlsaTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa(); } cw::rc_t audioDevAlsaTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa(); }
@ -783,13 +653,7 @@ int main( int argc, const char* argv[] )
func_t modeArray[] = func_t modeArray[] =
{ {
{ "variadicTpl", variadicTplTest }, { "variadicTpl", variadicTplTest },
{ "lex", lexTest }, { "test", testTest },
{ "fileSys", fileSysTest },
{ "numbCvt", numbCvtTest },
{ "object", objectTest },
{ "objectToJson", objectToJsonTest },
{ "vop", vectOpTest },
{ "time", timeTest },
{ "thread", threadTest }, { "thread", threadTest },
{ "kbTest1", kbTest1Test }, { "kbTest1", kbTest1Test },
{ "kbTest2", kbTest2Test }, { "kbTest2", kbTest2Test },
@ -801,9 +665,6 @@ int main( int argc, const char* argv[] )
{ "serialSrv", serialPortSrvTest }, { "serialSrv", serialPortSrvTest },
{ "midiDeviceReport", midiDeviceReport }, { "midiDeviceReport", midiDeviceReport },
{ "midiDevice", midiDeviceTest }, { "midiDevice", midiDeviceTest },
{ "midiFileDev", midiFileDevTest },
{ "textBuf", textBufTest },
{ "audioBuf", audioBufTest },
{ "audioDevFileTest", audioDevFileTest }, { "audioDevFileTest", audioDevFileTest },
{ "audioDevTest",audioDevTest }, { "audioDevTest",audioDevTest },
{ "audioDevTone", audioDevTestTone }, { "audioDevTone", audioDevTestTone },
@ -829,7 +690,6 @@ int main( int argc, const char* argv[] )
{ "dataset_rdr", datasetRdrTest }, { "dataset_rdr", datasetRdrTest },
{ "dataset_adapter", datasetAdapterTest }, { "dataset_adapter", datasetAdapterTest },
{ "svg", svgTest }, { "svg", svgTest },
{ "mtx", mtxTest },
{ "b23Tree", b23TreeTest }, { "b23Tree", b23TreeTest },
{ "midifile", midiFileTest }, { "midifile", midiFileTest },
{ "audiofile", audioFileTest }, { "audiofile", audioFileTest },
@ -846,13 +706,9 @@ int main( int argc, const char* argv[] )
{ "convolve", convolveTest }, { "convolve", convolveTest },
{ "piano_score", pianoScoreTest }, { "piano_score", pianoScoreTest },
{ "gutim_reg", gutimRegTest }, { "gutim_reg", gutimRegTest },
{ "audio_transforms", audioTransformsTest },
{ "am_to_midi_file", amToMidiFile }, { "am_to_midi_file", amToMidiFile },
{ "audio_file_proc", audioFileProc }, { "audio_file_proc", audioFileProc },
{ "pvoc_file_proc", pvocFileProc }, { "pvoc_file_proc", pvocFileProc },
{ "flow_test", flowTest },
{ "flow_pv", flowTest },
{ "flow_spec_dist", flowTest },
{ "preset_sel", ioPresetSelTest }, { "preset_sel", ioPresetSelTest },
{ "score_follow", scoreFollowTest }, { "score_follow", scoreFollowTest },
{ "svg_midi_file", svgMidiFileTest }, { "svg_midi_file", svgMidiFileTest },