cfg/main.cfg : Many changes an updates.

This commit is contained in:
kevin 2021-12-29 22:05:09 -05:00
parent a24a07ad64
commit e36ad7ddb8

View File

@ -755,6 +755,11 @@
ifft: {}, ifft: {},
convolve: {}, convolve: {},
piano_score:{
filename: "/home/kevin/src/currawong/projects/score_proc/data/play_file.cfg",
}
audio_transforms: {}, audio_transforms: {},
am_to_midi_file: { inDir: "~/temp/audio_midi_app_backup/taka1" }, am_to_midi_file: { inDir: "~/temp/audio_midi_app_backup/taka1" },
@ -850,7 +855,30 @@
} }
flow_class: { flow_proc_dict: {
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."}
}
}
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, srcFl:true, doc:"Audio input." }
}
}
audioFileIn: { audioFileIn: {
vars: { vars: {
fname: { type:string, doc:"Audio file name." }, fname: { type:string, doc:"Audio file name." },
@ -867,6 +895,82 @@
} }
} }
audio_gain: {
vars: {
in: { type:audio, srcFl:true, doc:"Audio input." },
gain: { type:real, value:1.0, doc:"Gain coefficient." }
out: { type:audio, doc:"Audio output." },
}
}
audio_split: {
vars: {
in: { type:audio, srcFl:true, 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." },
}
presets:
{
hi: { gain:1 },
lo: { gain:0.1 },
}
}
audio_duplicate: {
vars: {
in: { type:audio, srcFl:true, doc:"Audio input."},
duplicate: { type: uint, doc:"Count of times to repeat this channel." },
gain: { type: real, value:1.0, doc:"Audio gain." },
out: { type:audio, doc:"Audio output containing repeat * input channel count channels."}
}
}
audio_merge: {
vars: {
in0: { type:audio, srcFl:true, doc:"First audio input." },
in1: { type:audio, srcFl:true, doc:"Second audio input." },
gain: { type:real, 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." },
}
}
audio_mix: {
vars: {
in0: { type:audio, srcFl:true, doc:"First audio input." },
in1: { type:audio, srcFl:true, 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." },
out: { type:audio, doc:"Audio output. Channel count is the sum of the input channel count." },
}
}
audio_delay: {
vars: {
in: { type:audio, srcFl:true, doc:"Audio input." },
maxDelayMs: { type:real, value:1000.0 doc:"Maximum possible delay in milliseconds." },
delayMs: { type:real, doc:"Delay in milliseconds." },
out: { type:audio, doc:"Audio output." },
}
}
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" },
}
presets: {
a: { hz:220 },
b: { hz:880 },
}
}
pv_analysis: { pv_analysis: {
vars: { vars: {
in: { type:audio, srcFl:true, doc:"Audio input." }, in: { type:audio, srcFl:true, doc:"Audio input." },
@ -893,13 +997,18 @@
thresh: { type:real, value: 54.0, doc:"Threshold parameter."}, thresh: { type:real, value: 54.0, doc:"Threshold parameter."},
upr: { type:real, value: -0.7, doc:"Upper slope parameter."}, upr: { type:real, value: -0.7, doc:"Upper slope parameter."},
lwr: { type:real, value: 2.0, doc:"Lower slope parameter."}, lwr: { type:real, value: 2.0, doc:"Lower slope parameter."},
mix: { type:real, value: 0.0, doc:"Mix parameter."}, mix: { type:real, value: 0.0, doc:"Basic/Bump Mix parameter."},
out: { type:spectrum, doc:"Spectrum output." }, out: { type:spectrum, doc:"Spectrum output." },
} }
presets: { presets: {
dry: {
}
kc: { kc: {
ceiling: 20.0, ceiling: 20.0,
expo: 2.0, expo: 2.0,
@ -1053,6 +1162,10 @@
rls_ms: 1000.0 rls_ms: 1000.0
wnd_ms: 200.0 wnd_ms: 200.0
ogain: 1.0 ogain: 1.0
}
dry: {
} }
a: { a: {
@ -1146,7 +1259,7 @@
flow_spec_dist: { flow_spec_dist: {
framesPerCycle: 64, // time-domain audio cycles frame per cycle framesPerCycle: 64, // time-domain audio cycles frame per cycle
maxCycleCount: 15000, // 0 disables maxCycleCount maxCycleCount: 0, // 0 disables maxCycleCount
printNetworkFl: false, // print the network instance printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary printClassDictFl: false, // print the class description dictionary
@ -1154,20 +1267,21 @@
ain: ain:
{ {
class: audioFileIn, class: audioFileIn,
argLabel:"default", argLabel:"compare",
args:{ args:{
default:{ fname:"/home/kevin/temp/audio.wav", eofFl:true }, default:{ fname:"/home/kevin/temp/audio.wav", eofFl:true },
kc: { fname:"/home/kevin/src/currawong/audio/GUTIM_All_20200711_96k_float.wav", eofFl:true } kc: { fname:"/home/kevin/src/currawong/audio/GUTIM_All_20200711_96k_float.wav", eofFl:true }
compare:{ fname:"/mnt/zinger02k/zonk/temp/kc_record/xform_only/cut/dry.wav", eofFl:true }
} }
}, },
pva: { class: pv_analysis, in:{ in:ain.out }, args:{ default:{ wndSmpN:[2048,1024], hopSmpN:[512,256], hzFl:false } } }, pva: { class: pv_analysis, in:{ in:ain.out }, args:{ default:{ wndSmpN:[2048,1024], hopSmpN:[512,256], hzFl:false } } },
sd: { class: spec_dist, in:{ in:pva.out }, preset:[kc a] }, sd: { class: spec_dist, in:{ in:pva.out }, preset:[kc b] },
pvs: { class: pv_synthesis, in:{ in:sd.out }, }, pvs: { class: pv_synthesis, in:{ in:sd.out }, },
cmp: { class: compressor, in:{ in:pvs.out }, preset:[kc a] }, cmp: { class: compressor, in:{ in:pvs.out }, preset:[kc b] },
aout: { class: audioFileOut, in:{ in:cmp.out }, args:{ default:{fname:"/home/kevin/temp/audio_flow_out.wav"} } }, aout: { class: audioFileOut, in:{ in:cmp.out }, args:{ default:{fname:"/home/kevin/temp/kc_compare/b.wav"} } },
} }
} }
@ -1179,8 +1293,8 @@
score_fn: "/home/kevin/src/currawong/projects/score_proc/data/play_file.cfg", score_fn: "/home/kevin/src/currawong/projects/score_proc/data/play_file.cfg",
record_dir: "/home/kevin/temp/preset_sel_app", record_dir: "/home/kevin/temp/preset_sel_app",
record_folder: "record", record_fn: "preset_sel",
record_fn_ext: "am", record_fn_ext: "txt",
max_midi_msg_count: 32768, max_midi_msg_count: 32768,
midi_timer_period_micro_sec: 15000, midi_timer_period_micro_sec: 15000,
@ -1189,14 +1303,16 @@
//midi_out_device: "PipeWire-RT-Event" //midi_out_device: "PipeWire-RT-Event"
//midi_out_port: "input", //midi_out_port: "input",
audio_in_ch_map: [0, 1 ],
audio_out_ch_map: [0, 1 ], crossFadeSrate: 48000.0, // TODO: move to flow cfg. and set via 'system default sample rate'
crossFadeCount: 3,
presets: { presets: {
preset_labelL: [ "dry", "a", "b", "c", "d", "f1", "f2", "f3", "f4", "g", "ga", "g1a", "g1d" ], preset_labelL: [ "dry", "a", "b", "c", "d", "f1", "f2", "f3", "f4", "g", "ga", "g1a", "g1d" ],
default_gain: 1.0, default_gain: 1.0,
default_wet_dry_gain: 0.5, default_wet_dry_gain: 0.5,
default_fade_ms: 500.0 default_fade_ms: 500.0,
default_preset: "dry"
}, },
frag_panel: { frag_panel: {
@ -1207,18 +1323,30 @@
row: { row: {
col: { col: {
numb_disp: { name: fragBegLocId, title:"Beg Loc", value: 0 },
numb_disp: { name: fragEndLocId, title:"End Loc", value: 0 }, numb_disp: { name: fragEndLocId, title:"End Loc", value: 0 },
number: { name: fragGainId, title:"Gain", min:0.0, max:10.0, step:0.1, decpl:1 }, number: { name: fragInGainId, title:"In Gain", min:0.0, max:10.0, step:0.1, decpl:1 },
number: { name: fragOutGainId, title:"Out Gain", min:0.0, max:10.0, step:0.1, decpl:1 },
}, },
col: { col: {
row { row: {
name: fragPresetRowId name: fragPresetRowId
} },
row: {
string: { name: fragNoteId, addClassName: fragNote, title:"Note" },
}
}, },
col: { col: {
number:{ name: fragWetDryGainId, title:"Wet/Dry", min:0.0, max:1.0, step:0.1, decpl:2 }, number:{ name: fragWetDryGainId, title:"Wet/Dry", min:0.0, max:1.0, step:0.1, decpl:2 },
number:{ name: fragFadeOutMsId, title:"Fade Ms", min:0.0, max:5000, step:1, decpl:0 }, number:{ name: fragFadeOutMsId, title:"Fade Ms", min:0.0, max:5000, step:1, decpl:0 },
},
col: {
number: { name: fragBegPlayLocId, title:"Begin", min:0, max:1000000, step:1, decpl:0 },
number: { name: fragEndPlayLocId, title:"End", min:0, max:1000000, step:1, decpl:0 },
button: { name: fragPlayBtnId, title:"Play" }
} }
} }
} }
}, },
@ -1236,8 +1364,7 @@
uiCfgFn: "ui.cfg" // default UI resource description uiCfgFn: "ui.cfg" // default UI resource description
}, },
serial: serial: {
{
pollPeriodMs: 50, pollPeriodMs: 50,
recvBufByteN: 512, recvBufByteN: 512,
@ -1278,14 +1405,14 @@
{ {
// System device name // System device name
//device: "Scarlett 18i20 USB USB Audio", //device: "Scarlett 18i20 USB USB Audio",
//device: "USB Audio CODEC USB Audio", device: "USB Audio CODEC USB Audio",
device: "HDA Intel PCH CS4208 Analog", //device: "HDA Intel PCH CS4208 Analog",
enableFl: true, // (req) enableFl: true, // (req)
label: "main", // (req) User label label: "main", // (req) User label
userId: 0, // (opt) User id (can also be set at runtime) userId: 0, // (opt) User id (can also be set at runtime)
framesPerCycle: 512, // (req) Samples per audio device cycle framesPerCycle: 512, // (req) Samples per audio device cycle
cycleCnt: 3, // (req) Count of device cycle buffers. cycleCnt: 3, // (req) Count of device cycle buffers.
inGroup: "main", // (opt) All devices in a group must be 'ready' to source 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 outGroup: "main", // (opt) or sink data before an audio callback is made for that group
} }
@ -1302,7 +1429,114 @@
} }
flow0: {
framesPerCycle: 64, // time-domain audio cycles frame per cycle
maxCycleCount: 15000, // 0 disables maxCycleCount
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
sin: { class: sine_tone, args:{ default:{ hz:[220,880]} }},
splitL: { class: audio_split, in:{ in:sin.out }, args:{ default:{ select:[1,0]} }},
splitR: { class: audio_split, in:{ in:sin.out }, args:{ default:{ select:[0,1]} }},
delay: { class: audio_delay, in:{ in:splitL.out }, args:{ default:{ delayMs:1} }},
bal: { class: balance, args:{} },
mix: { class: audio_mix, in:{ in0:delay.out, in1:splitL.out, gain0:bal.out, gain1:bal.inv_out }, args:{ }},
merge: { class: audio_merge, in:{ in0:mix.out, in1:splitR.out }, args:{}},
aout: { class: audio_out, in:{ in:merge.out }, args:{ default:{dev_label:"main"} } },
}
presets: {
a: { splitL:hi, splitR:lo },
b: { splitL:lo, splitR:hi }
}
}
flow: {
framesPerCycle: 64, // time-domain audio cycles frame per cycle
maxCycleCount: 15000, // 0 disables maxCycleCount
printNetworkFl: false, // print the network instance
printClassDictFl: false, // print the class description dictionary
network: {
ain: { class: audio_in, args:{ default:{dev_label:"main"} } },
// split the input channels to create a wet and dry signal path
split_wet: { class: audio_split, in:{ in:ain.out }, args:{ default:{ select:[1,0]} }},
split_dry: { class: audio_split, in:{ in:ain.out }, args:{ default:{ select:[0,1]} }},
// duplicate the channels on the wet/dry signal path to simulate a 4 channel audio interface
dupl_wet: { class: audio_duplicate, in:{ in:split_dry.out }, args:{ duplicate:2 } },
dupl_dry: { class: audio_duplicate, in:{ in:split_wet.out }, args:{ duplicate:2 } },
// wet signal processing chain
pva: { class: pv_analysis, in:{ in:dupl_wet.out }, args:{ default:{ wndSmpN:512, hopSmpN:128, hzFl:false } } },
sd: { class: spec_dist, in:{ in:pva.out }, preset:kc },
pvs: { class: pv_synthesis, in:{ in:sd.out }, },
cmp: { class: compressor, in:{ in:pvs.out }, preset:kc },
// reduce the wet and dry signal path to 1 channel each because we are using a 2 channel interface
osplit_wet: { class: audio_split, in:{ in:cmp.out }, args:{ default:{ select:[1,0]} }},
osplit_dry: { class: audio_split, in:{ in:dupl_dry.out }, args:{ default:{ select:[0,1]} }},
// apply the wet/dry gain
wd_bal: { class: balance, args{}},
wet_gain: { class: audio_gain, in:{ in:osplit_wet.out, gain:wd_bal.out }, args:{}},
dry_gain: { class: audio_gain, in:{ in:osplit_dry.out, gain:wd_bal.inv_out }, args:{}},
// merge the wet/dry signals back into a single signal
merge: { class: audio_merge, in:{ in0:wet_gain.out, in1:dry_gain.out }, args:{} },
aout: { class: audio_out, in:{ in:merge.out }, args:{ default:{dev_label:"main"} } },
}
presets: {
dry: {
//wd_bal: { in:0 }
},
a: { sd:a, cmp:a },
b: { sd:b, cmp:b },
c: { sd:c, cmp:c },
d: { sd:d, cmp:d },
f1: { sd:f_1, cmp:f_1 },
f2: { sd:f_2, cmp:f_2 },
f3: { sd:f_3, cmp:f_3 },
f4: { sd:f_4, cmp:f_4 },
g: { sd:g, cmp:g },
ga: { sd:g_a, cmp:g_a },
g1a: { sd:g_1_a, cmp:g_1_a },
g1d: { sd:g_1_d, cmp:g_1_d }
}
}
} }
full_network:
{
network: {
ain: { class: audio_in, args:{ default:{dev_label:"main"} } },
pva: { class: pv_analysis, in:{ in:ain.out }, args:{ default:{ wndSmpN:512, hopSmpN:128, hzFl:false } } },
sd: { class: spec_dist, in:{ in:pva.out }, preset:kc },
pvs: { class: pv_synthesis, in:{ in:sd.out }, },
cmp: { class: compressor, in:{ in:pvs.out }, preset:kc },
mix: { class: mixer, in{ in0:ain.out, in1:cmp.out },
//sin: { class: sine_tone, args:{}},
aout: { class: audio_out, in:{ in:cmp.out }, args:{ default:{dev_label:"main"} } },
}
}
} }