ArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2014-08-24T23:24:16+02:00 https://brainmodular.com/forums/app.php/feed/topic/4512 2014-08-24T23:24:16+02:00 2014-08-24T23:24:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30337#p30337 <![CDATA[Threading(?) problem with PM256 script]]> Statistics: Posted by seamus — 24 Aug 2014, 23:24


]]>
2014-08-19T19:23:08+02:00 2014-08-19T19:23:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30280#p30280 <![CDATA[Threading(?) problem with PM256 script]]>
This from my log. I separated the logic for storing and recalling from the logic for renaming, and I can get this result consistently. The IML generated by the two scripts is ALWAYS interleaved, with the result that neither script works properly:

process msg SET_TARGET_PATCH SENDER_PATCH
SET_VAR patch TARGET_PATCH_SCRIPT = D:_USINE_library-TwoSystemsKontaktPresets.pat
process msg SET_VALUE P_0 recall 4 1
process msg SET_TARGET_PATCH SENDER_PATCH
SET_VAR patch TARGET_PATCH_SCRIPT = D:_WORKSPACESInstSpecificControls.pat
process msg SET_STRING_VALUE TXT 1 Boesendorfer
Set String Value TXT 1 Boesendorfer
Module P_0 not found in Set_Value ////////////////P_0 is not referenced by this script
Can't Set Value P_0 recall 4 1
process msg SET_VALUE P_0 recall 4 0
Module P_0 not found in Set_Value
Can't Set Value P_0 recall 4 0

I've also encountered the reverse, where the other script says 'module TXT not found in Set_Value'.

Here are the scripts, first the save/recall:

CODE:

// 256 presets Manager______________________23fx 05/06/2k10//     /////////////////////////////////////////////////////////////// Based on guru logic 128 pm manager                      //// name PMs P_X.    //                                     //// updated for HH by E. Moon                               ///////////////////////////////////////////////////////////////    Const PM_Prefix = 'P_';Const PM_SIZE = 32;////////////////////////////////////////////////////////var rNumIN,sNumIN,store,msDownIN &#58; Tparameter;var Pm_store_name, Pm_store_num, Pm_recall_name,Pm_recall_num&#58; string;var numToStore,bankToStore, numToRecall,bankToRecall&#58; integer;var MSD&#58; boolean;///////////////////////////////////////////////////////////////////////Procedure Init;BEGIN       rNumIN  &#58;= CreateParam&#40;'recall num',PtDataField&#41;  ;setIsOutput&#40;rNumIN,false&#41;;       sNumIN  &#58;= CreateParam&#40;'store num',PtDataField&#41;  ;setIsOutput&#40;sNumIN,false&#41;;    msDownIN&#58;= CreateParam&#40;'list msDown',PtDataField&#41;;setIsOutput&#40;msDownIN,false&#41;;    store&#58;= CreateParam&#40;'store',PtDataField&#41;;setIsOutput&#40;store,false&#41;;                                                                                           MSD&#58;=false;END;///////////////////////////////////////////////////////////////////////////////////////////////////////////Procedure callBack&#40;n &#58; integer&#41;;BEGIN        if &#40;n=msDownIN&#41; then begin            MSD&#58;=getvalue&#40;msDownIN&#41;=1;        end;                         if &#40;n=sNumIN&#41; then begin             numToStore&#58;= trunc&#40;getvalue&#40;sNumIN&#41;&#41;;              Pm_store_name&#58;= PM_Prefix + intToStr&#40;numToStore div PM_SIZE&#41;;                                    Pm_store_num &#58;= intToStr&#40;numToStore mod PM_SIZE&#41;;        end;        if &#40;n=rNumIN&#41; then begin             numToRecall&#58;= trunc&#40;getvalue&#40;rNumIN&#41;&#41;;              Pm_recall_name&#58;= PM_Prefix + intToStr&#40;numToRecall div PM_SIZE&#41;;                                    Pm_recall_num &#58;= intToStr&#40;numToRecall mod PM_SIZE&#41;;        end;                            if &#40;n=msDownIN&#41; and &#40;getValue&#40;Store&#41; = 1&#41; and &#40;msd&#41; then begin             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_store_name,'store','1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_store_name,'store','0'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_store_name,'num',Pm_store_num&#41;;            SendInternalMsg4&#40;'SET_VALUE','STORE','1','0'&#41;;                        end;                if &#40;&#40;n=rNumIN&#41;&#41;  and &#40;getValue&#40;store&#41;=0&#41;            then begin            SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_recall_name,'recall '+Pm_recall_num,'1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_recall_name,'recall '+Pm_recall_num,'0'&#41;;           end;END;//////////////////////////////////////////////////////////
and the set text script:

CODE:

// 256 presets Manager______________________23fx 05/06/2k10//     /////////////////////////////////////////////////////////////// Based on guru logic 128 pm manager                      //// name PMs P_X.    //                                     //// updated for HH by E. Moon                               ///////////////////////////////////////////////////////////////    Const PM_Prefix = 'P_';Const PM_SIZE = 32;////////////////////////////////////////////////////////var num &#58; Tparameter;var pmnum,bankNum&#58; integer;var MSD&#58; boolean;var commain, clickIN, txtin&#58; tparameter;var SL1&#58; tstringlist;var editing &#58; boolean;///////////////////////////////////////////////////////////////////////Procedure Init;BEGIN                                                                                                          num  &#58;= CreateParam&#40;'list num',PtDataField&#41;  ;setIsOutput&#40;num,false&#41;;        commain&#58;= createparam&#40;'commain',pttextfield&#41;; setisoutput&#40;commain,false&#41;;     txtin&#58;= createparam&#40;'txtin',pttextfield&#41;;setisoutput&#40;txtin,false&#41;;     clickIN&#58;= createparam&#40;'txtfield clk',ptdatafield&#41;; setisoutput&#40;clickIN,false&#41;;     SL1.create;                                 editing&#58;= FALSE; END;/////////////////////////////////////////                      Procedure destroy;begin SL1.free end;//////////////////////////////////////////////////////////////////Procedure callBack&#40;n &#58; integer&#41;;BEGIN                                                                   if &#40;n=clickIN&#41;and &#40;getvalue&#40;clickIN&#41;=1&#41; then begin            // user is editing            editing&#58;=TRUE;        end;        if &#40;n=commain&#41; then begin                      SL1.setCommatext&#40;getstringvalue&#40;commain&#41;&#41;;             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;              SendInternalMsg4&#40;'SET_STRING_VALUE','LIST','comma text',SL1.getCommatext&#41;;        end;        if &#40;n=txtin&#41; AND &#40;editing&#41; then begin                     strace&#40;'_____________________________________________setting text_____________________'&#41;;             SL1.setStrings&#40;trunc&#40;getvalue&#40;num&#41;&#41;,getstringvalue&#40;txtin&#41;&#41;;             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;              SendInternalMsg4&#40;'SET_STRING_VALUE','LIST','comma text',SL1.getCommatext&#41;;            editing&#58;= FALSE;         end;                         if &#40;n=num&#41; then begin                  SL1.setCommatext&#40;getstringvalue&#40;commain&#41;&#41;;                                                       pmnum&#58;= trunc&#40;getvalue&#40;num&#41;&#41;;              SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;                  SendInternalMsg4&#40;'SET_STRING_VALUE','TXT','1',SL1.getstrings&#40;pmnum&#41;&#41;;        end;END;//////////////////////////////////////////////////////////
Interestingly, both scripts are updated via busses from the same source, the master preset select matrix, but are in different racks. For now, my workaround is to put a wait1 before the text script, and that keeps the IML from getting co-mingled.

It seems like maybe an 'end of IML' message of some sort is needed? My workspace is very complex, and I haven't been able to duplicate this problem in a simple WKP, but now it is happening consistenly. I will post this as a bug report, although my WKP is too large to upload.

cheers,
-e

Statistics: Posted by woodslanding — 19 Aug 2014, 19:23


]]>
2014-08-19T16:27:12+02:00 2014-08-19T16:27:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30277#p30277 <![CDATA[Threading(?) problem with PM256 script]]>

I've definitely determined it is a loading, not a saving problem. So I just need to make sure all the lists have correct data before saving a new version of the WKP. And if a WKP gets saved with wrong lists, I can copy and paste from an older version. A couple of times I've had to load my WKP three times to get all correct lists, which is a pain on a gig!

I've been doing some rearchitecting with a stripped down version of the WKP, containing only 6 of these scripts, and it hasn't mis-loaded once. But when I went from 13 of these to 14 in my WKP, it about doubled the likelyhood of mis-loading!!

P.S. I don't think anybody took a vacation last year, so I'm glad to see folks taking a break :)

Statistics: Posted by woodslanding — 19 Aug 2014, 16:27


]]>
2014-08-19T11:48:51+02:00 2014-08-19T11:48:51+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30269#p30269 <![CDATA[Threading(?) problem with PM256 script]]> Statistics: Posted by nay-seven — 19 Aug 2014, 11:48


]]>
2014-08-15T07:00:41+02:00 2014-08-15T07:00:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30227#p30227 <![CDATA[Threading(?) problem with PM256 script]]>
I have about a dozen of these scripts in my WKP, and when I first open the WKP, about 5-10% of the time one of these scripts will fail in a particular way.

Specifically, the lines:

SendInternalMsg2('SET_TARGET_PATCH','SENDER_PATCH');
SendInternalMsg4('SET_STRING_VALUE','LIST','comma text',SL1.getCommatext);

Cause commaText from one script to be inserted into different instance in another patch in another rack in the WKP. (There is no rack that contains 2 of these scripts.)

Any thoughts of what might be going on? Maybe it's an IML bug, but maybe I'm making a stupid (or advanced!) mistake in my script.

I can post the patch that contains it, but I can't see how the wiring would affect this. And it has been a problem with this script since V5.

Thoughts, script gurus??? Is there a way to keep this part of the script from running at startup? Hmmm. Or keep the whole script from running at startup??? I guess I could use on init, and a timer, but that seems particularly kludgey ;)

Thanks!!
-e

CODE:

// 256 presets Manager______________________23fx 05/06/2k10//     /////////////////////////////////////////////////////////////// Based on guru logic 128 pm manager                      //// name PMs P_X.    //                                     //// updated for HH by E. Moon                               ///////////////////////////////////////////////////////////////    Const PM_Prefix = 'P_';Const PM_SIZE = 32;////////////////////////////////////////////////////////var num,bankIN,store,clear,Msdwn &#58; Tparameter;var Pm_name, Pm_num &#58; string;var pmnum,bankNum&#58; integer;var MSD&#58; boolean;var commain, clickIN, txtin&#58; tparameter;var SL1&#58; tstringlist;var editing &#58; boolean;///////////////////////////////////////////////////////////////////////Procedure Init;BEGIN       num  &#58;= CreateParam&#40;'list num',PtDataField&#41;  ;setIsOutput&#40;num,false&#41;;        commain&#58;= createparam&#40;'commain',pttextfield&#41;; setisoutput&#40;commain,false&#41;;     Msdwn&#58;= CreateParam&#40;'list msdwn',PtDataField&#41;;setIsOutput&#40;msdwn,false&#41;;    store&#58;= CreateParam&#40;'store',PtDataField&#41;;setIsOutput&#40;store,false&#41;;    clear&#58;= CreateParam&#40;'clear',PtDataField&#41;;setIsOutput&#40;clear,false&#41;;    txtin&#58;= createparam&#40;'txtin',pttextfield&#41;;setisoutput&#40;txtin,false&#41;;     clickIN&#58;= createparam&#40;'txtfield clk',ptdatafield&#41;; setisoutput&#40;clickIN,false&#41;;     SL1.create;                                 editing&#58;= FALSE; MSD&#58;=false;END;/////////////////////////////////////////Procedure destroy;begin SL1.free end;//////////////////////////////////////////////////////////////////Procedure callBack&#40;n &#58; integer&#41;;BEGIN                                                                   if &#40;n=clickIN&#41;and &#40;getvalue&#40;clickIN&#41;=1&#41; then begin            // user is editing            editing&#58;=TRUE;        end;        if &#40;n=commain&#41; then begin                      SL1.setCommatext&#40;getstringvalue&#40;commain&#41;&#41;;             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;              SendInternalMsg4&#40;'SET_STRING_VALUE','LIST','comma text',SL1.getCommatext&#41;;        end;        if &#40;n=txtin&#41; AND &#40;editing&#41; then begin            SL1.setStrings&#40;trunc&#40;getvalue&#40;num&#41;&#41;,getstringvalue&#40;txtin&#41;&#41;;             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;              SendInternalMsg4&#40;'SET_STRING_VALUE','LIST','comma text',SL1.getCommatext&#41;;            editing&#58;= FALSE;         end;        if &#40;n=msdwn&#41; then begin            MSD&#58;=getvalue&#40;msdwn&#41;=1;        end;                                                               if &#40;n=num&#41; then begin             SL1.setCommatext&#40;getstringvalue&#40;commain&#41;&#41;;             pmnum&#58;= trunc&#40;getvalue&#40;num&#41;&#41;;              SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;                  SendInternalMsg4&#40;'SET_STRING_VALUE','TXT','1',SL1.getstrings&#40;pmnum&#41;&#41;;             Pm_name&#58;= PM_Prefix+ intToStr&#40;pmnum div PM_SIZE&#41;;                                    Pm_num &#58;= intToStr&#40;pmnum mod PM_SIZE&#41;;        end;                            if &#40;n=msdwn&#41; and &#40;getValue&#40;Store&#41; = 1&#41; and &#40;msd&#41; then begin             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_name,'store','1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'store','0'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'num',pm_num&#41;;            SendInternalMsg4&#40;'SET_VALUE','STORE','1','0'&#41;;                        end;        if &#40;n=msdwn&#41; and &#40;getValue&#40;Clear&#41; = 1&#41; and &#40;msd&#41; then begin            SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_name,'clear','1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'clear','0'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'num',pm_num&#41;;            SendInternalMsg4&#40;'SET_VALUE','CLEAR','1','0'&#41;;                 end;                if &#40;&#40;n=num&#41;&#41;              and &#40;&#40;getValue&#40;store&#41;=0&#41; and &#40;getValue&#40;Clear&#41;=0&#41;&#41;            then begin            SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_name,'recall '+pm_num,'1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'recall '+pm_num,'0'&#41;;           end;END;//////////////////////////////////////////////////////////

Statistics: Posted by woodslanding — 15 Aug 2014, 07:00


]]>
BrainModular BrainModular Users Forum 2014-08-24T23:24:16+02:00 https://brainmodular.com/forums/app.php/feed/topic/4512 2014-08-24T23:24:16+02:00 2014-08-24T23:24:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30337#p30337 <![CDATA[Threading(?) problem with PM256 script]]> Statistics: Posted by seamus — 24 Aug 2014, 23:24


]]>
2014-08-19T19:23:08+02:00 2014-08-19T19:23:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30280#p30280 <![CDATA[Threading(?) problem with PM256 script]]>
This from my log. I separated the logic for storing and recalling from the logic for renaming, and I can get this result consistently. The IML generated by the two scripts is ALWAYS interleaved, with the result that neither script works properly:

process msg SET_TARGET_PATCH SENDER_PATCH
SET_VAR patch TARGET_PATCH_SCRIPT = D:_USINE_library-TwoSystemsKontaktPresets.pat
process msg SET_VALUE P_0 recall 4 1
process msg SET_TARGET_PATCH SENDER_PATCH
SET_VAR patch TARGET_PATCH_SCRIPT = D:_WORKSPACESInstSpecificControls.pat
process msg SET_STRING_VALUE TXT 1 Boesendorfer
Set String Value TXT 1 Boesendorfer
Module P_0 not found in Set_Value ////////////////P_0 is not referenced by this script
Can't Set Value P_0 recall 4 1
process msg SET_VALUE P_0 recall 4 0
Module P_0 not found in Set_Value
Can't Set Value P_0 recall 4 0

I've also encountered the reverse, where the other script says 'module TXT not found in Set_Value'.

Here are the scripts, first the save/recall:

CODE:

// 256 presets Manager______________________23fx 05/06/2k10//     /////////////////////////////////////////////////////////////// Based on guru logic 128 pm manager                      //// name PMs P_X.    //                                     //// updated for HH by E. Moon                               ///////////////////////////////////////////////////////////////    Const PM_Prefix = 'P_';Const PM_SIZE = 32;////////////////////////////////////////////////////////var rNumIN,sNumIN,store,msDownIN &#58; Tparameter;var Pm_store_name, Pm_store_num, Pm_recall_name,Pm_recall_num&#58; string;var numToStore,bankToStore, numToRecall,bankToRecall&#58; integer;var MSD&#58; boolean;///////////////////////////////////////////////////////////////////////Procedure Init;BEGIN       rNumIN  &#58;= CreateParam&#40;'recall num',PtDataField&#41;  ;setIsOutput&#40;rNumIN,false&#41;;       sNumIN  &#58;= CreateParam&#40;'store num',PtDataField&#41;  ;setIsOutput&#40;sNumIN,false&#41;;    msDownIN&#58;= CreateParam&#40;'list msDown',PtDataField&#41;;setIsOutput&#40;msDownIN,false&#41;;    store&#58;= CreateParam&#40;'store',PtDataField&#41;;setIsOutput&#40;store,false&#41;;                                                                                           MSD&#58;=false;END;///////////////////////////////////////////////////////////////////////////////////////////////////////////Procedure callBack&#40;n &#58; integer&#41;;BEGIN        if &#40;n=msDownIN&#41; then begin            MSD&#58;=getvalue&#40;msDownIN&#41;=1;        end;                         if &#40;n=sNumIN&#41; then begin             numToStore&#58;= trunc&#40;getvalue&#40;sNumIN&#41;&#41;;              Pm_store_name&#58;= PM_Prefix + intToStr&#40;numToStore div PM_SIZE&#41;;                                    Pm_store_num &#58;= intToStr&#40;numToStore mod PM_SIZE&#41;;        end;        if &#40;n=rNumIN&#41; then begin             numToRecall&#58;= trunc&#40;getvalue&#40;rNumIN&#41;&#41;;              Pm_recall_name&#58;= PM_Prefix + intToStr&#40;numToRecall div PM_SIZE&#41;;                                    Pm_recall_num &#58;= intToStr&#40;numToRecall mod PM_SIZE&#41;;        end;                            if &#40;n=msDownIN&#41; and &#40;getValue&#40;Store&#41; = 1&#41; and &#40;msd&#41; then begin             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_store_name,'store','1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_store_name,'store','0'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_store_name,'num',Pm_store_num&#41;;            SendInternalMsg4&#40;'SET_VALUE','STORE','1','0'&#41;;                        end;                if &#40;&#40;n=rNumIN&#41;&#41;  and &#40;getValue&#40;store&#41;=0&#41;            then begin            SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_recall_name,'recall '+Pm_recall_num,'1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_recall_name,'recall '+Pm_recall_num,'0'&#41;;           end;END;//////////////////////////////////////////////////////////
and the set text script:

CODE:

// 256 presets Manager______________________23fx 05/06/2k10//     /////////////////////////////////////////////////////////////// Based on guru logic 128 pm manager                      //// name PMs P_X.    //                                     //// updated for HH by E. Moon                               ///////////////////////////////////////////////////////////////    Const PM_Prefix = 'P_';Const PM_SIZE = 32;////////////////////////////////////////////////////////var num &#58; Tparameter;var pmnum,bankNum&#58; integer;var MSD&#58; boolean;var commain, clickIN, txtin&#58; tparameter;var SL1&#58; tstringlist;var editing &#58; boolean;///////////////////////////////////////////////////////////////////////Procedure Init;BEGIN                                                                                                          num  &#58;= CreateParam&#40;'list num',PtDataField&#41;  ;setIsOutput&#40;num,false&#41;;        commain&#58;= createparam&#40;'commain',pttextfield&#41;; setisoutput&#40;commain,false&#41;;     txtin&#58;= createparam&#40;'txtin',pttextfield&#41;;setisoutput&#40;txtin,false&#41;;     clickIN&#58;= createparam&#40;'txtfield clk',ptdatafield&#41;; setisoutput&#40;clickIN,false&#41;;     SL1.create;                                 editing&#58;= FALSE; END;/////////////////////////////////////////                      Procedure destroy;begin SL1.free end;//////////////////////////////////////////////////////////////////Procedure callBack&#40;n &#58; integer&#41;;BEGIN                                                                   if &#40;n=clickIN&#41;and &#40;getvalue&#40;clickIN&#41;=1&#41; then begin            // user is editing            editing&#58;=TRUE;        end;        if &#40;n=commain&#41; then begin                      SL1.setCommatext&#40;getstringvalue&#40;commain&#41;&#41;;             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;              SendInternalMsg4&#40;'SET_STRING_VALUE','LIST','comma text',SL1.getCommatext&#41;;        end;        if &#40;n=txtin&#41; AND &#40;editing&#41; then begin                     strace&#40;'_____________________________________________setting text_____________________'&#41;;             SL1.setStrings&#40;trunc&#40;getvalue&#40;num&#41;&#41;,getstringvalue&#40;txtin&#41;&#41;;             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;              SendInternalMsg4&#40;'SET_STRING_VALUE','LIST','comma text',SL1.getCommatext&#41;;            editing&#58;= FALSE;         end;                         if &#40;n=num&#41; then begin                  SL1.setCommatext&#40;getstringvalue&#40;commain&#41;&#41;;                                                       pmnum&#58;= trunc&#40;getvalue&#40;num&#41;&#41;;              SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;                  SendInternalMsg4&#40;'SET_STRING_VALUE','TXT','1',SL1.getstrings&#40;pmnum&#41;&#41;;        end;END;//////////////////////////////////////////////////////////
Interestingly, both scripts are updated via busses from the same source, the master preset select matrix, but are in different racks. For now, my workaround is to put a wait1 before the text script, and that keeps the IML from getting co-mingled.

It seems like maybe an 'end of IML' message of some sort is needed? My workspace is very complex, and I haven't been able to duplicate this problem in a simple WKP, but now it is happening consistenly. I will post this as a bug report, although my WKP is too large to upload.

cheers,
-e

Statistics: Posted by woodslanding — 19 Aug 2014, 19:23


]]>
2014-08-19T16:27:12+02:00 2014-08-19T16:27:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30277#p30277 <![CDATA[Threading(?) problem with PM256 script]]>

I've definitely determined it is a loading, not a saving problem. So I just need to make sure all the lists have correct data before saving a new version of the WKP. And if a WKP gets saved with wrong lists, I can copy and paste from an older version. A couple of times I've had to load my WKP three times to get all correct lists, which is a pain on a gig!

I've been doing some rearchitecting with a stripped down version of the WKP, containing only 6 of these scripts, and it hasn't mis-loaded once. But when I went from 13 of these to 14 in my WKP, it about doubled the likelyhood of mis-loading!!

P.S. I don't think anybody took a vacation last year, so I'm glad to see folks taking a break :)

Statistics: Posted by woodslanding — 19 Aug 2014, 16:27


]]>
2014-08-19T11:48:51+02:00 2014-08-19T11:48:51+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30269#p30269 <![CDATA[Threading(?) problem with PM256 script]]> Statistics: Posted by nay-seven — 19 Aug 2014, 11:48


]]>
2014-08-15T07:00:41+02:00 2014-08-15T07:00:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=4512&p=30227#p30227 <![CDATA[Threading(?) problem with PM256 script]]>
I have about a dozen of these scripts in my WKP, and when I first open the WKP, about 5-10% of the time one of these scripts will fail in a particular way.

Specifically, the lines:

SendInternalMsg2('SET_TARGET_PATCH','SENDER_PATCH');
SendInternalMsg4('SET_STRING_VALUE','LIST','comma text',SL1.getCommatext);

Cause commaText from one script to be inserted into different instance in another patch in another rack in the WKP. (There is no rack that contains 2 of these scripts.)

Any thoughts of what might be going on? Maybe it's an IML bug, but maybe I'm making a stupid (or advanced!) mistake in my script.

I can post the patch that contains it, but I can't see how the wiring would affect this. And it has been a problem with this script since V5.

Thoughts, script gurus??? Is there a way to keep this part of the script from running at startup? Hmmm. Or keep the whole script from running at startup??? I guess I could use on init, and a timer, but that seems particularly kludgey ;)

Thanks!!
-e

CODE:

// 256 presets Manager______________________23fx 05/06/2k10//     /////////////////////////////////////////////////////////////// Based on guru logic 128 pm manager                      //// name PMs P_X.    //                                     //// updated for HH by E. Moon                               ///////////////////////////////////////////////////////////////    Const PM_Prefix = 'P_';Const PM_SIZE = 32;////////////////////////////////////////////////////////var num,bankIN,store,clear,Msdwn &#58; Tparameter;var Pm_name, Pm_num &#58; string;var pmnum,bankNum&#58; integer;var MSD&#58; boolean;var commain, clickIN, txtin&#58; tparameter;var SL1&#58; tstringlist;var editing &#58; boolean;///////////////////////////////////////////////////////////////////////Procedure Init;BEGIN       num  &#58;= CreateParam&#40;'list num',PtDataField&#41;  ;setIsOutput&#40;num,false&#41;;        commain&#58;= createparam&#40;'commain',pttextfield&#41;; setisoutput&#40;commain,false&#41;;     Msdwn&#58;= CreateParam&#40;'list msdwn',PtDataField&#41;;setIsOutput&#40;msdwn,false&#41;;    store&#58;= CreateParam&#40;'store',PtDataField&#41;;setIsOutput&#40;store,false&#41;;    clear&#58;= CreateParam&#40;'clear',PtDataField&#41;;setIsOutput&#40;clear,false&#41;;    txtin&#58;= createparam&#40;'txtin',pttextfield&#41;;setisoutput&#40;txtin,false&#41;;     clickIN&#58;= createparam&#40;'txtfield clk',ptdatafield&#41;; setisoutput&#40;clickIN,false&#41;;     SL1.create;                                 editing&#58;= FALSE; MSD&#58;=false;END;/////////////////////////////////////////Procedure destroy;begin SL1.free end;//////////////////////////////////////////////////////////////////Procedure callBack&#40;n &#58; integer&#41;;BEGIN                                                                   if &#40;n=clickIN&#41;and &#40;getvalue&#40;clickIN&#41;=1&#41; then begin            // user is editing            editing&#58;=TRUE;        end;        if &#40;n=commain&#41; then begin                      SL1.setCommatext&#40;getstringvalue&#40;commain&#41;&#41;;             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;              SendInternalMsg4&#40;'SET_STRING_VALUE','LIST','comma text',SL1.getCommatext&#41;;        end;        if &#40;n=txtin&#41; AND &#40;editing&#41; then begin            SL1.setStrings&#40;trunc&#40;getvalue&#40;num&#41;&#41;,getstringvalue&#40;txtin&#41;&#41;;             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;              SendInternalMsg4&#40;'SET_STRING_VALUE','LIST','comma text',SL1.getCommatext&#41;;            editing&#58;= FALSE;         end;        if &#40;n=msdwn&#41; then begin            MSD&#58;=getvalue&#40;msdwn&#41;=1;        end;                                                               if &#40;n=num&#41; then begin             SL1.setCommatext&#40;getstringvalue&#40;commain&#41;&#41;;             pmnum&#58;= trunc&#40;getvalue&#40;num&#41;&#41;;              SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;                  SendInternalMsg4&#40;'SET_STRING_VALUE','TXT','1',SL1.getstrings&#40;pmnum&#41;&#41;;             Pm_name&#58;= PM_Prefix+ intToStr&#40;pmnum div PM_SIZE&#41;;                                    Pm_num &#58;= intToStr&#40;pmnum mod PM_SIZE&#41;;        end;                            if &#40;n=msdwn&#41; and &#40;getValue&#40;Store&#41; = 1&#41; and &#40;msd&#41; then begin             SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_name,'store','1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'store','0'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'num',pm_num&#41;;            SendInternalMsg4&#40;'SET_VALUE','STORE','1','0'&#41;;                        end;        if &#40;n=msdwn&#41; and &#40;getValue&#40;Clear&#41; = 1&#41; and &#40;msd&#41; then begin            SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_name,'clear','1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'clear','0'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'num',pm_num&#41;;            SendInternalMsg4&#40;'SET_VALUE','CLEAR','1','0'&#41;;                 end;                if &#40;&#40;n=num&#41;&#41;              and &#40;&#40;getValue&#40;store&#41;=0&#41; and &#40;getValue&#40;Clear&#41;=0&#41;&#41;            then begin            SendInternalMsg2&#40;'SET_TARGET_PATCH','SENDER_PATCH'&#41;;             SendInternalMsg4&#40;'SET_VALUE',Pm_name,'recall '+pm_num,'1'&#41;;           SendInternalMsg4&#40;'SET_VALUE',Pm_name,'recall '+pm_num,'0'&#41;;           end;END;//////////////////////////////////////////////////////////

Statistics: Posted by woodslanding — 15 Aug 2014, 07:00


]]>