It is currently Sun Sep 15, 2019 11:02 pm

 All times are UTC - 7 hours

 Page 1 of 1 [ 6 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Same noise reproduced on every executation possible?Posted: Tue Aug 28, 2018 7:26 pm

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2312
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

 Posted: Tue Aug 28, 2018 7:38 pm

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21591
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.

_________________
Pin Eight | Twitter | GitHub | Patreon

Top

 Posted: Tue Aug 28, 2018 7:54 pm

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7582
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

 Posted: Tue Aug 28, 2018 8:05 pm

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2312
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

 Posted: Tue Aug 28, 2018 9:11 pm

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8557
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

 Posted: Mon Sep 03, 2018 9:09 pm

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8557
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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 6 posts ]

 All times are UTC - 7 hours

#### Who is online

Users browsing this forum: No registered users and 1 guest

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

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2019 NESdev Competition       2018 NESdev Competition       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki