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?
Re: Clock Accuracy - 10ms?
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!
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!
-
nix - Posts: 817
- Joined: Tue Jul 13, 2010 10:51 am
Re: Clock Accuracy - 10ms?
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:
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:
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?
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)
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?
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
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?
Some further notes for maniacs
I changed the DSP code from this:
to this:
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:
That's a problem!!!
Is there a way on low level language to do a round-down integer rounding?
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:
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?
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.
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Clock Accuracy - 10ms?
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?
no, "int" always rounds down now. For bi-directional rounding you should use "rndint"
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Clock Accuracy - 10ms?
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?
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
Who is online
Users browsing this forum: No registered users and 77 guests