From ec40706e2b211a11f4e0667e27683d8544c2c626 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 21 Apr 2025 09:32:37 -0400 Subject: [PATCH] flow/proc_dict.cfg : Added score_follow2 and voice_detector Many updates to support changes to other proc's. --- flow/proc_dict.cfg | 89 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 18 deletions(-) diff --git a/flow/proc_dict.cfg b/flow/proc_dict.cfg index a13e8dc..a3144eb 100644 --- a/flow/proc_dict.cfg +++ b/flow/proc_dict.cfg @@ -44,6 +44,7 @@ in: { type:midi, doc:"MIDI messages to send."}, rin: { type:record, fmt:{ required:["midi"]}, doc:"Record input. (must have 'midi' field)"}, print_fl: { type:bool, value:false, doc:"Print the output to the console."} + enable_fl: { type:bool, value:true, doc:"Enable the output port."} } } @@ -675,7 +676,7 @@ in: { type:uint, flags:["notify","src"], doc:"List selection index." }, list: { type:cfg, flags:["init"], value:{} 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." }, + value: { type:runtime, flags:["mult"], doc:"List 'mult' output per list value." }, } } @@ -735,7 +736,8 @@ in: { type:record, fmt:{ required:["midi"]} doc:"MIDI input."}, voice_cnt: { type:uint, value:3, flags:["init"], doc:"Count of voices." }, out: { type:midi, flags:["mult"], doc:"MIDI output to voices. One per voice." }, - done_fl: { type:bool, value:false, flags:["mult"], doc:"Voice available feedback triggers from voices. One per voice."}, + gate_fl: { type:bool, flags:["mult"], doc:"Output: Per voice. Goes true with note-on, false when done_fl is set." }, + done_fl: { type:bool, value:false, flags:["mult"], doc:"Input: Voice available feedback triggers from voices. One per voice."}, } }, @@ -743,11 +745,11 @@ piano_voice: { vars: { wtb_fname: { type:string, flags:["init"], doc:"Wave table bank cfg. file." }, - wtb_instr: { type:string, value:"piano", flags:["init"], doc:"Instrument label of the selected wave-table bank."}, - in: { type:midi, doc:"MIDI in" }, - out: { type:audio, doc:"Audio out" }, - done_fl: { type:bool, value:false, doc:"Triggers when voice is available."}, - gate_fl: { type:bool, value:false, doc:"True when voice is active, false when inactive." }, + wtb_instr: { type:string, value:"piano", flags:["init"], doc:"Instrument label of the selected wave-table bank."}, + in: { type:midi, doc:"MIDI in" }, + out: { type:audio, doc:"Audio out" }, + done_fl: { type:bool, value:false, doc:"Output: True when voice is available, false when active."}, + gate_fl: { type:bool, value:false, doc:"Output: True when voice is active, false when inactive." }, rls_coeff: { type:coeff, value:0.9, doc:"Release decay factor. Increase for longer decays."}, rls_thresh:{ type:coeff, value:0.01,doc:"Note off threshold. Decrease for longer decays."}, @@ -758,6 +760,15 @@ } }, + voice_detector: { + vars: { + in: { type:audio, doc:"Audio in" }, + enable_fl: { type:bool, flags:[notify], value:false, doc:"Set when this voice detector is enabled." }, + rls_thresh: { type:coeff, flags:[notify], value:0.01, doc:"Voice off threshold." }, + done_fl: { type:bool, value:true, doc:"Output: Set when the voice is inactive, cleared when it is active."} + } + }, + print: { vars: { @@ -797,10 +808,23 @@ "bpm = beats per minute should be given on the first line. (Defaults to 60)." ] vars: { - fname: { type:string, flags:["init"], value:"", doc:"MIDI file name." }, - csv_fname: { type:string, flags:["init"], value:"", doc:"MIDI CSV fname. See: midi::file open_csv()." }, - done_fl: { type:bool, value:false, doc:"Emits true on done." }, - out: { type:midi, doc:"MIDI output."} + fname: { type:string, flags:["init"], value:"", doc:"MIDI file name." }, + csv_fname: { type:string, flags:["init"], value:"", doc:"MIDI CSV fname. See: midi::file open_csv()." }, + alt_csv_fname: { type:string, flags:["init"], value:"", doc:"MIDI CSV fname. See: midi::file open_csv_2()." }, + start: { type:all, flags:["notify"], value:false, doc:"Start playback" }, + stop: { type:all, flags:["notify"], value:false, doc:"Stop playback" }, + done_fl: { type:bool, value:false, doc:"Emits true on done." }, + out: { type:midi, doc:"MIDI output."}, + r_out: { type:record, doc:"MIDI output as records.", + fmt: { + alloc_cnt:1024, + fields: { + midi: { type:m3, doc:"MIDI channel event message" }, + } + } + } + + } } @@ -838,6 +862,7 @@ b_meas: { type:uint, flags:["notify"], value:0, doc:"Score begin measure." }, e_meas: { type:uint, flags:["notify"], value:0, doc:"Score end measure." }, done_fl: { type:bool, value:false, doc:"Emits true on done." }, + loc_cnt: { type:uint, value:0, doc:"Output: Value of max 'loc'."}, out: { type:record, doc:"Score event record.", fmt: { fields: { @@ -851,7 +876,9 @@ }, vel_table: { - doc:[ "Remap MIDI velocity values."] + doc:[ "Remap MIDI velocity values." + "If the incoming record has a 'score_vel' field then this is taken as the source velocity to be mapped and the MIDI message velocity is ignored." + ] vars: { vel_tbl_fname:{ type:string, flags:["init"], value:"", doc:"Velocity table filename as create by vwVelTableTuner." }, vel_tbl_label:{ type:string, flags:["init"], value:"", doc:"Name of the active velocity table referenced by 'vel_fname'."}, @@ -879,6 +906,26 @@ } } + score_follower_2: { + doc:[ "MIDI score follower: Sets the 'loc' field of the output record according to the score location." ] + vars: { + in: { type:record, fmt:{ required:["midi"]} doc:"Input record with 'midi' and 'loc' fields." }, + score_fname: { type:string, flags:["init"], value:"", doc:"Score file with location information." }, + b_loc: { type:uint, value:0, doc:"Score begin location." }, + e_loc: { type:uint, value:0, doc:"Score end location." }, + reset_trigger { type:all, flags:["notify"], value:false, doc:"Reset the score follower." }, + print_fl: { type:bool, flags:["init"], value:false, doc:"Set to print log of score follower state." }, + out:{ type:record, doc:"Pass-through of incoming MIDI with score location and score velocity." + fmt: { + alloc_cnt:1024, // internal recd_array size + fields: { + loc: { type:uint, value:-1, doc:"Score location id or if score track failed." } , + score_vel: { type:uint, value:-1, doc:"Score mapped velocity or -1 if 'loc' is -1." } + } + } + + } + } preset_select: { doc:[ "Given a score location emit a preset label."], @@ -920,12 +967,18 @@ gutim_ps: { doc:[ "Given score location and MIDI note messages emit transform parameters."], vars: { - cfg: { type:cfg, flags:["init"], doc:"Initial preset configuration." }, - fname: { type:string, flags:["init"], value:"", doc:"Preset file name."}, - in: { type:record, fmt:{ required:["loc"] }, doc:"Input record with 'loc' field." }, - loc: { type:uint, value:0, doc:"Seek to this location." }, - reset: { type:bool, flags:["notify"], value:false, doc:"Reset to initial state."}, - per_note_fl: { type:bool, value:false, doc:"Update the selected preset on every note, otherwise update on new location values." }, + cfg: { type:cfg, flags:["init"], doc:"Initial preset configuration." }, + fname: { type:string, flags:["init"], value:"", doc:"Preset file name."}, + loc_cnt: { type:uint, flags:["init"], value:0, doc:"Count of uniq 'loc' id's in the score."}, + //in: { type:record, fmt:{ required:["loc"] }, doc:"Input record with 'loc' field." }, + in: { type:record, doc:"Input record with 'loc' field." }, + loc: { type:uint, value:0, doc:"Seek to this location." }, + reset: { type:bool, flags:["notify"], value:false, doc:"Reset to initial state."}, + pri_manual_sel: { type:uint, flags:["notify"], value:-1, doc:"Manually select the presets.", ui:{ type:list} }, + sec_manual_sel: { type:uint, flags:["notify"], value:-1, doc:"Manually select the presets.", ui:{ type:list} }, + per_note_fl: { type:bool, value:false, doc:"Change the preset on every note, otherwise change on new preset 'fragments'." }, + per_loc_fl: { type:bool, value:false, doc:"Change the preset on every score location, change according to 'per_note_fl'." }, + dry_chord_fl: { type:bool, value:false, doc:"Set to make 50% of all chord notes dry."}, pri_prob_fl: { type:bool, flags:["notify"], value: false, doc:"Select primary preset probabilstically." } pri_uniform_fl: { type:bool, flags:["notify","ui_disable"], value: false, doc:"Use a uniform probability distribution rather than an 'order' weighted distribution." },