You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we use buf[...] indexing for everything, and guess the user's intent by whether they provide units or not. Another option would be to only use [...] for regular 1-based Array indexing, and use function call syntax (parentheses) to do sampling, so buf[0.5] is an error, but buf(0.5) would give you a value (subject to some interpolation rule, e.g. nearest, linear, cubic, etc.). By default buf(0) would be the beginning of the signal, but we could also have signals store their starting location (seconds or hz).
Things I like about this:
parentheses notation is usually used for evaluating continuous functions, and square brackets for discrete.
Currently we're not using function call syntax for anything
storing the offset of the file allows us to do things like creating a beep with a certain offset, and adding that to a longer continuous noise signal, and having the beep be correctly located in the composite sound
plotting regions of spectra make more sense.
signals collected from different data sources can be more easily aligned (this was a big motivation for AxisArrays).
I've been tempted by the offset thing before, but was always put off by the fact that buf[1] would no longer be the first sample as people would expect. This way we can have both.
The text was updated successfully, but these errors were encountered:
No concrete plans. I'm pretty swamped with other stuff at the moment and haven't had much time for open-source maintenance. I still like the idea though, so it'll probably happen eventually.
Currently we use
buf[...]
indexing for everything, and guess the user's intent by whether they provide units or not. Another option would be to only use[...]
for regular 1-based Array indexing, and use function call syntax (parentheses) to do sampling, sobuf[0.5]
is an error, butbuf(0.5)
would give you a value (subject to some interpolation rule, e.g. nearest, linear, cubic, etc.). By defaultbuf(0)
would be the beginning of the signal, but we could also have signals store their starting location (seconds or hz).Things I like about this:
I've been tempted by the offset thing before, but was always put off by the fact that
buf[1]
would no longer be the first sample as people would expect. This way we can have both.The text was updated successfully, but these errors were encountered: