TODO: fix cwDsp.h: ampl_to_db(),db_to_ampl(), add pow_to_db() and db_to_pow(). Implement vectorized version in terms of the scalar versions in cwDsp.h. Decide on standard dB range. e.g. -100 to 0, 0 to 100 .... * Flow Variables Class ** Attributes + type: real,int,string,audio,spectrum,enum + flags: attribute flags - src: This variable must be connected. - multi: This variable may be instantiated multiple times - fan_in: This variable allows multiple incoming connections. + value: - real,int { min,max,value,center,step } - enum [ list of (id,label) pairs ] + doc: documentation string + max_multi: max count of instantiations due to multiple connections + min_multi: min count of instantiations due to multiple connections * Flow Proc Class ** Attributes + doc: documentation string + sub_proc: - sub_proc_cnt: set an absolute sub_proc_cnt - sub_proc_cnt_min: - sub_proc_cnt_max: - sub_proc_var + label + flags: [ audio_chs, multi_chs, fan_in_chs ] Calculate the sub_proc_cnt based on the count of mult's,fan_ins, and audio channels. * Var Map: #+BEGIN_SRC c typedef struct variable_str { variable_str* var_link; // instance_t varL links } variable_t; typedef struct proc_desc { var_desc_t* varDescA; // description of each base variable unsigned varDescN; } proc_desc_t; typedef struct varBase_str { char* label; // label assigned to this 'mult' unsigned multIdx; // mult index variable_t* baseVar; // all variables have a base instance (chIdx=kAnyChIdx) unsigned subProcN; // count of times this variable is replicated to specialize for a given subprocess variable_t* subProcA[ subProcN ]; // } varBase_t; typedef struct varMap_str { unsigned multN; // count of times this variable is replicated based on multiple incoming connections to the same input variable label. varBase_t* multA[ multN ] // pointer to each base variable } varMap_t; typedef struct instance_str { variable_t* varL; // variable linked list: list of all variable instances unsigned maxVId; // maximum application supplied vid. In general maxVId+1 == proc_desc_t.varDescN varMap_t varMap[ maxVId ]; // maps an application vid to a list of variable instances } instance_t; #+END_SRC * * Plan ** Flow processor 'multi' processor: Add the ability for a processor to expand the number of variables based on incoming connections. - Variables with this capability must have the 'multi' attribute in the class description. - The new variables will be named by adding a suffix in the connection command. e.g. in:{ in.a:out.foo } connect the output out.foo to a new variable instantiated on the the local variable description 'in'. - The new variable may then be addressed by referring to 'in.a'. - The proc instance may then ask for a count of variable instances for a given base varaible. var_get_multi_count( ...,'in') and address them by var_get( ...,'in',multi_idx). - Note that once a variable is given the 'multi' attribute the only way for the instance to access the variable is by supplying the 'multi' index since the variable label alone will not be adequate to select among multiple instances. ** Flow processor Fan-in capability: Add the ability for a processor variables to support multiple incoming connections. - Fan-in capability must be enabled in the processor class description with the 'fan-in' attribute. - The array of variables associated with fan-in connections will be addressed via "