Forums > MaxMSP

Using dropfile and gathering sample size of a file loaded into it

Nov 26 2010 | 9:29 pm

Ok guys,
this may be strangely phrased. But I want to use dropfile, and once a file has been loaded into sfplay its current file length is known so that sfplay then knows when to loop the file again. If that makes sense? Let me try to rephrase it again I want a file that is loaded in by the dropfile object to automatically update its current length in samples so when looped the sample knows when to begin looping again.
Would it be best to use sfinfo for this? and where should i load it too (sfplay’s right outlet?).
At the moment I am using a gate as a looping method I know I can use the loop message for this but I once the toggle gas been selected I want this to then trigger both pitch and amplitude envelopes and to do this the samples length needs to be known, which may in turn trigger a bang to both the amplitude and pitch envelopes.

-- Pasted Max Patch, click to expand. --

Hope this makes sense and thanks for the help in advance.

Nov 26 2010 | 9:49 pm


From what i uderstood it’s better to use a buffer like in the patch below. I do not know if you need to use sfplay for some reason but i would take this route. And still if you have to use sfplay just use the buffer only for the info.

Good luck!


-- Pasted Max Patch, click to expand. --

Nov 26 2010 | 9:59 pm

Thank you for your very fast reply FRid your solution seems a lot more appropriate for solving my problem. Just curious as to whether it is possible using it with sfplay though, I much rather work with groove! Cheers once again mate.

Nov 26 2010 | 10:08 pm

No problem,

You got me curious too. Haven’t found a way though (but i’m on it :) this playbar seems to adjust itself in a magical way to the sample loaded?

-- Pasted Max Patch, click to expand. --

Nov 26 2010 | 10:18 pm


Sfinfo seems the only way to go. But the mystery of the playbar still exists :) Would this be the only object that connects to an inlet adjusting itself automatically to the object it is connected to? Would this be "javascriptable" :) ?


-- Pasted Max Patch, click to expand. --

Nov 26 2010 | 10:21 pm

you mean something like this?

-- Pasted Max Patch, click to expand. --

Nov 28 2010 | 5:34 pm

cheers guys :)

Viewing 7 posts - 1 through 7 (of 7 total)

Forums > MaxMSP