Yep, s_nframes is best.
To Iohannes's point (s_n, s_nframes, and s_channels are redundant) , s_n needs to be kept in the struct, and
then we could either have s_nframes, or s_nchannels,
in which case you'd get the other one by dividing.?? I have a deep horror of integer division (if you ever divide
by zero your program will crash, and anyway when I was a kid it could easily take a millisecond to compute).
Probably I just have to get over it.
(I think nframes is the better one to keep and nchannels should become a macro in the case that we don't just supply both in the structure.)
Still wondering about s_samplerate... it's a long name but perhaps it's the shortest good one :)
Meanwhile, I'm going to propose that we not bother (yet) with automatically vectorizing stuff like filters,
because I think there will be lots of headaches, and anyway one is most likely to want to do more per-channel
than just one object at which point the clone object becomes useful.
cheers
Miller
(re-sending to the list)
Am 2. September 2022 20:12:54 MESZ schrieb Miller Puckette via Pd-dev pd-dev@lists.iem.at:
Yep, s_nframes is best.
To Iohannes's point (s_n, s_nframes, and s_channels are redundant) , s_n needs to be kept in the struct, and
then we could either have s_nframes, or s_nchannels,
in which case you'd get the other one by dividing.?? I have a deep horror of integer division
Fair enough.
Note, that Christof's suggestion of s_n being the number of samples per channel (that is: it's what I suggested as s_nframes) does not require any division: we know the sample frames (s_n) and the number of channels (s_nchannels) and getting the total number of samples is a simple multiplication.
Given the issues pointed by Christof, this is probably the simplest solution.
Meanwhile, I'm going to propose that we not bother (yet) with automatically vectorizing stuff like filters,
But of course, in order for christof's suggestion to work, the data ought to be "planar" (samples for the 2nd channel come after all the samples for the 1st channel.
But for SIMD to be fun, data should be interleaved...
mfg.sfg.jfd IOhannes