Long Sample Issues

Hi there :slight_smile:

Sam asked me to make a thread on here about long samples. I made a DAW comparison video on YouTube (https://youtu.be/oekhxXfY3DQ if you’re interested) and talked about issues I’ve had with remixing in Sonic Pi. The case I made was that in a 3 minute sample, taking a half second piece can be difficult without support from another DAW because of decimal place limits.

I’ve had a good think about this. I don’t think going up to 10, 20 or 5 million decimal places is the answer, in my mind that creates even more confusion. Instead, what about a time stamped sampling option? What I mean is, am option called something like time_start/time_finish that lets you specify a sample by time.

Can’t remember how to do formatting (eek sorry), but here are some examples anyway.

sample :loop_garzul, time_start: 2, time_finish: 4

sample :the_melodies_of_life, time_start: 120, time_finish: 120.5

I’m thinking just seconds just to avoid issues with colons and time, but if there’s a way to do a minute/second format that would be great.

Hopefully that all made sense and was helpful…


1 Like

Hi @Bhuna,

welcome to our forums - it’s lovely to have you here :slight_smile:

I’m very happy to talk about new features which might make things easier, but before that, I’d really like to fully understand the issue that you’re discussing.

Could you share a link to an example sample and information about how you’re trying to use it. What code are you writing, what were you expecting it to do, and what did it actually do?

I’d love to really understand specifically where the limitations are. I’m assuming that it’s the limitation discussed here:


WARNING: The phase argument only offers precision for addressing 2**24 samples (about 6.3 minutes at 44100Hz).

The stereo sample player uses the SuperCollider BufRd which has a limitation on the phase position.

If this is the limitation you’re running into (which I assume it is) then changing the units of the start/finish opts won’t fix things as ultimately they’d need to be converted to a phase which would suffer from the same issues.

I’m assuming that the only way forward is to redesign the sample playback synthdef or come up with an alternative one that supports high resolution indexing. If anyone reading this with knowledge of SuperCollider has any ideas, I’d love to hear them.

I get what you’re saying about the existing sampling in terms of changing the unit not working, which is a shame. To be entirely honest, I’m not a programmer of any sort outside of Sonic Pi so I don’t really understand what’s in the link. I’ll try and explain my issue again a bit more clearly.

The sample that I was using was my friend’s song Biohazard, which is roughly 2:30 long. I was trying to take just the ending 1 second(ish) using Sonic Pi, but eventually gave up. I think the code I was trying to use was something like:

sample :dj_diamond_biohazard, start: 0.998754

This was a while ago, so I can’t remember the code exactly. I’ll replicate it if you want. The problem I had is that Sonic Pi threw up an error saying that the number I’d specified for start: was invalid and so it didn’t play the sample.

Apologies in advance if this doesn’t help you, but I don’t know anything about programming beyond very basic HTML/CSS so I don’t know how much I can help on the technical level.

(2.29/2.30) - to get the start.
sample s, start: 0.9956, finish:1

What do you think?