decl i, size=sizeof(MultiSlider.x);
for (i=1;i<size;i++);
{
p3 = MultiSlider.x;
q3 = MultiSlider.x[0];
if (i=1);
{
Monitor.value = p3;
Monitor2.value = q3;
}
if (i=2);
{
Monitor3.value = p3;
Monitor4.value = q3;
}
}
"For" loop problem
"For" loop problem
I trying to make something like this loop, I removed many parts, but I left that is not working as I expected. And what I expected is that Monitor and Monitor3 will show value of slider with number corresponding to loop iteration number(i), but it shows only 0. How do I make it working properly?
- Attachments
-
- loop.jzml
- (5.34 KiB) Downloaded 86 times
Re: "For" loop problem
BTW it works if you reduce p3 and q3, but I can't do without them.
Re: "For" loop problem
A few minor issues . .
Placement of ';' . . .
'=' is assignment '==' is comparison
decl i, size=sizeof(MultiSlider.x);
for (i=1;i<size;i++)
{
p3 = MultiSlider.x;
q3 = MultiSlider.x[0];
if (i==1)
{
Monitor.value = p3;
Monitor2.value = q3;
}
if (i==2)
{
Monitor3.value = p3;
Monitor4.value = q3;
}
}
And it could all be achieved with a loop anyway just straight assigns - not sure why you have chosen the looping . . .
Placement of ';' . . .
'=' is assignment '==' is comparison
decl i, size=sizeof(MultiSlider.x);
for (i=1;i<size;i++)
{
p3 = MultiSlider.x;
q3 = MultiSlider.x[0];
if (i==1)
{
Monitor.value = p3;
Monitor2.value = q3;
}
if (i==2)
{
Monitor3.value = p3;
Monitor4.value = q3;
}
}
And it could all be achieved with a loop anyway just straight assigns - not sure why you have chosen the looping . . .
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
Re: "For" loop problem
I corrected mistakes you pointed but Monitors values still not moving.
Full script contains large formula, without loop it will be repeated many times, and there is a limit of maximum strings in one script, and I'm not sure how to factor this formula out.And it could all be achieved with just straight assigns
- Attachments
-
- loop_corrected.jzml
- (5.34 KiB) Downloaded 89 times