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

how to get min/max from mem (audio data) directly?

For general discussion related FlowStone

how to get min/max from mem (audio data) directly?

Postby tester » Sat Oct 07, 2017 7:50 pm

Problem.

Loaded audio file is stored in mem,

In order to calculate min/max values - the simplest way is to convert mem to array and go from there.

But if loaded audio file is large (say 400-600MB), then in such cases I get a message, that there not enough memory (task manager confirms it), which is correct. So green arrays are not in the game.

Is there a way to get min/max values directly from mem connector, or in a way, that memory is not overloaded?
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: how to get min/max from mem (audio data) directly?

Postby martinvicanek » Sun Oct 08, 2017 8:57 am

Here is a code version, takes about 2 seconds for an entire song here. Not sure about the max file size. If your file is too big to load and process in one go break it into pieces.
Attachments
MaxFinder.fsm
(2.71 KiB) Downloaded 939 times
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: how to get min/max from mem (audio data) directly?

Postby tester » Sun Oct 08, 2017 10:11 am

This is not going to fit in such raw form.

From what I see, 23.5MB wave file (2'20") eats 280MB of memory (38MB empty flowstone, and - 131MB after clearing the file; there is a memory issue related to releasing memory). This is because there are several places in greenery, where array of floats is created/duplicated (analyzers are the starting points). So with larger files, it will not load at all in this form.

Perhaps, loop based recalc, so that at each cycle
1) index is incresed by certain fixed amount (15 cycles per 30 mins in 2mins parts let say)
2) small fixed NS is used for analyzer (bonded with step size above)
3) all steps are queued, and max of them is sent output
4) single analyzer was used (global max for normalizing)
would to the job.

In the meantime my question is - can be the max value (for calculating normalize value) taken directly from mem connector, without pushing the whole file into green array of floats? So the output would be like a readout with blue S&H or something like it.

In FS there is a prim, for converting mem into smaller (via average) arrays of floats for creating graphs, so this indicates, that this is perhaps possible. BTW, such averaged smaller arrays from it can't be used as a normalizing baxe due to averaging.
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: how to get min/max from mem (audio data) directly?

Postby tester » Mon Oct 09, 2017 8:48 pm

I think I have an idea.

Probably no analyzer needed.

1) Counter, with step set to play it at 1000x speed (will go at max CPU I guess)
2) Single playback limiter
3) waveread out connected to min/max modules directly on node 1, and via "1 sample delay" to node 2 (alternatively, output looped to node 2, I guess there is a 1 sample delay anyway). This approach will always send to output the maximum value of 2 points, resulting with maxpoint at the end
4) blue'ish sample and hold (maybe even not needed - greenery may hold it too) to store the final value.

So this is sample-by-sample approach, but at audio (free rendering) performance.
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 General

Who is online

Users browsing this forum: Google [Bot] and 22 guests