Welcome @vmx and thanks for the report. I can reproduce on Mac OS. The problem seems to be that Buffer#write is failing to produce a file. Streaming with
m.getToFloatArray(action: {|x| x.size.postln})
works for me, but with load, I get the same error and the tmp file is missing.
It could be that there’s a maximum channel count in the scsynth file writing that gets exceeded for FFT sizes > 1024. I’ll make an issue on Github and have a closer look when I can.
This turns out to be a (hard) limit in libsndfile, so I don’t think there’s any prospect of getting loadToFloatArray to work when the Buffer has > 1024 channels. The immediate workaround would be to use getToFloatArray, and stream in chunks if needed (which is fiddly, I know).
Medium-term, there might be a way of enabling an alternative file format for Buffers that are more matrix-like by adding a new scsynth cmd and a corresponding method to sclang Buffer. If anyone has Opinions on what such a file format might usefully be, then do offer suggestions (or PRs )
When we decided on the interface I’m pretty certain we checked that it works… what we didn’t check are the Buffer class limitation when importing back to the language indeed!
@spluta has proposed a workaround which is good: using another file format to do the tmp file, as sort of better loadToFloatArray . If you feel like a bandit, you can change line 282 of Buffer.sc, which is what I’ll do right now to check it quickly. Stay tuned!
Note: The libsndfile library will reject values for samplerate field that are greater than 655350 and values for field channels that are greater than 1024. These values represent the maximum theoretical limit and may be less for specific formats.
So this is a hardwired scsynth limitation.
To be complete, I made a quick test in Max. I was able to write it, and check its specs with afinfo and Reaper. Indeed the libsndfile-based sndfile-info recognised the header of 1025 channels but calls it an error.
So our options are, in order of dreaming to gaffataping:
we lobby libsndfile to remove that limitation
we lobby sc to use another sound file i/o library
we think hard and might be able to find a workaround Buffer’s native i/o to the language
we use our amazing FluidBufCompose and import it in batches of ‘only’ 1024 channels. Since scsynth is able to deal with large channel count, one could query the channel count and copy to a temp buffer…