ArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2012-03-03T13:26:10+02:00 https://brainmodular.com/forums/app.php/feed/topic/2961 2012-03-03T13:26:10+02:00 2012-03-03T13:26:10+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=22703#p22703 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]>
I'll try this,
the callback procedure must be called twice (first to send 1, and next block to send 0) so I might connect the "button" output of the script to an input of the script that would inevitably cause the callback procedure to be called next block..

I'll report soon !

Statistics: Posted by oxyredox — 03 Mar 2012, 12:26


]]>
2011-11-14T10:59:04+02:00 2011-11-14T10:59:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=21837#p21837 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]>
It can work that way with the callback procedure,

Cheers


// parameters declaration

Var InA :tParameter;
Var OutA : tParameter;


// initialisation : create parameters
procedure init;

begin
InA := Createparam('Go', ptdatafield);
SetIsOutput(InA, False);
OutA := Createparam('Resultat', PtButton);
SetIsInput(OutA, False);
end;

// Callback procedure

Procedure Callback(N:integer);

begin
If getvalue(InA)=1 then SetValue (OutA,1) else SetValue (OutA,0);
End;

Statistics: Posted by Ken29 — 14 Nov 2011, 09:59


]]>
2011-11-12T13:08:02+02:00 2011-11-12T13:08:02+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=21823#p21823 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> Statistics: Posted by oxyredox — 12 Nov 2011, 12:08


]]>
2011-07-12T00:50:26+02:00 2011-07-12T00:50:26+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=19929#p19929 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> Statistics: Posted by 23fx23 — 12 Jul 2011, 00:50


]]>
2011-07-11T19:38:06+02:00 2011-07-11T19:38:06+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=19928#p19928 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> what I need to do is to send a button message out the script

thanks anyway !

Statistics: Posted by oxyredox — 11 Jul 2011, 19:38


]]>
2011-07-10T20:54:25+02:00 2011-07-10T20:54:25+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=19923#p19923 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> I'm really a newbie in script world but maybe (and waiting for a script guru in this Sunday evening)
you can find some inspiration in this Bsork script :


CODE:

///////////////////////////////////////////////////////////////Bloc counter with Max Value and refresh speed///////////////////////////////////////////////////////////// If start pulse will count incremental till max value is reached// increment is timespaced of nb_blocs input.////////////////////////////////////////////////////////VAR start, counter, maxVal,counting,NB_blocs &#58; tParameter;VAR count &#58; Integer;///////////////////////////////////////////////////PROCEDURE Init;BEGIN   start &#58;= CreateParam&#40;'start', ptButton&#41;;   SetIsOutput&#40;start, FALSE&#41;;   maxVal &#58;= CreateParam&#40;'max', ptDataField&#41;;   SetIsOutput&#40;maxVal, FALSE&#41;;setValue&#40;maxVal,16&#41;;   NB_blocs &#58;= CreateParam&#40;'nb_blocs', ptDataField&#41;;   SetIsOutput&#40;NB_blocs, FALSE&#41;; setValue&#40;Nb_Blocs,100&#41;;   counter &#58;= CreateParam&#40;'counter', ptDataField&#41;;   SetIsInput&#40;counter, FALSE&#41;;   counting &#58;= CreateParam&#40;'counting', ptDataField&#41;;   SetIsInput&#40;counting, FALSE&#41;;END;//PROCEDURE Callback&#40;n &#58; Integer&#41;;var maxvaltmp &#58; integer;PROCEDURE Process;BEGIN   IF &#40;GetValue&#40;start&#41; = 1&#41; THEN BEGIN                          //if start pulse of button we start the process      setvalue&#40;start,0&#41;;      maxValtmp&#58;= round&#40;getValue&#40;maxVal&#41;*getValue&#40;NB_blocs&#41;&#41;;   // we get the maxvalue to count to. we muliply by nb_blocs for the speed.                                                            //we reset count to 0       count &#58;= 0;      SetValue&#40;counting,1&#41;;                                     //we start counting so set the parameter to 1.      END      ELSE BEGIN                                                //as soon as the button went back to 0 will count.          count &#58;= count + 1;      END;    while count > maxValtmp                                // if count reached maxvalue, it keeps that value          do begin                                         // and set counting parameter to 0.          count &#58;= maxValtmp;          SetValue&#40;counting,0&#41;;      END;   SetValue&#40;counter, count div round&#40;getValue&#40;NB_blocs&#41;&#41;&#41;;        //we set the value to counter output. &#40;we divide by nb_blocs as previously multiplied the max                                                                  // to get a control over refresh speed. At 1 bloc, it's the fastest possible clock in usine                                                                  // that will increment each bloc &#40;3ms at 128samples&#41; and ensure a strong jiter free                                                                   // sync over time counters.                                                                  // it can be used to set some arrayvalue, dispatchers, ask osc datas ect...END;

Statistics: Posted by nay-seven — 10 Jul 2011, 20:54


]]>
2011-07-10T20:05:38+02:00 2011-07-10T20:05:38+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=19921#p19921 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> I need my script to send a button message ( 1 then 0) to one of its outlet. I have this parameter set to ptbutton and its name is, say, ButtonOut.
It seems that setvalue(ButtonOut,1) does'nt work... No big surprise indeed !

Is there a simple way to do this or do I have to send '1' and then after one cycle send a '0' ? I would like to avoid this chronological approach since my script, so far, is just immediate...

Thank you all

Statistics: Posted by oxyredox — 10 Jul 2011, 20:05


]]>
BrainModular BrainModular Users Forum 2012-03-03T13:26:10+02:00 https://brainmodular.com/forums/app.php/feed/topic/2961 2012-03-03T13:26:10+02:00 2012-03-03T13:26:10+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=22703#p22703 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]>
I'll try this,
the callback procedure must be called twice (first to send 1, and next block to send 0) so I might connect the "button" output of the script to an input of the script that would inevitably cause the callback procedure to be called next block..

I'll report soon !

Statistics: Posted by oxyredox — 03 Mar 2012, 12:26


]]>
2011-11-14T10:59:04+02:00 2011-11-14T10:59:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=21837#p21837 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]>
It can work that way with the callback procedure,

Cheers


// parameters declaration

Var InA :tParameter;
Var OutA : tParameter;


// initialisation : create parameters
procedure init;

begin
InA := Createparam('Go', ptdatafield);
SetIsOutput(InA, False);
OutA := Createparam('Resultat', PtButton);
SetIsInput(OutA, False);
end;

// Callback procedure

Procedure Callback(N:integer);

begin
If getvalue(InA)=1 then SetValue (OutA,1) else SetValue (OutA,0);
End;

Statistics: Posted by Ken29 — 14 Nov 2011, 09:59


]]>
2011-11-12T13:08:02+02:00 2011-11-12T13:08:02+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=21823#p21823 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> Statistics: Posted by oxyredox — 12 Nov 2011, 12:08


]]>
2011-07-12T00:50:26+02:00 2011-07-12T00:50:26+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=19929#p19929 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> Statistics: Posted by 23fx23 — 12 Jul 2011, 00:50


]]>
2011-07-11T19:38:06+02:00 2011-07-11T19:38:06+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=19928#p19928 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> what I need to do is to send a button message out the script

thanks anyway !

Statistics: Posted by oxyredox — 11 Jul 2011, 19:38


]]>
2011-07-10T20:54:25+02:00 2011-07-10T20:54:25+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=19923#p19923 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> I'm really a newbie in script world but maybe (and waiting for a script guru in this Sunday evening)
you can find some inspiration in this Bsork script :


CODE:

///////////////////////////////////////////////////////////////Bloc counter with Max Value and refresh speed///////////////////////////////////////////////////////////// If start pulse will count incremental till max value is reached// increment is timespaced of nb_blocs input.////////////////////////////////////////////////////////VAR start, counter, maxVal,counting,NB_blocs &#58; tParameter;VAR count &#58; Integer;///////////////////////////////////////////////////PROCEDURE Init;BEGIN   start &#58;= CreateParam&#40;'start', ptButton&#41;;   SetIsOutput&#40;start, FALSE&#41;;   maxVal &#58;= CreateParam&#40;'max', ptDataField&#41;;   SetIsOutput&#40;maxVal, FALSE&#41;;setValue&#40;maxVal,16&#41;;   NB_blocs &#58;= CreateParam&#40;'nb_blocs', ptDataField&#41;;   SetIsOutput&#40;NB_blocs, FALSE&#41;; setValue&#40;Nb_Blocs,100&#41;;   counter &#58;= CreateParam&#40;'counter', ptDataField&#41;;   SetIsInput&#40;counter, FALSE&#41;;   counting &#58;= CreateParam&#40;'counting', ptDataField&#41;;   SetIsInput&#40;counting, FALSE&#41;;END;//PROCEDURE Callback&#40;n &#58; Integer&#41;;var maxvaltmp &#58; integer;PROCEDURE Process;BEGIN   IF &#40;GetValue&#40;start&#41; = 1&#41; THEN BEGIN                          //if start pulse of button we start the process      setvalue&#40;start,0&#41;;      maxValtmp&#58;= round&#40;getValue&#40;maxVal&#41;*getValue&#40;NB_blocs&#41;&#41;;   // we get the maxvalue to count to. we muliply by nb_blocs for the speed.                                                            //we reset count to 0       count &#58;= 0;      SetValue&#40;counting,1&#41;;                                     //we start counting so set the parameter to 1.      END      ELSE BEGIN                                                //as soon as the button went back to 0 will count.          count &#58;= count + 1;      END;    while count > maxValtmp                                // if count reached maxvalue, it keeps that value          do begin                                         // and set counting parameter to 0.          count &#58;= maxValtmp;          SetValue&#40;counting,0&#41;;      END;   SetValue&#40;counter, count div round&#40;getValue&#40;NB_blocs&#41;&#41;&#41;;        //we set the value to counter output. &#40;we divide by nb_blocs as previously multiplied the max                                                                  // to get a control over refresh speed. At 1 bloc, it's the fastest possible clock in usine                                                                  // that will increment each bloc &#40;3ms at 128samples&#41; and ensure a strong jiter free                                                                   // sync over time counters.                                                                  // it can be used to set some arrayvalue, dispatchers, ask osc datas ect...END;

Statistics: Posted by nay-seven — 10 Jul 2011, 20:54


]]>
2011-07-10T20:05:38+02:00 2011-07-10T20:05:38+02:00 https://brainmodular.com/forums/viewtopic.php?t=2961&p=19921#p19921 <![CDATA[[scripting] Sending a button message to a ptbutton outlet]]> I need my script to send a button message ( 1 then 0) to one of its outlet. I have this parameter set to ptbutton and its name is, say, ButtonOut.
It seems that setvalue(ButtonOut,1) does'nt work... No big surprise indeed !

Is there a simple way to do this or do I have to send '1' and then after one cycle send a '0' ? I would like to avoid this chronological approach since my script, so far, is just immediate...

Thank you all

Statistics: Posted by oxyredox — 10 Jul 2011, 20:05


]]>