I'm using writesf~ to record the files, as i need to read them randomly.
Are you running into any problems with this?
How long may the recordings become?
Which hardware is being used?
How much effort do you want to put into this?
There are differences of harddrive (solid state or mechanical?) and RAM.
RAM is good for quick read/write access, size is limited (how big? how long the recordings?) and is non-persistent at power-cycles.
Maybe you don't need [writesf~] at all.
But using only [writesf~] may work for you too.
tabwrite~ to capture then save a file afters?
Is that possible?
Yes with [soundfiler]
or this: https://forum.pdpatchrepo.info/topic/14290/array-save-to-textfile-load-from-textfile
(may be possible with .wav files too, but not sure)
Pd runs into precision issues on large arrays:
but you can use indexing or split into multiple arrays
And loading large .wav files from hd may introduce audio-dropouts (because [readsf~] is running syncronous, in deterministic order, - I think [soundfiler] does, too).
If really required (!) and (!) you are up for making things complicated (!):
If you need the hd and have big files or dropouts: save once in a while to harddisk in a second pd instance.
Both instances are running asyncronously: one for everything realtime (threshold/recording/playback),
the other instance only for saving and loading to/from hard-drive.
Sharing data between instances with the shmem library. And communicating with [netsend] / [netreceive] or also with shared arrays.