Welcome to %s forums

BrainModular Users Forum

Login Register

Modifying Senso's Parameter update module--Intermittent success....

I need help on a Patch
Post Reply
woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 22 Apr 2010, 00:44

I have modified senso's VST parameter module to update the value of the controlling slider when the vst changes patches. I uploaded a simple test patch, and it seems to work..... about 30% of the time!!

Params are being controlled just fine by the fader, but the fader value doesn't always update when a new patch is selected.

I had this problem in the context of my larger setup, and thought maybe the IML was being intercepted, but even running only this test patch in an empty workspace, it is intermittent.

http://sensomusic.com/forums/uploaded/P ... Update.zip

Any thoughts?? I expected it to either work or not, but not sure why it sometimes does!

-e
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

Clearscreen
Member
Posts: 482
Location: Australia
Contact:

Unread post by Clearscreen » 22 Apr 2010, 01:47

Thanks for sharing this stuff woodslanding, it sounds great, but I'm getting a "403 - forbidden" when I try to download it?


23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 22 Apr 2010, 08:39

Cool idea.
I think pb is you need a longer time than just a wait one bloc for all params of VST beeing changed, then script should check the values, so here I put a tempo wait of 100 ms using a countMs to test and it seems to work now always correctly

Can tweak the time for a good ratio speed/no data loss, generally 100ms is sure and fast enough, but maybe this depends on VST, usine blocs or others, so a manual adjust is maybe simpler.

(just replace the wait one out of haschd of pgm change by a wait ms, stop led driven to the script.)
Image


(btw olivier I would love to know if there are some "static" time ranges usine uses in iml, or various process, to fit them in adapted cases ie
iml, bitmap/gfx updates ect..) even if feel in this case this depends more on VSt, in some cases could be interesting to know..
..if some are "fixed"...

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 22 Apr 2010, 10:31

ahh... okay, I will try that.

THANKS!
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 22 Apr 2010, 12:05

I just tried this, including 23fx23's suggestion and one problem I am noticing is that when selecting a parameter from the combobox, the fader value is not updating as in the original Senso patch. Insted the current (static) value of the fader is being sent to the new VST parameter each time a parameter is selected.

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 22 Apr 2010, 16:24

i didn't noticed, have to check that..

btw if some are interested, I made a patch that do kind of reverse operation:
"learn" a vst parameter to some usine fader wireless , by moving the pot on vst interface.

http://www.sensomusic.com/forums/upload ... 0param.rar

works cool with values, unfortunately could'nt get captions, seems the iml

GET_STRING_VALUE ITEM i VAR

will always store the caption to some float Var, any trick to make it store to a string variable, then re- assign it using ie

SET_STRING_VALUE ITEM caption VAR ?

works in script, and float values Get-set works with iml but don't catch how to deal with string get-set with IML..
is it possible?

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 22 Apr 2010, 17:44

gurulogic wrote:I just tried this, including 23fx23's suggestion and one problem I am noticing is that when selecting a parameter from the combobox, the fader value is not updating as in the original Senso patch. Insted the current (static) value of the fader is being sent to the new VST parameter each time a parameter is selected.
Hmmm. I thought I left the original functionality of the script intact. I'll see what I can do.

I assume there is no way to actually monitor changes to the VST parameter via IML? so the fader would update its value to the VST value, whether it was via the VST GUI, or via patch change. That would be more elegant.....

Anyway, I will look into it. But I have no clue of IML-- I am just trying to send it out the same IML Olivier did, but a little more often!

-e
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

gurulogic
Member
Posts: 1019
Contact:

Unread post by gurulogic » 22 Apr 2010, 21:33

23fx, I,m having no luck with your patch...:(
I should be able to press start learn, turn a knob on the VST and press stop learn and then have the VST knob update the fader?

Anyways, I am happy to see great minds working on breaking the barrier between VST parameters and wires. Having a fader and a pass if change module on every used VST parameter pin is soooo 2009!

I hope someone can kick me and tell me how easy scripting IML is but at the moment it makes absolutely no sense to me at all !
There is so many cool things I 'could' be doing....

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 23 Apr 2010, 03:33

hey guru, yup normaly press start learn (but 2xtimes)- turn a knob on the Vst- press stop learn(2xtimes)- = the vst knob update the fader and the fader now controls the knob. strange it's working fine here...did you press 2x each?

note i noticed not all Vst param will work, only the 64 first. try first with the Wksp and RMXL, try to move upper left pots.
but unfortunately I didn't found solution for replacing the "pass if chg" out of vst, here it's one side control.

Iml and scripting is "relatively" simple once you got some good simple example and understand delphi basics like string concenation is + a string is in between ' ' ect, once understand all recurents "for i=0 to..." if, const, variables, types ect...
but for non initied like us, man can turn and turn around for hours...
still around 3weeks ago I started my first dive and i would say it's positive, even if yesterday I killed the script i spent one day on it, and made a working patch of what i what after in few minutes.
I think scripts are cool in some cases, but not vital generally, as you often can do a patch equivalent, that won't necessary be higher cpu. It worth a lot when there is N opertations, or some checks to do in N, or i suppose midi messages generating and array manipulations. So long way for us to learn..

so ...when a scripting workshop session with bsork in france :D?

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 23 Apr 2010, 07:44

Okay, here is the corrected script. Now it updates properly when the parameter changes.

Here's my question for anyone who understands IML. I would like to use this to control drawbars on the hammond. This requires inverting the values. I have managed to get the slider and the VST param to agree by changing the appropriate line to this:

S := 'SET_VALUE '+GetStringValue(plugNameIN)+' '''+GetStringValue(paramNameIN)+''' '+FloatTostr(abs(1 - GetValue(paramValIN)));

Works great! Problem is that I'm not getting the inverted values on a patch change. I don't understand how I might alter the value represented by THEPARAMVALUE, as it seems like this value is never actually known to the script!!

Any help appreciated!

Code: Select all

/////////////////////////////////////////////
// Send value to vst param
////////////////////////////////////////////

// parameters declaration
var plugNameIN    : Tparameter;
var paramNameIN    : Tparameter;
var paramValIN    : Tparameter;
var ctlNameIN    : Tparameter;
var prgchIN     : Tparameter;
var s         : String;


// destroy
procedure Destroy;
begin  
end;

// initialisation : create parameters
procedure init;
begin  
 plugNameIN := CreateParam('plug name',ptTextField);
 ctlNameIN := CreateParam('control name', ptTextField);
 paramNameIN := CreateParam('param name',ptTextField);
 paramValIN := CreateParam('param value',ptDataField);
 prgchIN := CreateParam('prog changed',ptDataField);

 SetIsOutPut(plugNameIN,false);
 SetIsOutPut(paramNameIN,false);
 SetIsOutPut(paramValIN,false);
 SetIsOutPut(prgchIN,false);
 SetIsOutPut(ctlNameIN,false);

 
end;


procedure Callback(n:integer);
var i : integer;
begin
 SendUsineMsg('SET_TARGET_PATCH SENDER_PATCH');
 if (n = 1) or (n = 2) or (n = 4) //retreive the old value
 then begin
   S := 'GET_VALUE '+GetStringValue(plugNameIN)+' '''+GetStringValue(paramNameIN)+''' '+'THEPARAMVALUE';
   SendUsineMsg (s);
//   strace(s);
   S := 'SET_VALUE ' + GetStringValue(ctlNameIN) + ' 1 THEPARAMVALUE';
   SendUsineMsg (s);
//   strace(s);

 end
 else begin
   S := 'SET_VALUE '+GetStringValue(plugNameIN)+' '''+GetStringValue(paramNameIN)+''' '+FloatTostr(abs(1 - GetValue(paramValIN)));
   SendUsineMsg (s);
   strace(s);
 end;
 
end;

// no process bloc
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 23 Apr 2010, 11:10

im not an IML expert, but from what ive tested/feel, the Abs(1-x) thing cannot be handled directly with iml.

ie when using GET_VALUE F1 1 PARAMVAL iml goes and pick inlet 1 of F1 and stores it to variable PARAMVAL.
when then using SET_VALUE F2 1 PARAMVAL the variable will set F2, as i does actually. but I never could get something like
SET_VALUE F2 1 (1-PARAMVAL) directly working.

I had similar pbs, so my workaround was that the script should know the variable and prepare the message internally. I would create a new TEMPVALin inlet, the first Mess getting value out of VST, second applying to the Script Inlet.

S := 'GET_VALUE '+GetStringValue(plugNameIN)+' '''+GetStringValue(paramNameIN)+''' '+'THEPARAMVALUE';
SendUsineMsg (s);

S := 'SET_VALUE SCRIPTNAME TEMPVALin THEPARAMVALUE';
SendUsineMsg (s);

///third resending correct value.

S := 'SET_VALUE ' + GetStringValue(ctlNameIN) + ' 1 '+'"'+FloatToStr(abs(1-GetValue(TEMPVaIn)))+'"';
SendUsineMsg (s);

(maybe need to make your windows decimal system being . and not , im not sure)
but if there is a way to direct performs operations to iml variables i would love to be aware of.

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 24 Apr 2010, 01:00

That sounds promising, I will try it.

Very clever workaround!!!
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 24 Apr 2010, 10:08

Hmmm, I do seem to have a decimal problem--

I'm in US, and my computer uses a dot, not a comma.

The tempIN on the script is showing many different values, but when I getValue() from it, it's always a 1 or 0.

But maybe I have another prob in my script. Here it is:

Code: Select all

/////////////////////////////////////////////
// Send value to vst param
////////////////////////////////////////////

// parameters declaration
var plugNameIN    : Tparameter;
var paramNameIN    : Tparameter;
var paramValIN    : Tparameter;
var ctlNameIN    : Tparameter;
var prgchIN     : Tparameter;
var scriptNameIN : Tparameter;
var tempIN    : Tparameter;
var s         : String;


// destroy
procedure Destroy;
begin  
end;

// initialisation : create parameters
procedure init;
begin  
 plugNameIN := CreateParam('plug name',ptTextField);
 ctlNameIN := CreateParam('control name', ptTextField);
 paramNameIN := CreateParam('param name',ptTextField);
 paramValIN := CreateParam('param value',ptDataField);
 prgchIN := CreateParam('prog changed',ptDataField);
 scriptNameIN := CreateParam('script Name',ptTextField);
 tempIN := CreateParam('tempIN',ptDataField);

 SetIsOutPut(plugNameIN,false);
 SetIsOutPut(paramNameIN,false);
 SetIsOutPut(paramValIN,false);
 SetIsOutPut(prgchIN,false);
 SetIsOutPut(ctlNameIN,false);
 SetIsOutPut(scriptNameIN,false);
 SetIsOutPut(tempIN,false);

 
end;


procedure Callback(n:integer);
var i : integer;
var val : double;
var scriptName : String;
begin
 SendUsineMsg('SET_TARGET_PATCH SENDER_PATCH');
 if (n = 1) or (n = 2) or (n = 4) //retreive the old value
 then begin
   S := 'GET_VALUE '+GetStringValue(plugNameIN)+' '''+GetStringValue(paramNameIN)+''' '+'THEPARAMVALUE';
   SendUsineMsg (s);
//   strace(s);
     scriptName := getStringValue(scriptNameIN);
     S := 'SET_VALUE ' + scriptName + ' tempIN  THEPARAMVALUE';
     SendUsineMsg (s);
     val := abs(1 - getValue(TempIN));
     strace('value = ' + floatToStr(val));
     S := 'SET_VALUE ' + GetStringValue(ctlNameIN) + ' 1 ' + '"' + FLoatTostr(val) +'"';
     SendUsineMsg (s);
     strace(s);
//   

 end
 else begin
   S := 'SET_VALUE '+ GetStringValue(plugNameIN) + ' '''+GetStringValue(paramNameIN) + ''' ' + FloatTostr(abs(1 - GetValue(paramValIN)));
   SendUsineMsg (s);
   //strace(s);
 end;
 
end;

// no process bloc
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 24 Apr 2010, 14:06

mmm strange, script looks good... will try to check when got a bit of time, no usine for now :(

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 24 Apr 2010, 19:23

it really seems to be alternating between sending a 1 and a 0.... not all the time--sometimes something seems to interrupt it....

Here's my test patch. Maybe there is something wrong with the patch.

http://sensomusic.com/forums/uploaded/d ... estBed.wkp
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 02 May 2010, 08:08

Okay, I'm back with a clean simple test bed for this problem.

It's all set up to work with usine's included analog delay VST, modifying the cutoff. If I move the drawbar, the cutoff moves appropriately (i.e. inversely)

What I want is to be able to move the cutoff knob in the vst and then press the UPDATE button, and have the drawbar update to display the value. Somehow, it's getting an erroneous value, and then passing that value on to the VST.

I can't for the life of me figure out where this other value is coming from!

any help appreciated.....

http://sensomusic.com/forums/uploaded/d ... stBed2.wkp

cheers,
-e
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 02 May 2010, 13:33

hi woodslanding, ihad a quick look,
i think it's some timing issue..IML is trycky cause it takes non mesurable time to update.
I added a second update in the script, to clearly order events:
first get value from param, set the scriptTMPin, then resend after a quick wait of 100ms wich is enough but needed (time for iml to get/set value), so get quick feedback working. (this is what will happen when you press "update".

Then instead of sending always back value of fader to param (as sentence was "else begin") that could lead to some feedback pb, moded to operate only if valinhaschgd
using n= paramvalin .

seems to work ok here but you might need to increase first timer relating on VST pgmchange timings i didn't test.
edit: tested yup here 100ms more on first timer and pgm are well rerouted (if a has chg out of vst trigger the update).
now think it's the average time for iml to operate when using one value, this musn't depend from VST.

here is the file:
http://sensomusic.com/forums/uploads.ph ... stBed3.wkp

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 02 May 2010, 19:28

Wow, thanks, I will try that out--good thinking about preventing the feedback!
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests