First time here? Check out the FAQ!

Accessing a sample at exact sample positions

0 votes

Is there a way or a prototype that can acces samples at excact sample indexes instead of using a [-1, 1] index?

Or is there a good way to scale your time index in? I keep running in to rounding errors and not being excactly certain that I'm playing the excact right samples, when I try to change the window of samples that I'm playing.

Hope this makes sense,


asked Dec 28, 2018 in Using Kyma by anders-skibsted (Practitioner) (640 points)

1 Answer

+1 vote
Best answer

Have you tried dividing the index in samples by the total duration of the file in samples; then scaling and offsetting the result to get it into the [-1,1] range? Something along the lines of:

(!IndexInSamples / ('aFileName' asSamplesFile sampleFrames)) * 2 - 1

answered Dec 28, 2018 by ssc (Savant) (85,170 points)
selected Jan 2 by anders-skibsted