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
how to remake this counter?
5 posts
• Page 1 of 1
how to remake this counter?
Attaching a counter module, that was created by KG some time ago (with waveread code, that works correctly for audio files longer than few minutes).
The counter works fine, i.e. can go forwards, backwards, supports starting offset and step size.
I recently started a project, in which I noticed, that it eats memory like black hole, but I found what the problem was (wave was recompiled from mem to floats in order to isolate fractions, and then it was compiled back again to mem), and now I need some solution for that. Unfortunately I have no clue what to modify, to make this work.
Generally, I need to set up a startpoint and endpoint for this counter. While I know how to make the endpoint (i.e. just by manipulating the number of samples), I have no clue how to define the startpoint.
By startpoint I mean an initial point, from which this counter should restart, after reaching the endpoint. Not to confuse with offset nodes, which tells, where from to start counting in general (within the range between startpoint and endpoint).
The counter works fine, i.e. can go forwards, backwards, supports starting offset and step size.
I recently started a project, in which I noticed, that it eats memory like black hole, but I found what the problem was (wave was recompiled from mem to floats in order to isolate fractions, and then it was compiled back again to mem), and now I need some solution for that. Unfortunately I have no clue what to modify, to make this work.
Generally, I need to set up a startpoint and endpoint for this counter. While I know how to make the endpoint (i.e. just by manipulating the number of samples), I have no clue how to define the startpoint.
By startpoint I mean an initial point, from which this counter should restart, after reaching the endpoint. Not to confuse with offset nodes, which tells, where from to start counting in general (within the range between startpoint and endpoint).
- Attachments
-
- counterproblem.fsm
- (3.03 KiB) Downloaded 901 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
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 remake this counter?
I think I solved it, or at least - it seems to work fine on longer audios.
- Attachments
-
- counter solved.fsm
- (3.32 KiB) Downloaded 866 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
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 remake this counter?
another puzzle to solve.
I need the ability to reset this counter to initial state (which is offset plus range start) via some input node.
Changing (temporarily) values on other inputs during counting cycle has no effect, using selector on output does not reset it too.
Using "clear audio" prim is not an option.
Any help with this one?
(plus switch for looped/single count would be very useful).
I need the ability to reset this counter to initial state (which is offset plus range start) via some input node.
Changing (temporarily) values on other inputs during counting cycle has no effect, using selector on output does not reset it too.
Using "clear audio" prim is not an option.
Any help with this one?
(plus switch for looped/single count would be very useful).
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
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 remake this counter?
I think I fugured out the general concept that would solve the problem of using reset and loop/single mode at once.
In code, general counter goes like this.
i=i+1
So let's add an input "in", that can be either 0 or 1. Then:
i=(i+1)*in
Thus, if in is set to 0, it shuts down the counter to 0, and if it's 1, then the counter starts to count again, and from 0. When used as reset that comes from greenery, time delay should be used (approx 100ms should do) between de/reactivation, and when used as loop/single - just switch between 0 and 1.
Now, my question is related to asm part attached in earlier post. To which section should this additional operation relate? I see in 2 places something like this:
paddd xmm1,Itemp;
movaps c,xmm1;
paddd xmm1,c;
movaps c,xmm1;
should I multiply (normal? special? I ask in context of this paddd operator here) the xmm1 with this additional input (prior to the "c" line), or put this somewhere else?
In code, general counter goes like this.
i=i+1
So let's add an input "in", that can be either 0 or 1. Then:
i=(i+1)*in
Thus, if in is set to 0, it shuts down the counter to 0, and if it's 1, then the counter starts to count again, and from 0. When used as reset that comes from greenery, time delay should be used (approx 100ms should do) between de/reactivation, and when used as loop/single - just switch between 0 and 1.
Now, my question is related to asm part attached in earlier post. To which section should this additional operation relate? I see in 2 places something like this:
paddd xmm1,Itemp;
movaps c,xmm1;
paddd xmm1,c;
movaps c,xmm1;
should I multiply (normal? special? I ask in context of this paddd operator here) the xmm1 with this additional input (prior to the "c" line), or put this somewhere else?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
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 remake this counter?
Generally, the sync node is either 0 or 1, so I thought this shortcut could work.
In two places I added a line:
mulps xmm1,sync;
[then "movaps c,xmm1;" follows]
The good news: it seems to work, also when operating on a longer audio in its further time section (remembering that rounding related limit).
There is no bad news.
However I'd like to know if this approach is correct, or should there be some problem with it. ASM gurus?
*
New node can be used to reset the counter (timer in greenery is needed, probably due to how the greens are updated in regards to streams). In order to use it as a looped/single parameter switch... I forgot what was the idea. Probably some workaround on comparing regular counter with Nsamples node, and outputing trigger to flip that input node to 0. But I'd like to know how to make it in this asm kit, to avoid trigger misses.
In two places I added a line:
mulps xmm1,sync;
[then "movaps c,xmm1;" follows]
The good news: it seems to work, also when operating on a longer audio in its further time section (remembering that rounding related limit).
There is no bad news.
However I'd like to know if this approach is correct, or should there be some problem with it. ASM gurus?
*
New node can be used to reset the counter (timer in greenery is needed, probably due to how the greens are updated in regards to streams). In order to use it as a looped/single parameter switch... I forgot what was the idea. Probably some workaround on comparing regular counter with Nsamples node, and outputing trigger to flip that input node to 0. But I'd like to know how to make it in this asm kit, to avoid trigger misses.
- Attachments
-
- counter solved expanded.fsm
- (3.28 KiB) Downloaded 881 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 75 guests