flow/flow_test.cfg,flow/flow_proc_dict.cfg

This commit is contained in:
kevin 2024-05-19 15:31:28 -04:00
parent 3f8ff7c267
commit f402aa2470
4 changed files with 171 additions and 54 deletions

View File

@ -22,8 +22,8 @@ AM_LDFLAGS =
# debug/release switches
if DEBUG
AM_CFLAGS += -g
# -Wextra -Werror -Wconversion -fsanitize=address
AM_CXXFLAGS += -g -Wall -fsanitize=undefined
# -Wextra -Werror -Wconversion -fsanitize=address -lasan -fsanitize=thread
AM_CXXFLAGS += -g -Wall -Wextra -Wno-unused -fsanitize=undefined
else
AM_CFLAGS += -O3
AM_CXXFLAGS += -O3

View File

@ -29,7 +29,7 @@
test_1: {
framesPerCycle: 64,
maxCycleCount: 1500,
printNetworkFl: false, // print the network instance
network: {
procs: {
@ -38,6 +38,11 @@
osc: { class: sine_tone, in:{ hz:sh.out } },
afout: { class: audio_file_out, in: { in:osc.out } args:{ default:{fname:"/home/kevin/temp/audio_flow_out.wav"} }}
}
presets: {
a: { lfo:a220, osc: { gain:0.8 } },
b: { lfo:{ dc:220, gain:25 }, osc: { gain:0.5 } }
}
}
}
@ -77,7 +82,8 @@
test_4: {
framesPerCycle: 64,
maxCycleCount: 15000,
printNetworkFl: false,
network: {
procs: {

View File

@ -1,10 +1,9 @@
{
balance: {
vars: {
in: { type:real, value:0.5, doc:"Input vaue" },
out: { type:real, doc:"Ouput value. Same as input value."},
inv_out: { type:real, doc:"1.0 minus output value."}
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."}
}
}
@ -22,20 +21,20 @@
}
}
audioFileIn: {
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: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."},
}
}
audioFileOut: {
audio_file_out: {
vars: {
fname: { type:string, doc:"Audio file name." },
bits: { type:uint, value:32, doc:"Audio file word width. (8,16,24,32,0=float32)."},
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." }
}
}
@ -43,7 +42,7 @@
audio_gain: {
vars: {
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." },
}
}
@ -51,9 +50,10 @@
audio_split: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
select: { type:bool, doc:"Enable/Disable each channel" }
gain: { type:real, value:1.0, doc:"Audio gain for each selected (output) channel." }
out: { type:audio, doc:"Audio output." },
select: { type:int, 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:
@ -67,7 +67,7 @@
vars: {
in: { type:audio, flags:["src"], doc:"Audio input."},
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."}
}
}
@ -82,7 +82,7 @@
in5: { type:audio, flags:["src","src_opt"], doc:"Sixth audio input." },
in6: { type:audio, flags:["src","src_opt"], doc:"Seventh 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." },
}
}
@ -91,8 +91,8 @@
vars: {
in0: { type:audio, flags:["src"], doc:"First audio input." },
in1: { type:audio, flags:["src"], doc:"Second audio input." },
gain0: { type:real, value:0.5, doc:"Audio gain for input 0." },
gain1: { type:real, value:0.5, doc:"Audio gain for input 1." },
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." },
}
}
@ -100,8 +100,8 @@
audio_delay: {
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
maxDelayMs: { type:real, value:1000.0 doc:"Maximum possible delay in milliseconds." },
delayMs: { type:real, doc:"Delay in milliseconds." },
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." },
}
}
@ -109,16 +109,19 @@
sine_tone: {
vars: {
srate: { type:real, value:48000.0, doc:"Sine tone sample rate."}
chCnt: { type:uint, value:2, doc:"Output signal channel count."},
hz: { type:real, value:440.0, doc:"Frequency in Hertz."},
gain: { type:real, value:0.8, doc:"Signal frequency."},
out: { type:audio, doc:"Audio output" },
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: {
a: { hz:220 },
b: { hz:880 },
a220 : { hz:220 },
a440 : { hz:440 },
a880 : { hz:880 },
}
}
@ -218,12 +221,12 @@
in: { type:spectrum, flags:["src"], doc:"Spectrum input." },
bypass: { type:bool, value: false, doc:"Copy input to output without transform."},
ceiling: { type:real, value: 30.0, doc:"Ceiling parameter."},
expo: { type:real, value: 2.0, doc:"Exponent parameter."},
thresh: { type:real, value: 54.0, doc:"Threshold parameter."},
upr: { type:real, value: -0.7, doc:"Upper slope parameter."},
lwr: { type:real, value: 2.0, doc:"Lower slope parameter."},
mix: { type:real, value: 0.0, doc:"Basic/Bump Mix parameter."},
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." },
@ -359,14 +362,14 @@
vars: {
in: { type:audio, flags:["src"] true, doc:"Audio input." },
bypass: { type:bool, value: false, doc:"Bypass the compressor."},
igain: { type:real, value: 1.0, doc:"Input gain."},
thresh: { type:real, value: 90.0, doc:"Attack threshold in dB."},
ratio: { type:real, value: 2.0, doc:"Compression ratio."},
atk_ms: { type:real, value: 20.0, doc:"Attack time in milliseconds."},
rls_ms: { type:real, value: 20.0, doc:"Release time in milliseconds."},
wnd_ms: { type:real, value: 200.0, doc:"RMS calc. window length in milliseconds."},
maxWnd_ms: { type:real, value: 1000.0, doc:"Maximim (allocated) window length in milliseconds."},
ogain: { type:real, value: 1.0, doc:"Output gain."},
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." },
}
@ -475,9 +478,9 @@
vars: {
in: { type:audio, flags:["src"] true, doc:"Audio input." },
bypass: { type:bool, value: false, doc:"Bypass the limiter."},
igain: { type:real, value: 1.0, doc:"Input gain."},
thresh: { type:real, value: 0.0, doc:"Linear (0.0-1.0) threshold."},
ogain: { type:real, value: 1.0, doc:"Output gain."},
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." },
}
@ -496,7 +499,7 @@
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
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." },
}
@ -513,13 +516,121 @@
vars: {
in: { type:audio, flags:["src"], doc:"Audio input." },
dbFl: { type:bool, value: true, doc:"Output in Decibels." },
wndMs: { type:real, value: 100.0, doc:"RMS window length." },
peakDb: { type:real, value: -10.0, doc:"Peak threshold." },
out: { type:real, value: 0.0, doc:"Meter output." },
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." }
}
},
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." },
}
}
}

View File

@ -243,10 +243,10 @@ def gen_reference( scoreL, out_dir, out_fn ):
f.write(s)
if r0 and (r0['src'] == 'gutim' and r['src'] != 'gutim'):
print(r['src'],r['oloc'],end=" ")
print(r['src'],f"m{r0['meas']}",f"loc-begin:{r['oloc']}",end=" ")
if r0 and (r0['src'] != 'gutim' and r['src'] == 'gutim'):
print(r0['oloc'])
print(f"end:{r0['oloc']}")
r0 = r