It is currently Wed Sep 19, 2018 11:20 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Aug 28, 2018 7:26 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1940
Location: Fukuoka, Japan
From what I understand, the noise channel uses some random seed that would influence what will come out of it and must be defined at power on (I guess). What I would like to know is if there is a way to "reset" that seed so the same sound could be reproduced every time, on request?

I'm curious and just want to know if it is possible or not and why is that so.


Top
 Profile  
 
PostPosted: Tue Aug 28, 2018 7:38 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20558
Location: NE Indiana, USA (NTSC)
I assume you want to reset the noise LFSR without using the "test mode" at $4018-$401A. But even that allows only a triangle phase reset, not noise.

Related question: Is there a sequence of 32767-step and 93-step clocks that ends up in a single defined state? I imagine it'd take deep math in finite field GF(215) to answer that. But if the answer is yes, it implies a yes answer for Banshaku's question.


Top
 Profile  
 
PostPosted: Tue Aug 28, 2018 7:54 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6804
Location: Canada
The noise LFSR is seeded with all zeroes on reset, AFAIK. If you wanted to count cycles from that point, you could guarantee its sound.

If you're asking whether you can reseed it at will in the middle of execution? No.


Top
 Profile  
 
PostPosted: Tue Aug 28, 2018 8:05 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1940
Location: Fukuoka, Japan
@rainwarrior

Yes, this is what I meant: execute a sound fx, reset the seed, execute it again with the same sound. One effect I had sounds better on the first run in famitracker. Once you execute it many time, it doesn't sound the same anymore. If it was resettable that would been useful in one specific case only. Oh well!


Top
 Profile  
 
PostPosted: Tue Aug 28, 2018 9:11 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7522
Location: Seattle
tepples wrote:
Related question: Is there a sequence of 32767-step and 93-step clocks that ends up in a single defined state?
Hm. From a probabilistic point of view, exactly 1/4 each of all 32768 states clock in a 0, a 1, the tonal noise mode bit "M", or "not M".
So ... it's not obviously the case that such a path will exist.

edit: but the real question is whether there's any usefully different probabilities between the state at a given time, and some finite number of clocks later. Obviously the only correlations would be after some combination of 8, 13, and 13-8 clocks (e.g. starting from state 256, which becomes either 512 or 513 depending on "M". When 512 or 513 hit 8192 or 8208, the value of the "M" bit will matter again:
256 -nM→ 512 → 1024 → 2048 → 4096 → 8192
256 -M→ 513 → 1026 → 2052 → 4104 → 8208
8192 -nM → 16385 → 3 → 6 → 12 → 24 → 48 → 96 → 192 → 384
8192 -M→ 16384 → 1 → 2 → 4 → 8 → 16 → 32 → 64 → 128 → 256
8208 -nM→ 16417 → 67 → 134 → 268
8208 -M→ 16416 → 65 → 130 → 260

But I don't think I have enough knowledge to handle this.

rainwarrior wrote:
The noise LFSR is seeded with all zeroes on reset, AFAIK.
To be clear: the noise LFSR just happens to have all 0s on initial power up. A warm reset (or even an "insufficiently" cold boot) won't reset its contents.

edit:
tepples wrote:
I assume you want to reset the noise LFSR without using the "test mode" at $4018-$401A. But even that allows only a triangle phase reset, not noise.
But it does let you read out the current noise LFSR state, and because LFSRs, reading 15 bits from it will let you know what the current contents are, and knowing the current state lets you calculate a path to any desired state.


Top
 Profile  
 
PostPosted: Mon Sep 03, 2018 9:09 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7522
Location: Seattle
Just to follow up on this, because the problem is small enough to be brute-forceable... (2^30)

There is no sequence of clocking the noise channel with your choice of "M" bit set or not set after each clock such that starting from an unknown state will converge on a known state.

From all possible starting states, for all possible 15-clock sequences, you can count the number of bits set. It you sum these bit counts, grouping by sequence, this sum is always 245760, or exactly 32768×7.5. If it were going to converge on some known state, the average would have to converge on an integral number of bits.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group