Sleeping for total duration

all the samples in that row will only play for however long ‘2’ is normalized to.

I am not clear on what you mean by “normalized to”. What is happening when something is “normalized”? Can you give an example of what this would look like? What would ‘2’ be normalized to?

I see the “normalize” function you have defined in your code. it looks like you are “mapping” one range of values to another range of values. This post shows a formula that looks similar to the one you have. Is this what you are trying to do? If so, how would this connect to the duration for each row of samples?