diff --git a/src/caw/perf/perf_caw.cfg b/src/caw/perf/perf_caw.cfg new file mode 100644 index 0000000..e97b7fc --- /dev/null +++ b/src/caw/perf/perf_caw.cfg @@ -0,0 +1,180 @@ +{ + base_dir: "~/src/caw/src/caw/perf/io", + io_dict: "~/src/caw/src/caw/cfg/io.cfg" // Runtime configuration file. + proc_dict: "~/src/caw/src/libcw/flow/proc_dict.cfg", // Processor class definition file. + udp_dict: "~/src/caw/src/libcw/flow/udp_dict.cfg", // User defined proc files + + programs: { + + + ex_00_mod_sine: { + + 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 } }, + aout: { class:audio_out, in:{ in:osc.out }, args:{ dev_label:"main"} } + } + } + } + + ex_01_score_player: { + + network: { + + procs: { + player: { class:score_player, args:{ fname:"$/score_20240504.csv", vel_tbl_fname:"$/vel_table_perf.json", vel_tbl_label:"ivory" }}, + stop: { class: halt, in:{ in:player.done_fl }} + vctl: { class: poly_voice_ctl, in:{ in:player.out }, args:{ voice_cnt:20 } }, + + voice_poly: { + class: poly, + args: { count:20, parallel_fl:false } + + network: { + procs: { + voc: { class:piano_voice, in:{ _.in:_.vctl.out_ }, + out:{ _.done_fl:_.vctl.done_fl_ }, + args:{ wtb_fname:"~/temp/wt6/wt_bank.json", wtb_instr:"piano" } }, + //voc: { class:midi_voice, in:{_.in:_.vctl.out_ }, out:{ _.done_fl:_.vctl.done_fl_ }, args:{chCnt:2, gain:0.2 } }, + } + } + } + + amix: { class: audio_mix, in:{ in_:voice_poly.voc_.out } args:{ igain_:1.0 }}, + aout: { class: audio_out, in:{ in:amix.out }, args:{ dev_label:"main"}} + + } + } + } + + + ex_01a_score_player: { + + network: { + + procs: { + player: { class:score_player, args:{ fname:"$/score_20240504.csv", vel_tbl_fname:"$/vel_table_perf.json", vel_tbl_label:"ivory" }}, + stop: { class: halt, in:{ in:player.done_fl }} + vctl: { class: poly_voice_ctl, in:{ in:player.out }, args:{ voice_cnt:20 } }, + + voice_poly: { + class: poly, + args: { count:20, parallel_fl:false } + + network: { + procs: { + voc: { class:midi_voice, in:{_.in:_.vctl.out_ }, out:{ _.done_fl:_.vctl.done_fl_ }, args:{chCnt:2, gain:0.2 } }, + } + } + } + + + xf_ctl: { class:poly_xform_ctl, in:{ in_:voice_poly.voc_.out, + midi_:vctl.out_, + donefl_:voice_poly.voc_.done_fl }, args:{ out_ch_cnt:5 } } + + amix: { class: audio_mix, in:{ in_:xf_ctl.out_ } args:{ igain_:1.0 }}, + //amix: { class: audio_mix, in:{ in_:voice_poly.voc_.out } args:{ igain_:1.0 }}, + + aout: { class: audio_out, in:{ in:amix.out }, args:{ dev_label:"main"}} + + } + } + } + + ex_02_score_player: { + + network: { + + procs: { + player: { class:score_player, args:{ fname:"$/score_20240504.csv", vel_tbl_fname:"$/vel_table_perf.json", vel_tbl_label:"ivory" }}, + stop: { class: halt, in:{ in:player.done_fl }} + vctl: { class: poly_voice_ctl, in:{ in:player.out }, args:{ voice_cnt:20 } }, + ps: { class: preset_select, preset:init, in:{ in:player.out }, args:{ fname:"$/m1_458_trans_6.txt", preset_proc:"xf_poly" } } + + voice_poly: { + class: poly, + args: { count:20, parallel_fl:false } + + network: { + procs: { + //voc: { class:piano_voice, in:{ _.in:_.vctl.out_ }, + // out:{ _.done_fl:_.vctl.done_fl_ }, + // args:{ wtb_fname:"~/temp/wt6/wt_bank.json", wtb_instr:"piano" } }, + + voc: { class:midi_voice, in:{ _.in:_.vctl.out_ }, out:{ _.done_fl:_.vctl.done_fl_ }, args:{chCnt:2, gain:0.2 } }, + } + } + } + + xf_ctl: { class:poly_xform_ctl, in:{ in_:voice_poly.voc_.out, + midi_:vctl.out_, + donefl_:voice_poly.voc_.done_fl, + out_ch_idx:ps.out_idx }, args:{ out_ch_cnt:5 } } + + xf_poly : { + class: poly, + + args: { count:5, parallel_fl:false } + network: { + procs: { + pva: { class: pv_analysis, in:{ in:_.xf_ctl.out }, args:{ 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 } }, + ogain: { class: audio_gain, in:{ in:cmp.out } }, + }, + + presets: { + dry: { pva:dry, sd:dry, cmp:dry, ogain:{ gain:0.0 } }, + a: { pva:a, sd:a, cmp:a, ogain:{ gain:1.0 } }, + b: { pva:b, sd:b, cmp:b, ogain:{ gain:1.0 } }, + c: { pva:c, sd:c, cmp:c, ogain:{ gain:1.0 } }, + d: { pva:d, sd:d, cmp:d, ogain:{ gain:1.0 } }, + f1: { pva:f_1, sd:f_1, cmp:f_1, ogain:{ gain:1.0 } }, + f2: { pva:f_2, sd:f_2, cmp:f_2, ogain:{ gain:1.0 } }, + f3: { pva:f_3, sd:f_3, cmp:f_3, ogain:{ gain:1.0 } }, + f4: { pva:f_4, sd:f_4, cmp:f_4, ogain:{ gain:1.0 } }, + g: { pva:g, sd:g, cmp:g, ogain:{ gain:1.0 } }, + ga: { pva:g_a sd:g_a, cmp:g_a, ogain:{ gain:1.0 } }, + g1a: { pva:g_1_a sd:g_1_a, cmp:g_1_a, ogain:{ gain:1.0 } }, + g1d: { pva:g_1_d sd:g_1_d, cmp:g_1_d, ogain:{ gain:1.0 } } + } + } + } + + amix: { class: audio_mix, in:{ in_:xf_poly.ogain_.out } args:{ igain_:1.0 }}, + //amix: { class: audio_mix, in:{ in_:xf_ctl.out_ } args:{ igain_:1.0 }}, + aout: { class: audio_out, in:{ in:amix.out }, args:{ dev_label:"main"}} + + } + } + } + + + ex_03_preset_test: { + + 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 }, args:{ ch_cnt:2 } }, + gain: { class: audio_gain, in:{ in:osc.out }, args:{ gain:0.3 } } + aout: { class: audio_out, in:{ in:gain.out }, args:{ dev_label:"main"} } + } + + presets: + { + a: { gain:{ gain:0.2 } }, + b: { gain:{ gain:[0.1,0.3] } } + } + + } + } + + +} \ No newline at end of file diff --git a/src/caw/preset/preset_caw.cfg b/src/caw/preset/preset_caw.cfg new file mode 100644 index 0000000..50c81cc --- /dev/null +++ b/src/caw/preset/preset_caw.cfg @@ -0,0 +1,118 @@ + +{ + base_dir: "~/src/caw/src/caw/perf/io", + io_dict: "~/src/caw/src/caw/cfg/io.cfg" // Runtime configuration file. + proc_dict: "~/src/caw/src/libcw/flow/proc_dict.cfg", // Processor class definition file. + udp_dict: "~/src/caw/src/libcw/flow/udp_dict.cfg", // User defined proc files + + programs: { + + example_00: + { + + network: { + + procs: { + lfo: { class: sine_tone, args:{ hz:3, dc:440, gain:110 } + presets: { + a:{ hz:2 }, + b:{ hz:3 }, + c:{ hz:4 }, + d:{ hz:5 } + } + }, + + sh: { class: sample_hold, in:{ in:lfo.out } } + osc: { class: sine_tone, in:{ hz:sh.out }, args:{ ch_cnt:2 } }, + gain: { class: audio_gain, in:{ in:osc.out }, args:{ gain:0.3 } }, + aout: { class: audio_out, in:{ in:gain.out }, args:{ dev_label:"main"} } + } + + presets: + { + a: { lfo:a, gain:{ gain:0.2 } }, // One value sets both channels. + b: { lfo:b, gain:{ gain:[0.1,0.3] } }, // Multi-channel preset. + c: { lfo:c, gain:mute_on }, // Apply a class preset + d: { lfo:d, gain:mute_off }, // Apply a class preset with an ignored 'init' variable. + } + } + } + + example_01: + { + + network: { + + procs: { + osc: { class: sine_tone, args: { ch_cnt: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 three gain controls: g:0,g:1,g:2 using the processor label numeric suffix syntax. + 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.2} }, + + merge: { class: audio_merge, in:{ in_:g_.out } }, + out: { class: audio_out, in:{ in:merge.out }, args:{ dev_label:"main" }} + } + + presets: + { + a: { g_: { gain:0.1 } }, // Use underscore notation to apply a preset value to g0,g1,g2. + b: { g0_2: { gain:0.2 } }, // Use underscore notation to apply a preset value to g0 and g1. + c: { g2: { gain:0.3 } }, // Apply a preset value to g2 only. + } + } + } + + + example_02: + { + + network: { + + procs: { + + // LFO gain parameters - one per poly voice + g_list: { class: list, args: { in:0, list:[ 110f,220f,440f ]}}, + + // LFO DC offset parameters - one per poly voice + 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: { ch_cnt:1, hz:3 }}, + sh: { class: sample_hold, in:{ in:lfo.out }}, + osc: { class: sine_tone, in:{ hz: sh.out }}, + }, + + presets: + { + aa:{ osc:{ gain:0.3 } }, + bb:{ osc:{ gain:0.4 } }, + cc:{ osc2:{ gain:0.1 }, osc0_2: { gain:0.2 } }, + } + } + } + + // 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 }}, + aout: { class: audio_out, in:{ in:merge.out } args:{ dev_label:"main"} } + + } + + presets: { + a:{ osc_poly:aa, merge:{ out_gain:0.3 } }, + b:{ osc_poly:bb, merge:{ out_gain:0.2 } }, + c:{ osc_poly:cc, merge:{ out_gain:0.1 } }, + } + } + } + + } +}