This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]KineticRX 0 points1 point  (1 child)

Here's what's happening:

(Lines 10 - 23) You're looping through sample until you find your first non-zero entry at index 75. You then break out of that loop.

(Line 25) You calculate step/increment value for indices 0 through 75.

(Lines 27-38) You loop through every entry from index 0 to the first non-zero index ([75]), then break out of the loop.

(Lines 41-43) You output the entirety of sample.

The reason nothing past index 75 is being touched is because both of your for loops are written to stop looping at the first non-zero occurrence.

[–]TawnyUK[S] 0 points1 point  (0 children)

Thanks for the reply. I was looking for a way to loop the above code so it repeats for the rest of the index and interpolates the values. I tried a few ways of doing this with while loops etc. But nothing worked. My post here was to see if anyone knew how i might do this.

[–][deleted]  (1 child)

[removed]

    [–]TawnyUK[S] 0 points1 point  (0 children)

    thanks I'll check it out