Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

audio buffer - how?

DSP related issues, mathematics, processing and techniques

audio buffer - how?

Postby tester » Mon Oct 03, 2022 8:47 pm

I just lost ability to think clearly on this one. Is it possible (and how) to make live audio buffer, that will store last few seconds of ongoing live source?

It would have to be something that as it adds new content on top, it removes the beginning, and shifts everything by amount of removed stuff, I guess. The buffer autoupdate could be paused, ant thus - stored content would be used as a sort of file.

Anyone did something like this?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: audio buffer - how?

Postby Spogg » Tue Oct 04, 2022 5:56 am

I may have completely misunderstood but it seems like you’re describing a delay with a control input. This input would pause the internal counter when activated. The tricky part would be to get the paused contents of the delay out into a file but I feel it in my bones that it could be done. Not sure how though…
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: audio buffer - how?

Postby Tepeix » Tue Oct 04, 2022 1:21 pm

Hi,
I tried to make some memin code.. But i let those for later before succeeding avoiding crash..

But why not to use the wave write mono or stereo prim ?
(take time for me to find them.. (in 3.6) you need to open the option, in advanced, check the R&D Components)
Don't know for the others R&D components but the Write and read mem was always working for me.
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: audio buffer - how?

Postby tester » Tue Oct 04, 2022 5:08 pm

Spogg, you might be right on the concept, delay is an equivalent of such buffer, I guess. But this buffer is not accessible as mem or array. But I may change the way how I think of what I have in mind. Maybe the 3 second buffer can be just recorded after pressing record, with an info, to wait for 3 secs. I want to combine live preview / file playback of audio with Martin''s implementation of Paul's stretch in "infinite" mode. A sort of FFT sound freezer.

Tepeix, these prims rather don't offer this. They record as the counter/ramp is progressing, and then you can re-record the content, it's like a radar.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: audio buffer - how?

Postby Spogg » Wed Oct 05, 2022 7:13 am

tester wrote:... this buffer is not accessible as mem or array. ...


Yeah that’s the problem. I suspect custom-made DSP code is needed.
One idea I had is you pause the delay counter then at that point the DSP code starts the recorder (which has the same memory size as the delay) and scans out the whole delay memory from start to end. Then the last 3 seconds or whatever can be saved into a wav file.
But I don’t know if this would function in the way you want…
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: audio buffer - how?

Postby tester » Wed Oct 05, 2022 9:32 am

I thnink, this could be done using "mono to graph" prim, to sync things properly. But this produces single channel array, so before sending this to "array to mem" prim, the array would have to be interleaved with 0's or itself, I guess. This is because the "Wave read" prim outputs two channels (stereo).

// attaching a rough approach, I'm not certain of one thing yet.
Attachments
snapshot.fsm
(330.7 KiB) Downloaded 562 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: audio buffer - how?

Postby tester » Wed Oct 05, 2022 12:28 pm

silly me :mrgreen: :mrgreen: :mrgreen:

(fft freezer is from Martin)
Attachments
fft-freezer.fsm
(30.31 KiB) Downloaded 581 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet


Return to DSP

Who is online

Users browsing this forum: No registered users and 57 guests