ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2020-10-08T10:37:17+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/6605 2020-10-08T10:37:17+02:00 2020-10-08T10:37:17+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42989#p42989 <![CDATA[Re: Script not working in the V4]]>
I thing new syntax is it just for readability and ease of writing. And for new possibilities.
But many improvements were made for speed, script are really faster than ever.

All the best

Sylvain

Statistics: Posted by SylvainT — 08 Oct 2020, 10:37


]]>
2020-10-06T22:12:41+02:00 2020-10-06T22:12:41+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42982#p42982 <![CDATA[Re: Script not working in the V4]]> Statistics: Posted by woodslanding — 06 Oct 2020, 22:12


]]>
2020-10-06T22:03:52+02:00 2020-10-06T22:03:52+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42981#p42981 <![CDATA[Re: Script not working in the V4]]>
cheers!
-eric

Statistics: Posted by woodslanding — 06 Oct 2020, 22:03


]]>
2020-10-05T10:10:50+02:00 2020-10-05T10:10:50+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42979#p42979 <![CDATA[Re: Script not working in the V4]]> Sometimes, from HH3 to HH4, some wires were cabled to the wrong node. Not often. The problem was solved in many cases. Be sure to work with the latest version.

I see you like scripting, there's many many improvements in scripting solutions in latest HH4 updates. Have a look in the manual (https://www.brainmodular.com/manuals/hh4/en/scripting)

All the best

Sylvain

Statistics: Posted by SylvainT — 05 Oct 2020, 10:10


]]>
2020-10-05T05:30:58+02:00 2020-10-05T05:30:58+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42977#p42977 <![CDATA[Re: Script not working in the V4]]> )

It's the script called 'instNameFromIndex'. Under hh3, it cables correctly.
loadInstData.pat

Statistics: Posted by woodslanding — 05 Oct 2020, 05:30


]]>
2020-02-18T17:56:45+02:00 2020-02-18T17:56:45+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42231#p42231 <![CDATA[Re: Script not working in the V4]]>

Statistics: Posted by woodslanding — 18 Feb 2020, 16:56


]]>
2020-02-18T10:40:29+02:00 2020-02-18T10:40:29+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42229#p42229 <![CDATA[Re: Script not working in the V4]]> but maybe you can send us an example, and we try to fix it ?
use support@brainmodular.com

Statistics: Posted by nay-seven — 18 Feb 2020, 09:40


]]>
2020-02-18T10:34:49+02:00 2020-02-18T10:34:49+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42228#p42228 <![CDATA[Re: Script not working in the V4]]>
This is an old bug, (which I thought was dead) but evidently an even older script. I have taken to adding IN and OUT to the names of all ports, because this used to happen so frequently.... but I guess I hadn't yet gotten into the habit when I wrote this one.

Now I have to dig 3 layers down into 15 subpatches to fix them all... :/

Statistics: Posted by woodslanding — 18 Feb 2020, 09:34


]]>
2020-01-15T17:52:51+02:00 2020-01-15T17:52:51+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42097#p42097 <![CDATA[Re: Script not working in the V4]]> Statistics: Posted by nay-seven — 15 Jan 2020, 16:52


]]>
2020-01-15T17:38:08+02:00 2020-01-15T17:38:08+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42096#p42096 <![CDATA[Re: Script not working in the V4]]> Statistics: Posted by woodslanding — 15 Jan 2020, 16:38


]]>
2020-01-13T01:57:49+02:00 2020-01-13T01:57:49+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42069#p42069 <![CDATA[Script not working in the V4]]> ////////////////////////////////////////////

This worked fine in V3, but not in version 4. It's supposed to scan a directory and return an item number and a name in text. The number part is still working, but the text part is broken. Just wondering what might have changed to cause this.

Thanks in advance!
-eric

CODE:

/////////////////////////////////////////////// strip filenames////////////////////////////////////////////// parameters declarationvar idxIN,pathsIN,selIN     : Tparameter;var filenameOUT,displayOUT,idxOUT   : Tparameter;var pathList : TstringList; var count : integer;// initialisation : create parametersprocedure init;var i : integer;begin         SetModuleColor($807080+909960);    pathsIN := CreateParam('full paths ct',ptTextField);        SetIsOutPut(pathsIN,false);       selIN := CreateParam('selection',ptDatafield);                  SetIsOutput(selIN,false);      idxIN := CreateParam('index',ptDatafield);                  SetIsOutput(idxIN,false);    filenameOUT := CreateParam('inst filename',ptTextField);             SetIsInPut(filenameOUT,false);    displayOUT := CreateParam('inst name',ptTextField);             SetIsInPut(displayOUT,false);    idxOUT := CreateParam('index',ptDatafield);                  SetIsInput(idxOUT,false);             pathList.create; end; procedure destroy;  begin pathList.free end;                           //TODO:  do we need to be able to get an index out from a selection in????                           procedure Callback(n:integer);var filename,name : string;var i,id,idx,sel : integer; begin    if (n = pathsIN) then    begin                  pathList.SetCommaText(GetStringValue(pathsIN));          count := pathList.count;    end    else if (n = selIN) then    begin        sel := trunc(getValue(selIN));        filename := SubFileExt(ExtractFileName(pathList.GetStrings(sel)));        name := copy(filename,5,length(filename) - 4);        idx := strToInt(copy(filename,1,3));        setValue(idxOUT, idx);        setStringValue(filenameOUT,filename);        setStringValue(displayOUT, name);    end    else if (n = idxIN) then    begin        id := trunc(getValue(idxIN));         setValue(idxOUT, id);        For i := 0 to count - 1 do         begin                 filename := SubFileExt(ExtractFileName(pathList.GetStrings(i)));            strace('filename = ' + filename);            name := copy(filename,5,length(filename) - 4);            idx := strToInt(copy(filename,1,3));                        if (id = idx) then             begin                setStringValue(filenameOUT,filename);                setStringValue(displayOUT, name);                             end;        end;                                       // strace(GetStringValue(namesOUT));    end;   end;// no process bloc

Statistics: Posted by woodslanding — 13 Jan 2020, 00:57


]]>
BrainModular BrainModular Users Forum 2020-10-08T10:37:17+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/6605 2020-10-08T10:37:17+02:00 2020-10-08T10:37:17+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42989#p42989 <![CDATA[Re: Script not working in the V4]]>
I thing new syntax is it just for readability and ease of writing. And for new possibilities.
But many improvements were made for speed, script are really faster than ever.

All the best

Sylvain

Statistics: Posted by SylvainT — 08 Oct 2020, 10:37


]]>
2020-10-06T22:12:41+02:00 2020-10-06T22:12:41+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42982#p42982 <![CDATA[Re: Script not working in the V4]]> Statistics: Posted by woodslanding — 06 Oct 2020, 22:12


]]>
2020-10-06T22:03:52+02:00 2020-10-06T22:03:52+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42981#p42981 <![CDATA[Re: Script not working in the V4]]>
cheers!
-eric

Statistics: Posted by woodslanding — 06 Oct 2020, 22:03


]]>
2020-10-05T10:10:50+02:00 2020-10-05T10:10:50+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42979#p42979 <![CDATA[Re: Script not working in the V4]]> Sometimes, from HH3 to HH4, some wires were cabled to the wrong node. Not often. The problem was solved in many cases. Be sure to work with the latest version.

I see you like scripting, there's many many improvements in scripting solutions in latest HH4 updates. Have a look in the manual (https://www.brainmodular.com/manuals/hh4/en/scripting)

All the best

Sylvain

Statistics: Posted by SylvainT — 05 Oct 2020, 10:10


]]>
2020-10-05T05:30:58+02:00 2020-10-05T05:30:58+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42977#p42977 <![CDATA[Re: Script not working in the V4]]> )

It's the script called 'instNameFromIndex'. Under hh3, it cables correctly.
loadInstData.pat

Statistics: Posted by woodslanding — 05 Oct 2020, 05:30


]]>
2020-02-18T17:56:45+02:00 2020-02-18T17:56:45+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42231#p42231 <![CDATA[Re: Script not working in the V4]]>

Statistics: Posted by woodslanding — 18 Feb 2020, 16:56


]]>
2020-02-18T10:40:29+02:00 2020-02-18T10:40:29+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42229#p42229 <![CDATA[Re: Script not working in the V4]]> but maybe you can send us an example, and we try to fix it ?
use support@brainmodular.com

Statistics: Posted by nay-seven — 18 Feb 2020, 09:40


]]>
2020-02-18T10:34:49+02:00 2020-02-18T10:34:49+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42228#p42228 <![CDATA[Re: Script not working in the V4]]>
This is an old bug, (which I thought was dead) but evidently an even older script. I have taken to adding IN and OUT to the names of all ports, because this used to happen so frequently.... but I guess I hadn't yet gotten into the habit when I wrote this one.

Now I have to dig 3 layers down into 15 subpatches to fix them all... :/

Statistics: Posted by woodslanding — 18 Feb 2020, 09:34


]]>
2020-01-15T17:52:51+02:00 2020-01-15T17:52:51+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42097#p42097 <![CDATA[Re: Script not working in the V4]]> Statistics: Posted by nay-seven — 15 Jan 2020, 16:52


]]>
2020-01-15T17:38:08+02:00 2020-01-15T17:38:08+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42096#p42096 <![CDATA[Re: Script not working in the V4]]> Statistics: Posted by woodslanding — 15 Jan 2020, 16:38


]]>
2020-01-13T01:57:49+02:00 2020-01-13T01:57:49+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=6605&p=42069#p42069 <![CDATA[Script not working in the V4]]> ////////////////////////////////////////////

This worked fine in V3, but not in version 4. It's supposed to scan a directory and return an item number and a name in text. The number part is still working, but the text part is broken. Just wondering what might have changed to cause this.

Thanks in advance!
-eric

CODE:

/////////////////////////////////////////////// strip filenames////////////////////////////////////////////// parameters declarationvar idxIN,pathsIN,selIN     : Tparameter;var filenameOUT,displayOUT,idxOUT   : Tparameter;var pathList : TstringList; var count : integer;// initialisation : create parametersprocedure init;var i : integer;begin         SetModuleColor($807080+909960);    pathsIN := CreateParam('full paths ct',ptTextField);        SetIsOutPut(pathsIN,false);       selIN := CreateParam('selection',ptDatafield);                  SetIsOutput(selIN,false);      idxIN := CreateParam('index',ptDatafield);                  SetIsOutput(idxIN,false);    filenameOUT := CreateParam('inst filename',ptTextField);             SetIsInPut(filenameOUT,false);    displayOUT := CreateParam('inst name',ptTextField);             SetIsInPut(displayOUT,false);    idxOUT := CreateParam('index',ptDatafield);                  SetIsInput(idxOUT,false);             pathList.create; end; procedure destroy;  begin pathList.free end;                           //TODO:  do we need to be able to get an index out from a selection in????                           procedure Callback(n:integer);var filename,name : string;var i,id,idx,sel : integer; begin    if (n = pathsIN) then    begin                  pathList.SetCommaText(GetStringValue(pathsIN));          count := pathList.count;    end    else if (n = selIN) then    begin        sel := trunc(getValue(selIN));        filename := SubFileExt(ExtractFileName(pathList.GetStrings(sel)));        name := copy(filename,5,length(filename) - 4);        idx := strToInt(copy(filename,1,3));        setValue(idxOUT, idx);        setStringValue(filenameOUT,filename);        setStringValue(displayOUT, name);    end    else if (n = idxIN) then    begin        id := trunc(getValue(idxIN));         setValue(idxOUT, id);        For i := 0 to count - 1 do         begin                 filename := SubFileExt(ExtractFileName(pathList.GetStrings(i)));            strace('filename = ' + filename);            name := copy(filename,5,length(filename) - 4);            idx := strToInt(copy(filename,1,3));                        if (id = idx) then             begin                setStringValue(filenameOUT,filename);                setStringValue(displayOUT, name);                             end;        end;                                       // strace(GetStringValue(namesOUT));    end;   end;// no process bloc

Statistics: Posted by woodslanding — 13 Jan 2020, 00:57


]]>