Array Element Pass if Change
by waiting maybe give a shot at this one quick modified from old one i found back
Code: Select all
////////////////////////////////////////////////////////////////////////////////////////////
// Pass If Chg Array //
// HH3 FX23 03/10/17
////////////////////////////////////////////////////////////////////////////////////////////
const SIZE = 8; // nb of out wanted = size of array
const PREFIX = 'OUT_'; // PREFIX for outputs names, folowed by Integer;
var ArrayIn: Tparameter;
var OUTPUTS: Array Of Tparameter;
var i, l, count: integer;
var ArrayLast: Array of single;
/////////////////////////////////////
PROCEDURE INIT;
BEGIN
ArrayIn := CreateParam('ArrayIn',PtArray); SetIsOutput(ArrayIn,False);
setMin(arrayIn,-Maxint); setMax(ArrayIn,maxint);
SetArrayLength(OUTPUTS,SIZE); // we set the arraylength to create N outputs of size defined by constant on top
// of script.
for i:=0 to SIZE -1 do begin
OUTPUTS[i]:= CreateParam(PREFIX+IntToStr(i),PtDataField); SetIsInput(OUTPUTS[i],false);
end;
setArrayLength(ArrayLast,SIZE);
setdontsave(arrayIn,false);
END;//INit
//////////////////////////////
PROCEDURE Callback(N:integer);
BEGIN
if (n=arrayIn) then begin
l:= getlength(ArrayIn);
count:=-1;
end;
END;//callback
//////////////////////////////
PROCEDURE PROCESS;
var valin: single;
BEGIN
if count > -2 then begin //start counting when callback has set count to -1
inc(count) ; // -1+1=0 so at first bloc count is 0
end;
if count < 2 then begin //for 2 blocs compare 2nd bloc to reset length to 0 if a value passe in first
for i:=0 to l-1 do begin
valin:= getDataArrayValue(ArrayIn,i);
if (ArrayLast[i] - valin<>0) then begin
setValue(OUTPUTS[i],valin);
setLength(OUTPUTS[i],1);
ArrayLast[i]:= valin;
end
else begin
setLength(OUTPUTS[i],0);
end;
end;
end;
if count = 2 then begin count:=-2; end;
end;Thanks 23FX, this looks like it could be useful but it is not quite what I had in mind in this case. The input array values would need pass through to an array outlet and only allow to flow the element values that had changed.
Also, the array size would need to recognize automatically or by sending a value to a size parameter inlet.
Also, the array size would need to recognize automatically or by sending a value to a size parameter inlet.
yes think i see what you mean , thing is, (senso may confirm or infirm?) afaik usine currentlty does not supports arrays flows to have sub elements of 0 length (wich is what happen when a value does not pass, i suspect it would be complex to rethink that for all array using stuff, but in case possible yes that would be handy i reckon.
-
sm_jamieson
- Member
- Posts: 555
- Contact:
The midi array flows can have size 0 as its the way to prevent midi messages being repeated every bloc, so I would think having this for an array flow would be fairly easy to do.
Also note, in general size 0 means nothing flowing, and size -1 means "unconnected". I have found this to matter sometimes.
Also note, in general size 0 means nothing flowing, and size -1 means "unconnected". I have found this to matter sometimes.
the whole flow yes, but not sure a tmidi (sub) element can be set to length -1 while other messages and size of output array remain? but maybe thats a long time i didn't try.
as i understand, midi flow were designed as delphi 'records' from the begining, kindof arrays of arrays, while arrays are just simple arrays, if changing the type that would mean all the wires, datas flows and modules using arrays would have to readapt, wich doesn't sound that simple, but maybe (hope) im wrong^^.
as i understand, midi flow were designed as delphi 'records' from the begining, kindof arrays of arrays, while arrays are just simple arrays, if changing the type that would mean all the wires, datas flows and modules using arrays would have to readapt, wich doesn't sound that simple, but maybe (hope) im wrong^^.
As suggested by 23fx in another thread, perhaps if a general array pass if change is not easily possible, perhaps the plugin/vst wrapper could be modified to allow an option for incoming array values to be disconnected unless value has changed? Perhaps with an inlet on the plugin to force update from array?
this module is impossible to create with the actual engine.
there is no way to make Usine ignore an array element and let pass others.
For the vst suggestion, I'll study this question and see If I can do it.
there is no way to make Usine ignore an array element and let pass others.
For the vst suggestion, I'll study this question and see If I can do it.
Olivier Sens
www.brainmodular.com
www.brainmodular.com
guru,
As far as disconnecting incoming array unless values have changed...for the array of a VST:
Are you just wanting control from both external UI objects, and the Plugin interface?
If so the VST Plugin with Learn option, I have it so you can have multi-control without problem.
Just drop a vst into an empty patch and select the "open with Learn" option.
Was just curious what you were looking to do.
-s
As far as disconnecting incoming array unless values have changed...for the array of a VST:
Are you just wanting control from both external UI objects, and the Plugin interface?
If so the VST Plugin with Learn option, I have it so you can have multi-control without problem.
Just drop a vst into an empty patch and select the "open with Learn" option.
Was just curious what you were looking to do.
-s
"Every act of creation is first an act of destruction." -Picasso
sephault, I have been working for quite some time on another mapping approach that allows parameters from plugins throughout a workspace to be unified in a single control window. This requires the use of buses to send and receive parameter flows and causes issues, particularly if sending constant value changes, ie: LFO to a plugin. The problem is that the plugin parameters changes needs to be processed all in the same bloc within the loop or the plugin becomes slave to the incoming parameters arrays and is unable to send/receive current values via UI or presets. Because I need to use pass if change and some other tricks to make the parameters loop without constant feedback, the pass if change is always pass when receiving any constant parameters data, which forces the plugin UI into slave only mode.
More discussion about this here:
http://www.sensomusic.org/forums/viewtopic.php?id=5889
p.s. here is a nice little solution to make it easier to locate vst parameters to map to VSTDAD knob. Simply connect like this and change a control on the plugin ui.

As far as general pass if change for array, I can see other interesting opportunities for arrays manipulation that would benefit but that is for the future maybe.. For now the main interest for me is better interfacing options for VST.
More discussion about this here:
http://www.sensomusic.org/forums/viewtopic.php?id=5889
p.s. here is a nice little solution to make it easier to locate vst parameters to map to VSTDAD knob. Simply connect like this and change a control on the plugin ui.
As far as general pass if change for array, I can see other interesting opportunities for arrays manipulation that would benefit but that is for the future maybe.. For now the main interest for me is better interfacing options for VST.
Okay well here is an idea...
Not as clean as just one-wire....but could be automatic...set-and-forget.
I haven't approached it yet...but the last piece I am looking for is a fast-scripted IML.
If I have a scripted IML that can find out the plugin located in the patch, and the starting point params name...Then sequentially wire my script to plugin.
Well skip the array to VST, just put a front end Wire-Wire Interface controlled by Array.
Thinking about your want for the ability to access VST Parameters with a pass-if-change in order to have control...both ways and constant modulation.................
Right now I have the following LFO modulating the Cutoff and I can grab other parameters and modify simultaneously. If this is something you are looking for, I will finish the IML and find a clean solution for integrating with Plugins, or if you have some ideas...let me know. I remember 23fx23 using his IML Global Bus VST controller, maybe figure something similar to package up.
Looking at I am going to have to revisit if 23fx23 ever finished it...I know the IML stuff was turning out cool and quite fast from what I remember.
Get this dynamic adapter idea figured, i'll create a module for it.....or this could be the solution for senso to implement inside the VST module....since all parameters are individually accessible...well a little code and it can be adapted to have this adapter built-in and only have one-array to access. Maybe a mode switch to change the behavior of the array nodes from classic to pass-if-changed.
I see have access to a plugin-wrapper...so maybe I can get dangerous...lol

Not as clean as just one-wire....but could be automatic...set-and-forget.
I haven't approached it yet...but the last piece I am looking for is a fast-scripted IML.
If I have a scripted IML that can find out the plugin located in the patch, and the starting point params name...Then sequentially wire my script to plugin.
Well skip the array to VST, just put a front end Wire-Wire Interface controlled by Array.
Thinking about your want for the ability to access VST Parameters with a pass-if-change in order to have control...both ways and constant modulation.................
Right now I have the following LFO modulating the Cutoff and I can grab other parameters and modify simultaneously. If this is something you are looking for, I will finish the IML and find a clean solution for integrating with Plugins, or if you have some ideas...let me know. I remember 23fx23 using his IML Global Bus VST controller, maybe figure something similar to package up.
Looking at I am going to have to revisit if 23fx23 ever finished it...I know the IML stuff was turning out cool and quite fast from what I remember.
Get this dynamic adapter idea figured, i'll create a module for it.....or this could be the solution for senso to implement inside the VST module....since all parameters are individually accessible...well a little code and it can be adapted to have this adapter built-in and only have one-array to access. Maybe a mode switch to change the behavior of the array nodes from classic to pass-if-changed.
I see have access to a plugin-wrapper...so maybe I can get dangerous...lol
"Every act of creation is first an act of destruction." -Picasso
much can be done with iml, but from what i experienced and undestood talking with senso in the past, iml isn't to be considered as a 'wireless bus replacement', its really adapted for lets's say once set a commatext or few values/captions here or here in a low priority thread, wiring or patch 'scripting' things, but its not ideal for bloc rate/ fast callbacks realtime changing many values like few lfos controling few vsts, or quickly becomes cpu hungry and can lead to instabilities.(did a similar V5 vst automations full iml patch, that kinda worked, but showed those limits, not sure worth reproducing, could be ok witk low rate manual changes, but not for 10 lfos i think).
I also had that idea of 'brute force'^^ wiring all params and script pass if change for individual outs, wich seems the best workable solution indeed curently, but it seems bit heavy to me..., ( but since nearly all ingredients are there, why not push it up^^).
Im quite sure a ('sounds simple*) modification of the vst module code, meaning on array in change, scan and modifiy only the vst values that changed would solve a lot of things we face here with just one array wire to plug, (ideally would also need a way to make ui take over input in case a param is manupulated both on ui and input at the same time, wich might be slighly more complex, but sounds like 'on mouse down on vst, get manipulated id, stop that id from array in and use ui value', relase on mouse up and let pass back input value if it changes again..)
I also had that idea of 'brute force'^^ wiring all params and script pass if change for individual outs, wich seems the best workable solution indeed curently, but it seems bit heavy to me..., ( but since nearly all ingredients are there, why not push it up^^).
Im quite sure a ('sounds simple*) modification of the vst module code, meaning on array in change, scan and modifiy only the vst values that changed would solve a lot of things we face here with just one array wire to plug, (ideally would also need a way to make ui take over input in case a param is manupulated both on ui and input at the same time, wich might be slighly more complex, but sounds like 'on mouse down on vst, get manipulated id, stop that id from array in and use ui value', relase on mouse up and let pass back input value if it changes again..)
I'm fine with a particular value on the plugin being overridden by the input. In the case of incoming parameter value change it doesn't make much sense for the value for that parameter to be set via plugin ui anyways as it is effectively in slave mode. In the case of all values on the plugin being overridden, particularly when there is a latency in the parameters loop and only one incoming value has changed, then this is when tbe parameter arrays become difficult to work with. I have a functional workaround but it would save a lot of patching and resources if the plugin arrays behavior were able to be a little less, ummm... Alalogue?
this does the trick doesn't it ?gurulogic wrote:I would find a module for pass if changed per array element very very useful. Currently, pass if change module only turns the entire flow on or off.
Maybe as a module or perhaps a script guru can make this?
or did I miss something ?
File uploaded: http://www.sensomusic.com/forums/upload ... change.pat
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
thats a cool patch tech too but that got the same problem as the script, man have to manually enter polyphony/array length, reapply, and wire each individual out to each individual in of the vst.
Can solve many things here or here but for big arrays it isn't very efficient virtually having internally 1024 pass if changes wired for ex, and a pain to wire those 1024 outputs, while we could finds hacks with iml auto wiring, solving this on the vst module in this case would be the only user friendly solution im affraid
Can solve many things here or here but for big arrays it isn't very efficient virtually having internally 1024 pass if changes wired for ex, and a pain to wire those 1024 outputs, while we could finds hacks with iml auto wiring, solving this on the vst module in this case would be the only user friendly solution im affraid
Who is online
Users browsing this forum: No registered users and 10 guests
