## Same noise reproduced on every executation possible?

**Moderator:** Moderators

### Same noise reproduced on every executation possible?

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.

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

### Re: Same noise reproduced on every executation possible?

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(2

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(2

^{15}) to answer that. But if the answer is yes, it implies a yes answer for Banshaku's question.- rainwarrior
**Posts:**7824**Joined:**Sun Jan 22, 2012 12:03 pm**Location:**Canada-
**Contact:**

### Re: Same noise reproduced on every executation possible?

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.

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

### Re: Same noise reproduced on every executation possible?

@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!

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!

### Re: Same noise reproduced on every executation possible?

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".tepples wrote:Related question: Is there a sequence of 32767-step and 93-step clocks that ends up in a single defined state?

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.

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.rainwarrior wrote:The noise LFSR is seeded with all zeroes on reset, AFAIK.

edit:

But ittepples 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.

*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.

### Re: Same noise reproduced on every executation possible?

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.

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.