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

Using HOP in flowstone

For general discussion related FlowStone

Using HOP in flowstone

Postby kortezzzz » Sat Nov 02, 2019 3:48 pm

There were several posts that mentioned HOP during the years, but still none of them really explained why, when and where you can get the advantage out of this HOP method. I would love to hear a little about it or get any link to a relevant information. I've tried google, but couldn't find a detailed explanation that refers to the audio section.

Thanks.
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Using HOP in flowstone

Postby martinvicanek » Sat Nov 02, 2019 6:09 pm

It’s about cpu load.
Dsp code is carried out once every sample (e.g. 44100 times each second). But not all operations need such frequent updating. For instance the coefficients of an EQ filter will not change at all most of the time. It would be wasteful to update those at sample rate. With hop(1024) you update only each 1024th pass, i.e. 50x per second, which is still sufficient but at much lower cpu.
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: Using HOP in flowstone

Postby guyman » Sat Nov 02, 2019 6:16 pm

Is it possible to create a dspcode layout that enables/disables hop? like in one instance I might have a static set of parameters, and then after hitting a switch those parameters would become dynamic. Would it increase efficiency / save cpu - to implement a switch in a block of code, going from some hop (x) setting to updating every sample when dynamic parameters are active?

If so, how?
User avatar
guyman
 
Posts: 205
Joined: Fri Mar 02, 2018 8:27 pm

Re: Using HOP in flowstone

Postby kortezzzz » Sat Nov 02, 2019 6:38 pm

Thank you very much for the explaination, Martin. That's a very understandable. How would you determine hop which in charge of sample\stream reading? is the best settings for that would be just 1 (since it's dynamic on every key note press)? or it's better to go up to 1024 with it?
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Using HOP in flowstone

Postby martinvicanek » Sat Nov 02, 2019 7:03 pm

Not sure what you mean by sample/stream reading. Key press events will hardly be accurate to 1 milisecond, so you could hop(32) the detection (and processing) of such events.
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: Using HOP in flowstone

Postby guyman » Sat Nov 02, 2019 7:09 pm

@Martin I think you got what he asked. Maybe to reword it for detail.. What hop(x) is appropriate for what tasks?
What is you logic when determining how many samples you are hopping?

I just started implementing hop the other day, and I just run a sine wave through my schematic, and if I hear too much noise when there are moving parameters, I reduce hop.... I personally found filters need NO HOP if am going to be moving them...

Is there an assembly > dspcode translator? I went to remove hop(x) from a martin filter in assem, and could only hope I was snipping at the code correctly...
User avatar
guyman
 
Posts: 205
Joined: Fri Mar 02, 2018 8:27 pm

Re: Using HOP in flowstone

Postby martinvicanek » Sat Nov 02, 2019 7:30 pm

guyman wrote:Is there an assembly > dspcode translator?
No, but there is the opposite. If you connect a text box to the uppermost right pin of a code box you'll get the ASM code. This may be useful to understand what is going on under the hood. It is also a good starting point for optimization.

I went to remove hop(x) from a martin filter in assem, and could only hope I was snipping at the code correctly...

The following DSP code
Code: Select all
hop(32){
    <hopped code block>
    }
translates to this ASM code:
Code: Select all
mov eax,ecx;
and eax,31;    // note this is not a typo!
cmp eax,0;
jnz continue;
    <hopped code block>
continue:
To unhop comment the following lines:
Code: Select all
//mov eax,ecx;
//and eax,31;    // note this is not a typo!
//cmp eax,0;
//jnz continue;
    <hopped code block>
//continue:
Last edited by martinvicanek on Sat Nov 02, 2019 7:45 pm, edited 1 time in total.
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: Using HOP in flowstone

Postby guyman » Sat Nov 02, 2019 7:34 pm

Thanks Martin !
User avatar
guyman
 
Posts: 205
Joined: Fri Mar 02, 2018 8:27 pm

Re: Using HOP in flowstone

Postby kortezzzz » Sat Nov 02, 2019 8:03 pm

Thanks Martin,
I understood. By the way, does hop somehow effects performance? like increasing latency or such?
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Using HOP in flowstone

Postby martinvicanek » Sat Nov 02, 2019 11:56 pm

Latency, well yes, sort of. If you process external events at hop(1024), say, then in the worst case you may have a delay of 23 ms. On average it will be half that value, so you could call it latency.

Basically the decision whether or not to hop and how much includes the following considerations:
Is it worth it? Does the code block in question contain cpu-heavy operations to worry about?
How often does the result need to be updated?
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Next

Return to General

Who is online

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