LFO Shape Designer
-
So you need an array to store the table points, you then run the loop over the array to add the points to the table.
-
@d-healey but I HATE arrays!
-
@DanH You need to embrace them.
And array is just like have multiple variables but with less code.
So you could use lots of variables like this
const myVar0 = 10; const myVar1 = 20; const myVar2 = 30; const myVar3 = 40; Console.print(myVar3); // 40
or you can use a single array
const myArr = [10, 20, 30, 40]; Console.print(myArr[3]); // 40
They are not much different, but arrays are much more useful for doing batch jobs because you can loop over them.
-
@d-healey you forget that I inspired you to make the make the arrays video a few years ago
I've come a long way since then :) Not far enough however...
I've just seen there's an api for it perhaps:
-
@DanH said in LFO Shape Designer:
I've just seen there's an api for it perhaps:
Looks like it will save you from a loop, Looks like it will save you from a loop, Looks like it will save you from a loop, Looks like it will save you from a loop
-
@d-healey perhaps, if it worked!
tableShape1.setTablePointsFromArray([0, 0.5, 0.30, [0]], [0.5, 0.75, 0.5, [1]], [1, 0.9, 0.9, [2]]);
-
@DanH Looks like it's only for Tables, not ScriptTables
-
@d-healey ok so my script is:
const var Table1 = Content.getComponent("Table1"); const var LFO1 = Synth.getModulator("LFO1"); const var tableShape1 = Synth.getTableProcessor("LFO1"); const var makeShape = Content.getComponent("makeShape"); inline function onmakeShapeControl(component, value) { tableShape1.reset(0); tableShape1.setTablePointsFromArray([0, 0.5, 0.30], [0.5, 0.75, 0.5], [1, 0.9, 0.9]); }; Content.getComponent("makeShape").setControlCallback(onmakeShapeControl);
The other API's (add/setTablePoint) work fine here....
-
@DanH TableProcessor != Table
Try this
-
@d-healey ah, yes got it working, thanks :) Ok so this array needs to dynamically load points into the table..
-
@DanH Each time you update your array you call that function to update the table
-
@d-healey can the array have a dynamic number of variables?
-
@DanH An array is a variable. You can dynamically change the values within it. Check out the API
-
@d-healey so push and remove might help here I guess....
-
@d-healey or concat
Making some (slow) progress... please let me know any pointers if you have any... :folded_hands:
HiseSnippet 1391.3oc2X8tZabDDeOYeoQJMgFZ9PoPgC+IEhQH4XmXSojyVVJHpjknxMotlPX8oUVa7c6d8tU1UM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M.SdCarPJFne+i+NoG+dCUJoPe92xNKW0.Bu80FPfvcYBDjXevlLZj.a2viaIC.iSi.IsxESOm0PzQ+pCYuXm9crMeobU.vUtL.3x8SgN4i6RY1dGmoIkA7XYpdpXeSQLWMxblmOX87WTHdW6Nbk2fYiwby.iPh5GCLlNozssq0uOySMAfqZW+W93LVj4weyji+asepu7Dp+j.E7jDPBKY7nuKksSFemLApLmYY+qEcV1vEdVVqUl2rqUVxYWW8ytYWWz73u9RWMweBesM0D12MAl1XoRM1RKZdsvYOdnzmFg7qGw9sgLgmA+28DLunwjzJ2+z84Pgo9xnfz9CoR9MtMYmBg.SaeHCJYBSG6YlB1MPJUC3hSmNa6dtMkxvZ5xh8LMRmAzXb9AcYPCy.l8PYKZL7GBTEl25LSlMNUHiXIyjXte0gwJYvXG3SU21tJVntcq0w1OZyRZ935Nn9Or8GF5+KUHqL+7pbKb5Ojh4jkUguB9LrYSBJyxs+LEkysk3J++tk3OIGpf5AsnpHNLwj8ACC5B8b7XvoKDLeb9cqb3y2D5xHstF.SzSS7OvWJyJHsUJyJiY9I4LBndQxW5k72.fOjtodGvuE5+6O4sagzNyX3+.nq1K87l1TWRwMVVEe3xp3lKqhasrJ9nkUwGurJt80qHNzwtCgVGIOMIjVcpkTQ2JqiELg9+BXlzwJK
-
This post is deleted! -
@d-healey ok so I have figured out some of the permutations of drawing tables with the array and joining two or more arrays.
HiseSnippet 1413.3oc2X0sZibCEViSlzX2cKMz8hRgBCAJ3PCFam+ZYorNwwYwz3DScZ1BgvVkYjiEYFoYmQNolxB6aP6iUuoPeD5iPeCZORy3Yz3X630rY2PmKLQ572m9zQ5bTZGvsIgg7.jQ9SF3SPFOxry.lnW8dXJC0bejwJlcZdTCqWr6oMrNY28NrAZuA93vPhCxvXgmKUyH+hH02+7r8vtXlMIcJD5TN0lbH0iJRmscsum55d.1gbB0SS6Mq0zlypyc48AHsfYYjO19J7kjivR0xYhLVpgCUvC5HvBRHxXw83NC5zieCKR+SogzKbIxAU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hbqDEpLkWC9Wy5qA8m4WCZrvzd8Wk470eK9f60eyZd7mcqslv2im1x7F0UhfoorxfBaw0HtS3rG0m6hCjxOHf7p9Dlsl7+9Yx7hlooU09sZu.tXpKOvKtLXrledsCIWBTftuOg.WVBuuzVOEriGmK5QYWlMa6I0Njy8antVzQ2Is6gCks4ntFTyMfaOg2BGBOktNzX3U5BadIiGPhZcRe958CEbugKfYsofNBhupq.iyL2Voej7usN7yFG+tY7ayMbUlddQtYN8ERQrRxJjYwO.KVDgxjbyGnnbpkzV3+2kz9AdeAbdtEVDPgNdLOpuWGnlgMAhNiQbkOSvHm73Wz3xxwpyvDliZv+BewBqHGaDKrxPguWhgG1Nf+R6nmZHOHsrZFXcyT++Oya1RN1ZLuwvCpJ8Ra6rt5VFVcdMbi40vMmWC2ZdMb640vclWC+l61PYSC61Gt5O5nIB0pcinazMRp3.cX+efrRnYF
I'm now wondering how to make the x/y/curve values inside the array to be dynamic. So if I do, for example:
reg x1 = 0.255; const var newShapeArray2 = [[x1, 0, 0.5], [0.375, 1, 0.5], [0.376, 0, 0.5], [0.376, 0, 0.5]] inline function onshape2Control(component, value) { local newShape = []; x1 = 0.355; newShape.concat(flatArray, newShapeArray2); tableShape1table.reset(); tableShape1table.setTablePointsFromArray(newShape); }; Content.getComponent("shape2").setControlCallback(onshape2Control);
... the array doesn't update the value of x1 - because the value is set on oninit. So can you update / refresh the array before calling it? Or maybe I need to clear it then push it?
-
@DanH said in LFO Shape Designer:
So can you update / refresh the array before calling it?
It's just like any other variable, you can change the value whenever you like
-
@d-healey Ok well in this case I can't figure out a neat way to do it... Any ideas?
-
Before you concat the array, assign your new x value.
Something like
local newShape = []; x1 = 0.355; newShapeArray2[0][0] = x1; newShape.concat(flatArray, newShapeArray2);