Setting the starting point (ms) for start_marker (double) on looped samples

Just Evan's icon

Hi!

I am trying to create a device to remove silence at the beginning of an audio clip.

My problem is that if I use a non-looped sample and pass the resulting starting point (ms)*0.001 to loop_start, it seems to work fine, but if I pass the starting point (ms) to start_marker (double) for looping samples, then I don't get the start marker where it is There must be. this is different from what I see in the waveform~.

Screenshots:

Waveform~ (Start 447.346939 ms) - looks perfect!
set start_marker (447.346939 * 0.001)
set start_marker (447.346939 * 0.001)

I'm a little confused, I think it's all about warping or something like that...

Maybe someone can help me figure this out?

Here is my patch:

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

you could crop the buffer to get rid of silence

without having to fiddle with live, markers and the rest f it.

Just Evan's icon

Source Audio, yes, I could, but then I would have to save the new file to disk and then add it as a new clip.

Is there a way to store buffer files in the project folder, or maybe in some kind of temporary storage, without having to specify a specific path for writing buffer files, so that it would work on different systems?

Source Audio's icon

I am not live user.

I can help you only with max part.

In your patch you anyway load file into buffer,

and have absolute path to the clip.

You can rewrite it, reload it to where you loaded it from etc.

Live or not ...

why keep samples with silence at the beginning / end if you don't want that silence there ?

Just Evan's icon

Source Audio, I'm loading audio from an audio clip into a buffer only to find and trim the silence at the beginning, and then trying to apply that back to the audio clip in the arrangement, not creating a new file, but simply moving the start marker of the audio clip to the point where the audio begins above the threshold (just cutting off the silence at the beginning).

Source Audio's icon

well, do as you like.

but as first, you could spare loading of the whole clip into buffer,

only to detect short silence.

And if you have stereo file you are inspecting only 1 channel

in your patch.

Then : peek~ counts samples, start marker expects value in beats.

so you need to convert sample count at hit threshold to beat fraction,

which is not simply samples * 0.001

you need to divide samplecount at threshold with samples in the beat

in current tempo.