softcut feature-request: non-realtime(low-priority) ‘poke’ and ‘peek’ functions #1623
Replies: 3 comments 5 replies
-
hey thanks for the suggestion an experimental branch reworks norns into a single process running both lua interpreter and softcut jack client. making softcut buffer contents directly accessible from matron/lua, is one of the nice things that the new architecture facilitates. but APIs for such access have not yet been implemented. in any case, async access could also be done. add functions and job types to |
Beta Was this translation helpful? Give feedback.
-
yeah, there's a problem with actually passing significant amounts of buffer memory between the jack client and lua.
nonetheless, there are many issues with BufDiskWorker, it's not the most robustly designed system @ryleelyman has probably worked with it more than anyone else in the context of using it as non-RT buffer manipulation backend from lua. off the top of my head, here are a few issues with BufDiskWorker as it is right now:
setting all those issues aside, i think it would be possible / nice to extend BufDiskWorker to both provide a greater range of "DSP primitives" and maybe even to allow custom DSP routines defined in lua. for example:
i should reiterate that i'm not really expecting to have time to personally make significant code contributions to norns in immediate future. but happy to help / explain / review/ etc |
Beta Was this translation helpful? Give feedback.
-
huh, I cannot for the life of me seem to be able to divine the right way to wrap a lua function into a function pointer... I'll keep poking around |
Beta Was this translation helpful? Give feedback.
-
Hi, i was mentioning in this thread about a softcut 'poke' and 'peek' function to allow us to access samples in softcut buffers directly and process them offline/non-realtime with our own dsp algorithms. for example, we could have something like so:
softcut.peek(buffer-channel, sample-index)
and the same with poke:
softcut.poke(buffer-channel, sample-index, write-value)…
then in my Lua, i could write something like:
…this would open up norns to the world of non-realtime digital signal processing where we could process the samples in softcut buffers by our own dsp algorithms…
if this could be done at extremely low-priority(i imagine the _copy_stereo and _copy_mono methods are like this), then this could allow other norns processes to run regular audio without being interrupted by this offline processing…
An app could record audio-input, start playing it back in realtime, then effect samples offline in non-realtime, write those samples back to a different part of the softcut-buffer/channels, and then switch to play the effected audio after its ready(i suppose that means the poke function might need a callback function too to indicate when the newly written information is safe to be read).
in the thread linked above, Brian also mentioned for optimization, it could be offered in blocks(i'd recommend some maximum in samples that is close to 10-50ms (like between 512-2048 samps) shorter block-sizes would allow people to upload samples of varying length to their norns, and there would be a minimal need for truncation(or fancy overlap-windowing), on the other hand, larger block-sizes would probably be faster/easier/more-efficient)... just some extra food for thought.
No worries if it's too much of an ask(my main reason for this is that softcut is so fast and efficient, that it would be magical to have some additional custom-dsp options right there on that layer(i want to add my own softclip and other distortions, plus some options open up for offline filtering, etc.), for the data stored in softcut buffers... but i would not want anything changed/added if it was too difficult to keep softcut/norns as efficient and fast as it is now).
Thanks for considering it :)
Beta Was this translation helpful? Give feedback.
All reactions