From the original SynthMaker forum (2004–2014), with its members’ names and dates.
adamszabo ·
Hmm, I am trying to figure out a little problem. I am trying to add values from an array into itself. So in an array I have 1,2,3,4, and I would like to add 1+2+3+4 so I should get an array like: 3,6,10. I tried to store that number but its not really working 🙁
trogluddite ·
Got it...
...the looped value going to the add needed to be reset to zero at the start (Int switch added) - and then getting the triggers going in the right order. It's annoying that you can't change the link "ticks" (trigger order) on an output - you just have to delete links and then make them again - the trick is to make the links in the same order that things need to happen (tricky with loops, I had to use some trial-and-error!).
You can use an 'Array Section' to get rid of the extra entry (the '1' in this case) at the start of the output array.
adamszabo ·
Thats pretty good! The loop was going too fast for me to see whats happening. It would be nice if we could get a trigger input in the loop module, so it loops only when we press the trigger, so we can see step by step whats happening.
trogluddite ·
Yes, I've often wished we had a few 'debugging' tools - some way of slowing down the progress of triggers would be very very useful sometimes. A way of 'tagging' links, so that we could see the data on them in a little floating window would also be cool - so you could see the data at various places in a schematic; even when the link/module is not currently on screen.
Acrobat ·
trogluddite wrote: Yes, I've often wished we had a few 'debugging' tools - some way of slowing down the progress of triggers would be very very useful sometimes. A way of 'tagging' links, so that we could see the data on them in a little floating window would also be cool
those are really necessary for me too, 😀
if I remember well there's already a request for the second one... 😀
adamszabo ·
In a similar vein as the loop adder, I wanted to extract arrays at a specific interval. So from the first number, it extracts every second, or every third number etc.... It works but the first number is always zero. Whats happening? 🙁
trogluddite ·
Hi there,
It is the order of the links from the Loop's 'Step' output. It needs to be the index that gets updated first, then trigger the array get. Without this the first index read will be whatever number the counter reached on the previous run of the loop, which will be beyond the end of the array (trying to read beyond the bounds of an array always returns zero in SM).
Also it would be better to make the index reset to -1 instead of zero at the start, because the arrays are indexed 0...(n-1), rather than 1...n (where n = number of entries) - otherwise the first entry is treated as if it is not there.
Here;s another way to do it, the difference is that the output array only contains the extracted entries, without any 'zero padding'.
adamszabo ·
Ah thank you, you saved me once again! 🙂
Wrote something here? To have a post removed or your name hidden, write to [email protected].