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

Nov 26, 2010 at 9:29pm

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

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.

#53581
Nov 26, 2010 at 9:49pm

Hi,

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!

FRid

– Pasted Max Patch, click to expand. –
#192679
Nov 26, 2010 at 9:59pm

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.

#192680
Nov 26, 2010 at 10:08pm

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. –
#192681
Nov 26, 2010 at 10:18pm

Yep,

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” :) ?

FRid

– Pasted Max Patch, click to expand. –
#192682
Nov 26, 2010 at 10:21pm

you mean something like this?

– Pasted Max Patch, click to expand. –
#192683
Nov 28, 2010 at 5:34pm

cheers guys :)

#192684

You must be logged in to reply to this topic.