Welcome to %s forums

BrainModular Users Forum

Login Register

pass only changed values in array?

I need help on a Patch
Post Reply
gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 13 Sep 2010, 01:19

Is it possible to have only the values pass that have changed in an array and block all others?
The pass if change module does not seem to accomodate this and with a huge array of 512 it does not make sense to try and separate and process each individule value.

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 13 Sep 2010, 01:52

nope it's not possible dy default at patch level, , but there are workarounds.
what is your specific case, can explain your needed exemple, or is it a more general stuff ya want?
in anycases, array cannot behave like this in red Array wire, but unpacked outputs can.

in fact every datas in usine are arrays. a single value in a wire is a 1 size array when it pass, and 0 when it doesn't.
that would work if arrays were arrays of arrays, which is not the case and because would higly complexify usine pgming i guess.
It should be doable via script wich can recreate same nb of in outs of array and set each size of out relating to if chg or
not, i can have a look if ya want because i sometimes need that feature. (however this will only work
for separate pins out, not the array wire, but i guess that the frequent need?)

one other solution is iml can set some values once wirelessly,
virtually acting has a pass if chgd, so can be a solution depending the case. ie create 20 target faders.

gonna make tries for a script and compare iml, althougth iml is probably not recomended for that.
I thinks it's not possible to make this for wires, but maybe array module could have an option to process
pins out wich such a behavior... have to see that with the boss.. ;)

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 13 Sep 2010, 02:36

I am experimenting with recording VST array output with preset manager snapshots of an array editor. (not that I don't love your Vst Automations patch, but I keep thinking there must be a less complex way with more instant access to parameters)
The rough tests work ok except that when I record a new automation, the old automations are overwritten by the data stored in the array editor. (or something along those lines)
Another work around might be if I could temporarily filter out all but a specific index to edit but is this even possible? I have seen that the max array position module will show the index of the last VST control touched but what after that?
Then again, this approach might be just a waste of time... A proper linear recorder for array values would really make sense here.
take a look if u like. http://www.sensomusic.com/forums/upload ... rd%202.pat

(uploaded new version that only stores preset during operation of VST control)

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 13 Sep 2010, 02:59

i will have a look.

by waiting ive tested the two things i had in mind.
a script in mode 0 will generate outputs and they will reflect pass if chg, or in mode 1 controls modules
via iml, so also like a pass if chg. ie if the fader are named Out_0, out_1 ect.

Code: Select all

////////////////////////////////////////////////////////////////////////////////////////////
// Pass If Chg Array create an array where only values that changed in array in will pass //
////////////////////////////////////////////////////////////////////////////////////////////
const SIZE = 16;          // nb of out wanted.
const Mode = 0;          // mode 0 for Array, Mode 1 for IML
const PREFIX = 'OUT_';   // PEFIX for outputs or IML target Items, folowed by Integer;
const PIN   = '1';        // Target PinIn of Iml destination module.
var ArrayIn: Tparameter;
var OUTPUTS: Array Of Tparameter;
var i,l,count:integer;
var valtmp: single;
var ArrayLast:Array of single;
/////////////////////////////////////
PROCEDURE INIT;
BEGIN
  
 ArrayIn :=CreateParam('ArrayIn',PtArray); SetIsOutput(ArrayIn,False);
setMin(arrayIn,-MAXINT);setMax(ArrayIn,MAXINT);

SetArrayLength(OUTPUTS,SIZE);
   IF mode=0 then begin
   for i:=0 to SIZE -1 do begin
    OUTPUTS[i]:= CreateParam(PREFIX+IntToStr(i),PtDataField); SetIsInput(OUTPUTS[i],false);
    end;
   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;
BEGIN

if count >= -1 then begin
   count:=count+1;
   end;

   if count = 0 then begin
     for i:=0 to l-1 do begin
       if ArrayLast&#91;i&#93;-getDataArrayValue&#40;ArrayIn,i&#41;<>0 then begin
        valtmp&#58;= getDataArrayValue&#40;ArrayIn,i&#41;;
         if mode = 0 then begin
           setLength&#40;OUTPUTS&#91;i&#93;,1&#41;;
           setValue&#40;OUTPUTS&#91;i&#93;,valtmp&#41;;
          end
          else if mode = 1 then begin
            SendInternalMsg&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;
            SendInternalMsg&#40;'SET_VALUE',PREFIX+IntToStr&#40;i&#41;,PIN,floatToStr&#40;valtmp&#41;&#41;;
           end;
       end
      else begin
          if mode = 0 then begin
          setLength&#40;OUTPUTS&#91;i&#93;,0&#41;;
          end;
       end;
      end;
      end;
    if count = 1 then begin
       for i&#58;=0 to L-1 do begin
           ArrayLast&#91;i&#93;&#58;=getdataArrayValue&#40;ArrayIn,i&#41;;
             if mode = 0 then begin
                setLength&#40;OUTPUTS&#91;i&#93;,0&#41;;
             end;
        end;
      count&#58;=-2;
      end;

end;
note should delete any connected out if changing from array to iml and recompile.

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 13 Sep 2010, 03:07

A proper linear recorder for array values would really make sense here.

note if wanna rec all params, can pick the array out of VST, use a setSize of BlockSize, and feed the sampler and rec.
then on output use an extrack array ,size of params size and VST it will replay all parameters.
so can rec upt to 128 simultaneous params at a 3ms precision! sampler isin fact an array recorder.

Another work around might be if I could temporarily filter out all but a specific index to edit but is this even possible?

Check my lastArrayChd in Addon, it output the last changed index and value, you have then to re-set the value of the array
using setArray eltm value.
or the unpack that work for polyphonic with an exeple.
unpack array

(not that I don't love your Vst Automations patch, but I keep thinking there must be a less complex way with more instant access to parameters)

no worries :) but actually can press "learn vst" and assign all the lanes one after the other just by moving knobs, in few seconds for all lanes, then can be saved to preset, how less complex could that be, what system do ya have in mind?

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 13 Sep 2010, 03:43

ive looked at your patch, had not the vst but replaced.
nice idea to use presets but that's really fast preset changes ;)

in any cases with such system is VST don't let us know 'wich pot have we got our hands on", and wouldn't work with midi in.
you can filter wich has changed, but when they are automated no ways to filter wich one your hand is one and
that should not be affected. mean if params array control vst, hand cannot control and vice versa.
i can to conclusion that iml is the only solution to make it possible to edit a param while other are running, ive searched for a while with arrays, it's not possible unless there would be
a mousedwn array, and that wouldn't solve the midiIn problem.so end up with a need of muting automations while taking control,

mmm eureka you might have spoted me a solution: instead of blocking all paramswhile mouse is dwn like in your patch,
could mute it only a short pulse, track index of wich one is chg and let pass only other automs, that should work....

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 13 Sep 2010, 04:09

how less complex could that be, what system do ya have in mind?

No, I don't mean your patch is too complex. It is actually very easy to use and is perfect for certain applications...

...other times though I would like to be able to instantly overide the automation with midi input without having to select which single parameter to control. Ithink it could be easy enough to have the midi input toggle the listbtn to the correct selection with CC# but only one parameter can be overidden at a time.
Also, having visual feedback from the VST on my controller is quite important to me, especially as the parameters are updated when changing presets or loading a patch. This is possible when capturing the array directly from the VST. I would also like an option to reset all automation when changing presets.
Plus I'm addicted to wasting time and trying to figure out wrong ways to do things...:P

I tried to follow your instructions for recording the array in sampler but I am doing something wrong...?

Image

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 13 Sep 2010, 05:43

mmm yep that's it, althouth can use a setsize instead of extract array sorry.
strange normally if rec a bar then connecting array of sampler back to vst , replays. just didit.
but after two hours i try the technique and while it's cool to rec one shot lot of params, then it's the same pb: can't
isolate the only new ones to rec while keeping others previous, arrays overrides themselfs..still can be cool for
one shot stuff.

...other times though I would like to be able to instantly overide the automation with midi input without having to select which single parameter to control
if you disactivate the automs, normally any midiin can control, mean it can be polyphonic?, still have to deselect them however...
yes i see, that works actually like this but only when rec midi mode. Im also after that but i have to decide
myself for a solution.
the pb i meet is unlike fader, cc in don't have msdwn info so while i could easy mute automs so if any
midi in it overides even if not selected , unclear is then how to retrig the automations.
either a full bypass automs mode or something that detect individuals midi change with a smooth delayed time but im not convinced then on how to set the release time, i have to make some tests...

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 13 Sep 2010, 05:53

funny, I didn't see your post before my last one...

Yeah, your right., there's an imminent problem with my "Preset Manager recorder" and that's that all other automations would stop playing when overiding a control... oops!
I wonder how it is done in Cubase etc... Seemed so easy. Press record, start moving stuff and then edit it if desired. That is what I am going for really but I guess it is not really so easy in Usine.

I still have to try your lastArrayChd suggestion... The script you suggested was cool but not so much for transforming back to array if the array size is huge which it can be for some VST's

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 13 Sep 2010, 05:54

again, you beat me to the submit button, lol

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 13 Sep 2010, 05:58

either a full bypass automs mode or something that detect individuals midi change with a smooth delayed time

yes, that's what I thought. midi cc> has changed > smooth for triggering an event flow module

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 13 Sep 2010, 06:46

after loooong testing, don't want to prevent you from never waisted time anyway tests, ;) but im pretty sure what you/i am after:

_is not possible with arrays. cause by nature array elements can't have a size of 0 wich at some point is needed in this case.
_is possible but only via physical wiring to each concerned pins of vst, or IML wireless like i did in my case, so imply scripting.

i will try to implement the features you mention as i also would like them. i was thinking of:
_ a "sel/all" swich to make operations ie reset, roll ect applied only to sel or to all.
_a "pior midi" mode that make a dectected ccin chg overide autom with a release time so that autom plays back
pb is will have to always make tiny chgs or will need a long release time, ideally should also fade between midi in and autom
values. mmm ouch to script(why don't they make real pots with 'mouse down outlet :D)
_ don't have feedback midi device here but i can try to test something, basically ya need that all
CC that are assigned to lanes pick vst assigned params value on a pulse and send them to same midiCC?

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 13 Sep 2010, 07:30

sel/all- good idea!

"pior midi" mode - I haven't thought about this a lot but shouldn't every CC value change be able to reset the decay with a has changed so short or long it shouldn't matter?

don't have feedback midi device here- Should be possible to do midi feedback internally with usine modules with midi yoke etc? Maybe you need a vst utility plug that directly accesses midi ports?
What I would like to see is that when a patch is loaded or mapped parameters change on the VST, the midi mapped values are sent to the controller. Or at very least when one control is touched, the current value immediately updates on the device. This should be possible...I don't think it would all be sent to the same CC though?

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 13 Sep 2010, 08:10

i already half implemented the sel/all. quite cool can swap one or all, roll ect. wonder if i apply that also to loop time,
could be nice. abit more complex by the way..

the wich CC/Autom take over is a bit more complex than it seems but i ll get over it :)

yep i can arrange to check that midi out works.
sorry by same cc i meant same cc that originally assiged one, but for each, so 8CCs to get/set of course.
i was thinking about a buton input that once clic will scan the assigned vst params to get the 8 values.
then when values are received they are send to midiout, would that be ok for ya?
think it's modular, can connect some has chgd out of PGM chg or Init or else..or manual request ALL.
then i would need to reset each autom to each values so they can be swich ed on safely.

so ok cup of cofee, here we go ;)

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 13 Sep 2010, 09:35

These ideas all sound good to me and you have my full support but don't work too hard on my behalf!
I'm still gonna keep my preset manager recorder in mind...might still be able to find another use for it...
...continues banging square peg into round hole :P

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 13 Sep 2010, 09:47

no worries i want them too. already finished the all/sel mode for all types of operations including clocks and activation,
zone selection roll ect...cool. can ie change length of all one shot. Also got the get All params value, now need to emmit midi
and reset automs.
the rest is more tricky than i thought , im stucked in reflexion mode for now..

yea the preset manager is a huge idea!!!, that seems to behave very descently for such fast speed, was impressed.
with not to huge params recall/refresh ratio this can have tons of applications! not sure the best for smooth long automs
but every kind of steped stuff could be recalled nicely that's a really powerfull idea i will explore too!

Post Reply

Who is online

Users browsing this forum: No registered users and 145 guests