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 » Sun Dec 20, 2015 9:46 am

Nope, I don't think you need frames.
Maybe draw the LFO with Ruby, and use stream to read the resulting float array
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Clock Accuracy - 10ms?

Postby Nowhk » Thu Feb 11, 2016 9:24 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 don't understand (having this approx bug) how Wave Player build-in module has work till now.
Looks at the Precise Counter module inside it:

Immagine.png
Immagine.png (66.96 KiB) Viewed 19929 times

if you play the sample at original pitch (step=1 from DSP code), the value of CountInt (which is the index of the sample that will be read by the following Interpolation module; to be precise, that value-1 since is zero-based) will never get odd values :o

Out of DSP Code (step=1):

First iteration: 1+0 (feedback prim), than 0.5 (-0.5), than Round... CountInt=0
Second iteration: 1+1 (feedback prim), than 1.5 (-0.5), than Round... CountInt=2 (BUG)
Third iteration: 1+2 (feedback prim), than 2.5 (-0.5), than Round... CountInt=2
Fourth iteration: 1+3 (feedback prim), than 3.5 (-0.5), than Round... CountInt=4 (BUG)

and so on...

The odd values will never be considered. But it seems that the sample play fine. How can play fine if odd index (reading the wave loaded in memory) will be ignored?

I'm curious about this...
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby MyCo » Thu Feb 11, 2016 10:08 am

Nowhk wrote:First iteration: 1+0 (feedback prim), than 0.5 (-0.5), than Round... CountInt=0
Second iteration: 1+1 (feedback prim), than 1.5 (-0.5), than Round... CountInt=2 (BUG)
Third iteration: 1+2 (feedback prim), than 2.5 (-0.5), than Round... CountInt=2
Fourth iteration: 1+3 (feedback prim), than 3.5 (-0.5), than Round... CountInt=4 (BUG)


Are those real debug values or just your estimates?
Round Primitive(0.5) should output 1
Round Primitive(2.5) should output 3

It's not black magic, the Double stream round primitive just uses frndint:
http://x86.renejeschke.de/html/file_mod ... d_110.html

Note to myself: We should change that to SSE2 :mrgreen:
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Clock Accuracy - 10ms?

Postby Nowhk » Thu Feb 11, 2016 10:18 am

MyCo wrote:
Nowhk wrote:First iteration: 1+0 (feedback prim), than 0.5 (-0.5), than Round... CountInt=0
Second iteration: 1+1 (feedback prim), than 1.5 (-0.5), than Round... CountInt=2 (BUG)
Third iteration: 1+2 (feedback prim), than 2.5 (-0.5), than Round... CountInt=2
Fourth iteration: 1+3 (feedback prim), than 3.5 (-0.5), than Round... CountInt=4 (BUG)


Are those real debug values or just your estimates?
Round Primitive(0.5) should output 1
Round Primitive(2.5) should output 3

It's not black magic, the Double stream round primitive just uses frndint:
http://x86.renejeschke.de/html/file_mod ... d_110.html

Note to myself: We should change that to SSE2 :mrgreen:

Real debug values (I guess :lol: ):

Bug Round Double.fsm
(6.76 KiB) Downloaded 929 times

Play a note: it outputs 0 (on Round Primitive(0.5) Poly readout) and 2 (on Round Primitive(2.5) Poly readout), not 1 and 3.
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby TheOm » Thu Feb 11, 2016 11:48 am

This is known as "round to even".
This is done to reduce bias in numerical calculations.
It is not a bug.
TheOm
 
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: Clock Accuracy - 10ms?

Postby Nowhk » Thu Feb 11, 2016 12:02 pm

TheOm wrote:This is known as "round to even".
This is done to reduce bias in numerical calculations.
It is not a bug.

Oh I see, thanks TheOm. So this is not a bug at all, even if MyCo supposed it here.

Then, I guess that in the new version that seems to be fixed you just change the way "tie-breakinground" is managed: from "half to even" to "half down", right?

Anyway, the problem above stay: the Wave Player never reads odd values, but it still play a sample perfectly.
How is this possible?
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby TheOm » Thu Feb 11, 2016 12:50 pm

No, MyCo is talking about the int() function. That is indeed a bug (or at least unexpected behaviour).
But the int function is strange anyway because it is not documented in the User Guide.
And in my version of FS(3.0.8.1) from what I can see it only affects the first SSE channel, so it was fundamentally broken anyway.

Nowhk wrote:Anyway, the problem above stay: the Wave Player never reads odd values, but it still play a sample perfectly.
How is this possible?

I think you have some fundamental misunderstanding here. The rounding mode (like round to even) only affects the behaviour when the value is exactly in between two whole numbers.
TheOm
 
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: Clock Accuracy - 10ms?

Postby Nowhk » Thu Feb 11, 2016 12:59 pm

TheOm wrote:No, MyCo is talking about the int() function. That is indeed a bug (or at least unexpected behaviour).
But the int function is strange anyway because it is not documented in the User Guide.
And in my version of FS(3.0.8.1) from what I can see it only affects the first SSE channel, so it was fundamentally broken anyway.

TheOm wrote:I think you have some fundamental misunderstanding here. The rounding mode (like round to even) only affects the behaviour when the value is exactly in between two whole numbers.

Yes, Tie-breaking: "Rounding a number y to the nearest integer requires some tie-breaking rule for those cases when y is exactly half-way between two integers — that is, when the fraction part of y is exactly 0.5."

I can have part of y when it's exactly 0.5 in the example: after it get feedback of itself (let say 2), 0.5 is subtracted; thus 1.5 after Round should be 1, not 2:

Immagine.png
Immagine.png (11.36 KiB) Viewed 19912 times

I'm missing all odd values, since all input is an integer (playing sample at original pitch) less 0.5, in a range between 0 and wavefile size.
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Clock Accuracy - 10ms?

Postby tulamide » Thu Feb 11, 2016 1:03 pm

*popcorn ready* :mrgreen:
"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 TheOm » Thu Feb 11, 2016 1:30 pm

But it works out perfectly, see:
CountInt = round(Input - 0.5)
Input is 2, that means CountInt = round(2 - 0.5) = 2
CountFrac is Input - CountInt, which is 2 - 2 = 0.
WavePlayer always reads (1.0-CountFrac) * sample[CountInt] + CountFrac * sample[CountInt+1]
(simple linear interpolation)
which in this example turns out to be:
(1.0 - 0.0) * sample[2] + 0.0 * sample[3] = sample[2]
which is exactly what it should be.

Now try with Input = 3 (odd number)
CountInt = round(3 - 0.5) = 2
CountFrac = 3 - 2 = 1
(1.0 - 1.0) * sample[2] + 1.0 * sample[3] = sample[3]
works exactly like it's supposed to.
TheOm
 
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

PreviousNext

Return to General

Who is online

Users browsing this forum: Majestic-12 [Bot] and 73 guests