ArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2014-04-26T17:03:44+02:00 https://brainmodular.org/forums/app.php/feed/topic/4365 2014-04-26T17:03:44+02:00 2014-04-26T17:03:44+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29388#p29388 <![CDATA[Newbie scripting help]]> Statistics: Posted by ahonoe — 26 Apr 2014, 17:03


]]>
2014-04-26T17:02:44+02:00 2014-04-26T17:02:44+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29387#p29387 <![CDATA[Newbie scripting help]]> Statistics: Posted by oli_lab — 26 Apr 2014, 17:02


]]>
2014-04-26T15:51:52+02:00 2014-04-26T15:51:52+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29386#p29386 <![CDATA[Newbie scripting help]]>
I'm a bit unclear as to how your changes make the script work. Is it the setformat() function that fixes the setvalue() issue? (I see by the ftrace() that the counter is working within my script. It seems that the output doesn't want to display these values.)

Statistics: Posted by ahonoe — 26 Apr 2014, 15:51


]]>
2014-04-26T15:40:24+02:00 2014-04-26T15:40:24+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29385#p29385 <![CDATA[Newbie scripting help]]>
rocedure Callback(N:integer);
begin
case N of
0: begin
c := c + 1;
if (c = 20) then c := 0;
SetValue(countr,c);
end;
2: begin
c := 0;
SetValue(countr,0);
end;
end;
end;

Statistics: Posted by oli_lab — 26 Apr 2014, 15:40


]]>
2014-04-26T15:35:37+02:00 2014-04-26T15:35:37+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29384#p29384 <![CDATA[Newbie scripting help]]> // Basic counter
/////////////////////////
// parameters declaration
var incx : TParameter;
var countr : TParameter;
var reset : TParameter;
// Global variables
var c : single;



// initialisation : create parameters
procedure init;
begin
incx := CreateParam('incx',ptButton);
countr := CreateParam('countr',ptDataFader);
SetMin(countr,0);
SetMax(countr,20000000);
SetFormat(countr,'%.1f');

reset := CreateParam('reset',ptButton);

SetIsOutPut(incx,false);
SetIsInput(countr,false);
SetIsOutPut(reset,false);

end;

Procedure Callback(N:integer);
begin
case N of
0: begin
SetValue(countr,GetValue(countr) + 1);
end;
2: begin
c := 0;
SetValue(countr,0);
end;
end;
end;

Statistics: Posted by oli_lab — 26 Apr 2014, 15:35


]]>
2014-04-26T03:11:16+02:00 2014-04-26T03:11:16+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29383#p29383 <![CDATA[Newbie scripting help]]>
//////////////////////////
// Basic counter
/////////////////////////
// parameters declaration
var incx : TParameter;
var countr : TParameter;
var reset : TParameter;


// initialisation : create parameters
procedure init;
begin
incx := CreateParam('incx',ptButton);
countr := CreateParam('countr',ptDataFader);
reset := CreateParam('reset',ptButton);

SetIsOutPut(incx,false);
SetIsInput(countr,false);
SetIsOutPut(reset,false);

end;

// Global variables
var c : single;

Procedure Callback(N:integer);
begin
if (n = incx) OR (n = reset) then begin
fTrace(c);
c := c - (c*getValue(reset));
c := c+getValue(incx);
setValue(countr,c);
end;
end;

Thanks!

Statistics: Posted by ahonoe — 26 Apr 2014, 03:11


]]>
BrainModular BrainModular Users Forum 2014-04-26T17:03:44+02:00 https://brainmodular.org/forums/app.php/feed/topic/4365 2014-04-26T17:03:44+02:00 2014-04-26T17:03:44+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29388#p29388 <![CDATA[Newbie scripting help]]> Statistics: Posted by ahonoe — 26 Apr 2014, 17:03


]]>
2014-04-26T17:02:44+02:00 2014-04-26T17:02:44+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29387#p29387 <![CDATA[Newbie scripting help]]> Statistics: Posted by oli_lab — 26 Apr 2014, 17:02


]]>
2014-04-26T15:51:52+02:00 2014-04-26T15:51:52+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29386#p29386 <![CDATA[Newbie scripting help]]>
I'm a bit unclear as to how your changes make the script work. Is it the setformat() function that fixes the setvalue() issue? (I see by the ftrace() that the counter is working within my script. It seems that the output doesn't want to display these values.)

Statistics: Posted by ahonoe — 26 Apr 2014, 15:51


]]>
2014-04-26T15:40:24+02:00 2014-04-26T15:40:24+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29385#p29385 <![CDATA[Newbie scripting help]]>
rocedure Callback(N:integer);
begin
case N of
0: begin
c := c + 1;
if (c = 20) then c := 0;
SetValue(countr,c);
end;
2: begin
c := 0;
SetValue(countr,0);
end;
end;
end;

Statistics: Posted by oli_lab — 26 Apr 2014, 15:40


]]>
2014-04-26T15:35:37+02:00 2014-04-26T15:35:37+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29384#p29384 <![CDATA[Newbie scripting help]]> // Basic counter
/////////////////////////
// parameters declaration
var incx : TParameter;
var countr : TParameter;
var reset : TParameter;
// Global variables
var c : single;



// initialisation : create parameters
procedure init;
begin
incx := CreateParam('incx',ptButton);
countr := CreateParam('countr',ptDataFader);
SetMin(countr,0);
SetMax(countr,20000000);
SetFormat(countr,'%.1f');

reset := CreateParam('reset',ptButton);

SetIsOutPut(incx,false);
SetIsInput(countr,false);
SetIsOutPut(reset,false);

end;

Procedure Callback(N:integer);
begin
case N of
0: begin
SetValue(countr,GetValue(countr) + 1);
end;
2: begin
c := 0;
SetValue(countr,0);
end;
end;
end;

Statistics: Posted by oli_lab — 26 Apr 2014, 15:35


]]>
2014-04-26T03:11:16+02:00 2014-04-26T03:11:16+02:00 https://brainmodular.org/forums/viewtopic.php?t=4365&p=29383#p29383 <![CDATA[Newbie scripting help]]>
//////////////////////////
// Basic counter
/////////////////////////
// parameters declaration
var incx : TParameter;
var countr : TParameter;
var reset : TParameter;


// initialisation : create parameters
procedure init;
begin
incx := CreateParam('incx',ptButton);
countr := CreateParam('countr',ptDataFader);
reset := CreateParam('reset',ptButton);

SetIsOutPut(incx,false);
SetIsInput(countr,false);
SetIsOutPut(reset,false);

end;

// Global variables
var c : single;

Procedure Callback(N:integer);
begin
if (n = incx) OR (n = reset) then begin
fTrace(c);
c := c - (c*getValue(reset));
c := c+getValue(incx);
setValue(countr,c);
end;
end;

Thanks!

Statistics: Posted by ahonoe — 26 Apr 2014, 03:11


]]>