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

Clock Accuracy - 10ms?

For general discussion related FlowStone

Re: Clock Accuracy - 10ms?

Postby nix » Wed Dec 16, 2015 1:00 pm

Here is a demo screen in stream:-
http://imageshack.com/a/img905/9174/tEtVTU.png

So .6 becomes one in a mono stream integer

Floats are usually used for constants in a stream,
but if you change the float value, the stream will update on next sample

Note the number of zeros, I used 441,000 samples

8D Enjoy and every success- pleased to help!
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Clock Accuracy - 10ms?

Postby Nowhk » Wed Dec 16, 2015 2:52 pm

nix wrote:So .6 becomes one in a mono stream integer

I see. So the built-in Int module already does this round. This explain why 0.51 (and not 0.50) read new sample:

Immagine2.png
Immagine2.png (99.51 KiB) Viewed 20162 times

approximation fault :!: All is very more clear!!!

nix wrote:Floats are usually used for constants in a stream,
but if you change the float value, the stream will update on next sample

Oh ok, they are "read-only-one"! So it won't continuously change between stream and float "threads", thus there is not asynch operations if I don't change them, nice.

nix wrote:Note the number of zeros, I used 441,000 samples

Oh nice, now I got it! You put x10 as max limit, and divided by 44100 (so each 1 second). Nice, but I'd prefer somethings like this:

Immagine.png
Immagine.png (14.63 KiB) Viewed 20162 times

and change speed with a knob ;) Since this won't impact on the sync if I don't move it, its fast to adjust values with GUI.

nix wrote:8D Enjoy and every success- pleased to help!

You really does it! Thank you!!!!
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby tulamide » Wed Dec 16, 2015 5:20 pm

There is no error!

Rounding a number is defined as such.

round(n)
everything up to x.50 gets rounded down to the current integer x (n = x), everything from n > x.5 gets rounded up to the next integer (n = x+1)

There are two other rounding types:

floor(n)
everything from x.0 to n < x+1 gets rounded down to the current integer (n = x)

ceil(n)
everything from x.0 to n < x+1 gets rounded up to the next integer (n=x+1)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Clock Accuracy - 10ms?

Postby Nowhk » Wed Dec 16, 2015 5:25 pm

tulamide wrote:There is no error!

Rounding a number is defined as such.

round(n)
everything up to x.50 gets rounded down to the current integer x (n = x), everything from n > x.5 gets rounded up to the next integer (n = x+1)

There are two other rounding types:

floor(n)
everything from x.0 to n < x+1 gets rounded down to the current integer (n = x)

ceil(n)
everything from x.0 to n < x+1 gets rounded up to the next integer (n=x+1)

Yes, why this happens on the Read module makes more sense! That -0.5 makes the trick :P

Since we are in discussion: is there a way to start/stop the DSP code? Such as "Is Playing" iterate, else stop. I guess the solution is to swap a float variable and send 0 as iteration step... but maybe there is a clever way...
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby Nowhk » Thu Dec 17, 2015 11:16 am

Some further notes for maniacs :D
I changed the DSP code from this:

Code: Select all
streamout i;

i = i + 1;
i = i&(i<10);

to this:

Code: Select all
streamout out;
float i = 0;

out = i;
i = i+1;
i = i&(i<10);

this because at very first iteration, it will skip the first (0) value, since it's i+1 from beginning.

Also, that "-0.5" trick works for float value. If I use integer step, this will fails.
For example:

0 become -0.5, which is 0
1 become 0.5, which is 0 (1 is at 0.51)
2 become 1.50, which is 2

so I'll miss the sample at index 1:

Immagine.png
Immagine.png (28.55 KiB) Viewed 20149 times

That's a problem!!!

Is there a way on low level language to do a round-down integer rounding?
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby MyCo » Thu Dec 17, 2015 11:36 am

I guess there was a bug in the "int" function causing "int" to round up. I just tested it with the current Beta version (= new DSP/ASM) and it's fixed there.
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Clock Accuracy - 10ms?

Postby Nowhk » Thu Dec 17, 2015 11:46 am

MyCo wrote:I guess there was a bug in the "int" function causing "int" to round up. I just tested it with the current Beta version (= new DSP/ASM) and it's fixed there.

I can't use the new Beta Version, since I'm using FlowStone inside FL Studio, and at the moment I don't know if it will be supported there.

Are you saying that .5 now will always round up to 1 and not 0? Because also 2.5 round to 2 instead of 3. The same for any odd values. i.e. 1,3,5,7 (-0.5 each) rounds to 0 2 4 6 instead of 1,3,5,7...
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby MyCo » Thu Dec 17, 2015 11:50 am

no, "int" always rounds down now. For bi-directional rounding you should use "rndint"
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Clock Accuracy - 10ms?

Postby Nowhk » Thu Dec 17, 2015 11:57 am

MyCo wrote:no, "int" always rounds down now. For bi-directional rounding you should use "rndint"

This will be perfect! I won't need the "-0.5" trick anymore.
It might works for any value (integer and float) for my intent...
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby Nowhk » Sat Dec 19, 2015 5:52 pm

Now the question is: do I really need frames if stream is sync at 44100hz?
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 59 guests