First time here? Check out the FAQ!
x

Accessing a sample at exact sample positions

0 votes
298 views
Hi,

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,

 

Anders
asked Dec 28, 2018 in Using Kyma by anders-skibsted (Adept) (1,320 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) (128,200 points)
selected Jan 2, 2019 by anders-skibsted
...