Work on #1 has revealed that, even for quite moderate cases, writing a multichannel audio file can take longer than processing, e.g.
./fluid-nmf -source ~/dev/flucoma-core/AudioFiles/Tremblay-ASWINE-ScratchySynth-M.wav -components 5 -resynth out.wav
At root, this is down to something that's already marked as a FIXME in the HISSTools audio file source: https://github.com/AlexHarker/HISSTools_Library/blob/5cf4a3ad60005cb8208f10be460607eb9b91248e/AudioFile/OAudioFile.cpp#L597
Basically, when writing channel-wise, the code spends a lot of time in seek() which is not a quick thing for a file.
For our part, the reading/storing/writing in the wrapper should change to be interleaved. This is not as huge a change as it seems:
- Use
readInterleaved from IAudioFile
- In common with the
BufferAdaptors for other hosts, rely on FluidTensorView to handle the layout logic (obtaining a channel -> reading a column when using interleaved layout)
- Use
writeInterleaved from OAudioFile
- For CSV output we probably want to use the transpose of the interleaved data. I think.
Work on #1 has revealed that, even for quite moderate cases, writing a multichannel audio file can take longer than processing, e.g.
./fluid-nmf -source ~/dev/flucoma-core/AudioFiles/Tremblay-ASWINE-ScratchySynth-M.wav -components 5 -resynth out.wavAt root, this is down to something that's already marked as a FIXME in the HISSTools audio file source: https://github.com/AlexHarker/HISSTools_Library/blob/5cf4a3ad60005cb8208f10be460607eb9b91248e/AudioFile/OAudioFile.cpp#L597
Basically, when writing channel-wise, the code spends a lot of time in
seek()which is not a quick thing for a file.For our part, the reading/storing/writing in the wrapper should change to be interleaved. This is not as huge a change as it seems:
readInterleavedfromIAudioFileBufferAdaptors for other hosts, rely onFluidTensorViewto handle the layout logic (obtaining a channel -> reading a column when using interleaved layout)writeInterleavedfromOAudioFile