this syntax is from pascal forums:
var x: array [1..5, 1..9] of integer;
but usine complains about the comma.
Can we use multi-dimensional arrays? If so how?
And more broadly, what variant of pascal does usine actually employ??
THANKS!
-eric
multidimensional arrays in scripts?
-
woodslanding
- Member
- Posts: 1327
- Contact:
multidimensional arrays in scripts?
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Hi Eric,
We don't have multidimensional arrays in Usine. We talked many times about that, but never went through.
Actually, there's a solution if you really need it. A comma-text can be think as a multidimensional array, but you have to manipulation either string and data. There's an example in the French section of the forum, viewtopic.php?f=25&t=7318
Best
Sylvain
We don't have multidimensional arrays in Usine. We talked many times about that, but never went through.
Actually, there's a solution if you really need it. A comma-text can be think as a multidimensional array, but you have to manipulation either string and data. There's an example in the French section of the forum, viewtopic.php?f=25&t=7318
Best
Sylvain
another soluce is to use "old style" pascal:
Code: Select all
var x: array [1..5] of array [1..9] of integer
// and inside the code
x[i][j] := i*j;Olivier Sens
www.brainmodular.com
www.brainmodular.com
-
woodslanding
- Member
- Posts: 1327
- Contact:
Thanks!
I am still curious what particular brand of pascal Usine uses....
I found a workaround that keeps my code more readable:
for i = 0 to max
for j = 0 to max
idx = //compute from i and j
do stuff with array[idx]
However, I am now wishing for dynamic arrays in my second dimension, where each array in the array of arrays was of variable length.
var x: array [1..8] of array[] of integer;
I'll see if Usine lets me do that....
I am still curious what particular brand of pascal Usine uses....
I found a workaround that keeps my code more readable:
for i = 0 to max
for j = 0 to max
idx = //compute from i and j
do stuff with array[idx]
However, I am now wishing for dynamic arrays in my second dimension, where each array in the array of arrays was of variable length.
var x: array [1..8] of array[] of integer;
I'll see if Usine lets me do that....
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Hi !
If you want variable size array, the best should be to use vectors en C++, and make a user module.
or a simpler way, use polyphony and an array within a sub-array ?
if the process is too heavy on the CPU, you can also use the "procedure" method.
cheers
If you want variable size array, the best should be to use vectors en C++, and make a user module.
or a simpler way, use polyphony and an array within a sub-array ?
if the process is too heavy on the CPU, you can also use the "procedure" method.
cheers
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Sure it will work.woodslanding wrote: ↑21 Apr 2025, 21:38However, I am now wishing for dynamic arrays in my second dimension, where each array in the array of arrays was of variable length.
var x: array [1..8] of array[] of integer;
I'll see if Usine lets me do that....
Olivier Sens
www.brainmodular.com
www.brainmodular.com
Who is online
Users browsing this forum: No registered users and 7 guests
