sfplay~ sound degradation

Leo Knapp's icon

Lexa1loop.maxpat
text/plain 51.47 KB

I am using this on a windows 10 computer. It runs fine for a couple of days, then the sound begins to degrade. When I restart the machine, everything is fine again. Is there something wrong or should I reset every evening? What about increasing the buffer size?

Thanks in advance.

pdelges's icon

Please use Copy Compressed to transmit patched on this forum.

Did you try the fclose message before opening a new file (eventually triggered by sfplay~'s rightmost outlet)? Not sure it helps, just curious.

Anyway, I'd create a cue for each of your files ( using preload, and eventually sflist~ - check the "cues" tab in the help file) and simply trigger the cue rather than opening and trigger the file.
And I'd used more than 1 argument in select.

Leo Knapp's icon

What is the cause of the sound degradation? It doesn't glitch at isolated spots- the overall quality sounds grainy.

mizu's icon

try that : use trigger to organise the things. Maybe stop the play before a new file, and defer the play ? As pdelges says, you can simplify your patch. Maybe the computer is perplex if the play comes before the file is founded on the HD or SSD ?
hth

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

Leo Knapp's icon

Why does it run fine for several days? It doesn't have a problem with any of the functions- it just loses sound quality, as I said.

pdelges's icon

Maybe your system uses more and more RAM and needs more and more VM.

Leo Knapp's icon

I checked the memory usage in Task Manager and it never gets above 200 M.

mizu's icon

imho : It's a complex chain : disk->system->Max->system-> driver audio->analog audio. i.e. is your samplerate the same everywhere ? Changing the driver audiocard ? Changing the path/disk to the files ? Precising in the sfplay box his attributes ? Are your files the same samplerate ?
hth
michel

Source Audio's icon

If I understand correctly that system runs 24/7 uninterrupted, right ?
Anything can cause that degradation.
Relaunching Standalone app from time to time should fix the problem

florian1947's icon

Have you tried using polybuffer~ instead of multiple sfplay~'s?
This would avoid all these countless disk accesses and keep the machine nice and calm.

Leo Knapp's icon

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

Here's what I came up with- I think I need to restart every few days still but I am open to suggestions. Thanks to everybody for your help.

Source Audio's icon

everything in that patch is doubled, pasted twice ?

what is that weird buffer size ?
you can simplify a lot everything.
No need for preloading.
Fill coll or umenu with audio file names and recall them using that keys.
send message open $1, 1 to sfplay,
You can replace 1 2 with 0 1 and remove -1
---------
You will not sense difference between open - play and trigger preloaded file
if the keys are not triggered in some small ms interval

And use standalone, not max.

florian1947's icon

In addition to what SourceAudio said, I don't understand why you need key triggers if you're looping. Is this to set a playing order before looping?
Also, I still think you'd be better off using polybuffer~.

riccardo dapelo's icon

In case of permanent (or very long) installations I used successfully sflist~ with sfplay, maybe a little more tricky than polybuffer for preloading. Check also the buffer size, it's a strange number. Look the help for buffer sizes

Leo Knapp's icon

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

So I'm trying this- using poly buffer and groove. Everything loaded at the start. No more going to and from the disc- less work for the machine.

florian1947's icon

Seems to be working. If it's doing what you wanted: lets see how long it'll run.