Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
doPNSequence question
No permission to create posts
July 3, 2017
5:34 pm
Avatar
madara
New Member
Members
Forum Posts: 2
Member Since:
June 30, 2013
sp_UserOfflineSmall Offline

Hello,

What would I do to change this function to work with doubles in 64 bit environment?

July 4, 2017
10:08 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

First, the output of the function is still a double, though internally it uses a 32-bit shift register (unsigned int). To alter it, you would first need to change that uPNRegister variable from UINT to uint64_t to guarantee you have a 64-bit register.

Next, see the Datorro paper which is the original source of that particular PN generator here:

https://ccrma.stanford.edu/~dattorro/EffectDesignPart3.pdf

Go to table 9 and look at the last column, last row for 64-bit shift registers. It contains the formula for XOR-ing the bits from the 64-bit shift register. Alter the function doPNSequence( ) accordingly. Then in the conversion statement, you'd divide by 2^64 rather then 2^32, casting the variables as doubles rather than floats. You may need to experiment with the division by 16.0 in the last part of that function to get your output on the desired range of [-1.0, +1.0]. The paper has all the details you need to make the PN generator with any sized shift register.

- Will

July 4, 2017
12:13 pm
Avatar
madara
New Member
Members
Forum Posts: 2
Member Since:
June 30, 2013
sp_UserOfflineSmall Offline

Got it.  Thank you Will.  The book is very clear and understandable and the amount of time, research and testing that you must have put into it is very much appreciated.  Smile

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143