ArrayArrayArrayArray BrainModular BrainModular Users Forum 2015-03-03T16:14:17+02:00 https://brainmodular.fr/forums/app.php/feed/topic/4726 2015-03-03T16:14:17+02:00 2015-03-03T16:14:17+02:00 https://brainmodular.fr/forums/viewtopic.php?t=4726&p=31444#p31444 <![CDATA[FastScript - TParameter of Array: How to do Callback]]>
Seems now its working for me, yes I did have to define the label as an index....now it seems to take the other Tparameters I put.

I am going to chalk it up to me :)

Thanks for your help Simon!

-S

Statistics: Posted by sephult — 03 Mar 2015, 15:14


]]>
2015-03-03T15:37:22+02:00 2015-03-03T15:37:22+02:00 https://brainmodular.fr/forums/viewtopic.php?t=4726&p=31443#p31443 <![CDATA[FastScript - TParameter of Array: How to do Callback]]>
Thank you for your help!
My brain has not had enough coffee this morning...and still very dense :P

I was wondering the same thing, however looking at a script such as the MIDI Arpeggiator they seemed to just reference the Tparameter variable.

No you are correct about the pad[0], pad[1], etc... Interestingly enough if I put pad[0] etc...the compiler takes it and if I put another Tparameter it won't.

-S

Statistics: Posted by sephult — 03 Mar 2015, 14:37


]]>
2015-03-03T15:23:08+02:00 2015-03-03T15:23:08+02:00 https://brainmodular.fr/forums/viewtopic.php?t=4726&p=31441#p31441 <![CDATA[FastScript - TParameter of Array: How to do Callback]]> Anyway, did you mean pad[0], pad[1], etc. unless you have declared "pad0" and "pad1" elsewhere.

If you want to use variables you will have to use "if" instead of "case", e.g.

var pad : array [0..15] of Tparameter;

procedure callback (n:integer);
Begin
if n = pad[0] then ...
else
if n = pad[1] then ...
end;

Simon.

Statistics: Posted by sm_jamieson — 03 Mar 2015, 14:23


]]>
2015-03-03T14:55:09+02:00 2015-03-03T14:55:09+02:00 https://brainmodular.fr/forums/viewtopic.php?t=4726&p=31440#p31440 <![CDATA[FastScript - TParameter of Array: How to do Callback]]>
Sorry for Topic confusion I meant to say Array of Tparameter:


So I am running into an interesting problem.

I have an Array of Tparameter , and I am wanting to control by a Callback event referring to the name.

As example:

var pad : array [0..15] of Tparameter;

procedure callback (n:integer);
Begin
Case n of

pad0 :
pad1 :
etc..

It seems like the compiler does not understand that pad0 is a real Tparameter, because the iteration to create happens in the init procedure.
At least this is what I am assuming.

I was hoping to refer by name, as in previous scripts I have always had problems where I had to add another parameter and had to adjust the
entire callback procedure respectively to match the IO number.

Am I doing something wrong? Is there a different way to approach?
If this is the case, I guess it would probably be beneficial to update the compiler to accept that a Tparameter is an array of a specified length.

-S

Statistics: Posted by sephult — 03 Mar 2015, 13:55


]]>
BrainModular BrainModular Users Forum 2015-03-03T16:14:17+02:00 https://brainmodular.fr/forums/app.php/feed/topic/4726 2015-03-03T16:14:17+02:00 2015-03-03T16:14:17+02:00 https://brainmodular.fr/forums/viewtopic.php?t=4726&p=31444#p31444 <![CDATA[FastScript - TParameter of Array: How to do Callback]]>
Seems now its working for me, yes I did have to define the label as an index....now it seems to take the other Tparameters I put.

I am going to chalk it up to me :)

Thanks for your help Simon!

-S

Statistics: Posted by sephult — 03 Mar 2015, 15:14


]]>
2015-03-03T15:37:22+02:00 2015-03-03T15:37:22+02:00 https://brainmodular.fr/forums/viewtopic.php?t=4726&p=31443#p31443 <![CDATA[FastScript - TParameter of Array: How to do Callback]]>
Thank you for your help!
My brain has not had enough coffee this morning...and still very dense :P

I was wondering the same thing, however looking at a script such as the MIDI Arpeggiator they seemed to just reference the Tparameter variable.

No you are correct about the pad[0], pad[1], etc... Interestingly enough if I put pad[0] etc...the compiler takes it and if I put another Tparameter it won't.

-S

Statistics: Posted by sephult — 03 Mar 2015, 14:37


]]>
2015-03-03T15:23:08+02:00 2015-03-03T15:23:08+02:00 https://brainmodular.fr/forums/viewtopic.php?t=4726&p=31441#p31441 <![CDATA[FastScript - TParameter of Array: How to do Callback]]> Anyway, did you mean pad[0], pad[1], etc. unless you have declared "pad0" and "pad1" elsewhere.

If you want to use variables you will have to use "if" instead of "case", e.g.

var pad : array [0..15] of Tparameter;

procedure callback (n:integer);
Begin
if n = pad[0] then ...
else
if n = pad[1] then ...
end;

Simon.

Statistics: Posted by sm_jamieson — 03 Mar 2015, 14:23


]]>
2015-03-03T14:55:09+02:00 2015-03-03T14:55:09+02:00 https://brainmodular.fr/forums/viewtopic.php?t=4726&p=31440#p31440 <![CDATA[FastScript - TParameter of Array: How to do Callback]]>
Sorry for Topic confusion I meant to say Array of Tparameter:


So I am running into an interesting problem.

I have an Array of Tparameter , and I am wanting to control by a Callback event referring to the name.

As example:

var pad : array [0..15] of Tparameter;

procedure callback (n:integer);
Begin
Case n of

pad0 :
pad1 :
etc..

It seems like the compiler does not understand that pad0 is a real Tparameter, because the iteration to create happens in the init procedure.
At least this is what I am assuming.

I was hoping to refer by name, as in previous scripts I have always had problems where I had to add another parameter and had to adjust the
entire callback procedure respectively to match the IO number.

Am I doing something wrong? Is there a different way to approach?
If this is the case, I guess it would probably be beneficial to update the compiler to accept that a Tparameter is an array of a specified length.

-S

Statistics: Posted by sephult — 03 Mar 2015, 13:55


]]>