It is currently Fri Dec 15, 2017 1:19 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Noise Test Program
PostPosted: Tue Nov 14, 2017 3:06 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 928
Location: Sweden
Nothing special and I'm sure similar programs have been made before, but here is a quick noise channel test program made by request to be used to quickly test if the looped noise test mode flag works on real Famicoms via a flashcart or other devcart solution. I'm posting it here so that it becomes hosted, and in case someone would need it. It's stitched together from several general purpose routines from my own personal library, so it may have lots of redundant code that's never executed.

If someone spots any bugs, mistakes or have other suggestions regarding it, just shout here.

Image


Attachments:
File comment: Noisy V1.0
noisy.7z [21.45 KiB]
Downloaded 28 times
Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Tue Nov 14, 2017 4:08 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
I like it. Pretty simple and easy to use. Maybe didn't expect to have to press A to apply settings but that's an arbitrary choice I guess, was easy to understand anyway.


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Wed Nov 15, 2017 5:14 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 928
Location: Sweden
Thanks! Yeah I first planned it to change settings as soon as you select them, but this was easier to do.

Not sure if looped noise is the best term though? I've also seen the term periodic noise. If I understand it correctly, looped noise means that the random wave pattern is shorter or loops faster which makes it more tonal in most pitch settings (pitch $0F doesn't seem to sound any different with the flag set or cleared). Neither terms looped or periodic makes sense to me, the period of a wave is always looping right?


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Wed Nov 15, 2017 8:52 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
Both "periodic" and "looped" describe what it does. Technically it's always looped, but the loop is just much longer (like 300 times longer). With this mode on, the loop is short enough to play a pitch on most of its frequencies, rather than a just a repeating noise, the threshold for that is somewhere around 10Hz.

So... the lowest frequency $F is too low to be a pitch, maybe ~2Hz when it's in periodic mode, but it's more like 0.006Hz when it's not. A fast loop repeating twice a second vs. one that's minutes long, too long to notice the looping. Around about $C the periodic mode starts turning into a musical pitch where instead of a repeating noise you just hear a tone.

You should be able to hear a difference in all of them, but not all of them become a pitch.

The actual mode is kind of a short circuit of the LFSR that generates the noise, moving the tap to send the feetback into the LFSR more frequently. The shorter sequence that comes out changes depending on what state it was in when you turned on the periodic noise mode, so the pitched sound changes in character if you turn periodic mode on and off.

So as for terminology, I think "periodic" or "looped" are both fine, though if you want to get more precise maybe it's a "short period" or "short loop" mode? The idea is just that the period/loop becomes pretty noticeable in this mode. Sort of funnily, the length of the period of $0F in periodic mode is similar to the length of $01's period in non-periodic mode (but running at a much lower frequency). The range of rates is wide enough that it overlaps in this respect.


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Wed Nov 15, 2017 9:33 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6526
Location: Seattle
The period-93 mode has the interesting additional property that it randomly contains a very loud 31st harmonic. There's no way for the CPU to detect whether it's in this mode (short of modifying the NES), so it's hard to use intentionally.

Previous things I've said:
3d graph of first 3 harmonics being random
A cold boot can get a very specific waveform from the period-93 mode that's musically useful

That said, the ×31 harmonic does mean that the very low rates actually become useful in tonal noise mode; the slowest rate there does repeat at 5Hz but it also has a conspicuously audible tone at 147Hz.


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Wed Nov 15, 2017 10:01 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
Could you add a "semi-periodic" mode that toggles 93-step mode on and off by frames? The hi-hat sound in my NES chiptunes since 2011 alternates $03 and $83.


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 3:29 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 928
Location: Sweden
Thanks for the explanation. So the mode flag cuts the period short enough to sound musical (in most pitches), although it's still really a random pattern generated by the hardware random generator.

I think "short period" describes it the best, but on the other hand "looped" take the least screen space, so I guess it's fine like it is. :)


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 3:45 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1128
Location: Gothenburg, Sweden
So tepples' hi-hat is one example of use. My two others are
-tiny bell/triangle (the instrument, not the waveform) approximations and
-error signals / "quirky machine sounds".

Sivak used the "error buzz" effect for the logo screen.
What else do you use it for?

I presume it would have some musical relevance if you detuned all other channels to match it, but then again you're confined to it 1)not being chromatic, 2)being a bit random in timbre as described.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 7:42 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
I use looped noise for an error buzz when the user is packing an order to ship out but scans a product that isn't on the order. (Yes, you read that right. I use FamiTracker to build sound effects for my employer's internal web application.)

The Curse of Possum Hollow uses it for a couple bosses (see attachments).

It's more useful on Game Boy where I can coax decently tuned C, D, F, and G# notes out of it.


Attachments:
File comment: Implies mechanical nature of the furnace
steelmillboss.ogg [444.36 KiB]
Downloaded 9 times
File comment: Attempts "melody"
crowboss.ogg [636.32 KiB]
Downloaded 10 times
Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 8:33 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
Sometimes it's just useful to be able to make a pitched sound effect that interrupts the noise channel rather than one of the squares.

It's very good for a "triangle" type sound (percussion instrument, not waveform), like in Solstice.

Often I like 1 frame of periodic noise at the start of an otherwise non-periodic noise instrument. It's good for a "metallic" chip at the start of the sound; sometimes that's good for suggesting something like a cymbal. Sometimes this is just useful for making a different sound that pokes through the rest of the noise, suggesting an extra voice of percussion that can play in its own independent rhythm.

The opposite, 1 frame of noise followed by periodic can be nice just to put an edge on the attack of the triangle type percussion too; not really trying to simulate its realistic sound, but still a useful way to give its attack some defined character.

Tepples mentioned an instrument that alternates between periodic and non every frame, which creates kind of a "fluttery" noise sound; I find this can be really good for sustained cymbal instruments, like a cymbal roll.

Shiru's LAN Master game uses periodic noise constantly for buzzing/beeping noises in the background music. Mega Man 2's Quick Man stage makes similar prominent use of it.

Sometimes people have tried to use the pitches of the noise unit to make melodies. Sivak's jingle was mentioned. I think B00daW did a few little tunes like this but I can't find them right now. Did tepples use it like this for a NIN cover? (Memory hazy.) This is kind of a problem if you want to support both NTSC and PAL, since they have different pitches. (Similar problem to DPCM.)

Anyhow, it's just another sound that you can use. If you try it out and remember the sound, maybe you'll occasionally think of places it might fit. Also, depending whether or not you care about the early Famicom that didn't have it, you may want to test everything with periodic noise disabled just to make sure it still sounds OK without it.


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 8:46 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
rainwarrior wrote:
Sometimes people have tried to use the pitches of the noise unit to make melodies. Sivak's jingle was mentioned. I think B00daW did a few little tunes like this but I can't find them right now. Did tepples use it like this for a NIN cover? (Memory hazy.)

On the Game Boy, not the NES. The pitches of Game Boy looped noise are exactly those of "Wish" from Broken.


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 9:44 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
I think this is the thing by b00daw I was thinking of, but it doesn't really use noise as a melody, it's mostly an experiment with using 360Hz update rates, it seems:
https://forums.nesdev.com/viewtopic.php?f=6&t=9126

Sort of related, I once wrote a short piece of music around the NTSC DPCM frequencies and retuned everything else to match it:
https://forums.nesdev.com/viewtopic.php?p=92494#p92494

The equivalent is possible for noise, to some extent, but even with the DPCM scale I thought found it too restricting. It was fun to write that one little tune, but I doubt I'll ever try to write more music with that technique. (Sometimes harsh limitations can stimulate interesting ideas, but I'm tapped out for that one.)


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 10:25 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6526
Location: Seattle
rainwarrior wrote:
The equivalent is possible for noise, to some extent, but even with the DPCM scale I thought found it too restricting. It was fun to write that one little tune, but I doubt I'll ever try to write more music with that technique. (Sometimes harsh limitations can stimulate interesting ideas, but I'm tapped out for that one.)
It doesn't help that the frequencies on an NTSC deck (in period 93 mode) are ~45cents out of tune with A440, while the 31st harmonic is in tune with A440.

Code:
 div 93freq 12TETA440 3freq    12TETA440
   4 4811.2 D-8+41.0 /149147.7 ultrasonic
   8 2405.6 D-7+41.0 / 74573.9 ultrasonic
  16 1202.8 D-6+41.0 / 37286.9 ultrasonic
  32  601.4 D-5+41.0 / 18643.5 ultrasonic
  64  300.7 D-4+41.0 /  9321.7 D-9-14.0
  96  200.5 G-3+39.0 /  6214.5 G-8-15.9
 128  150.4 D-3+41.0 /  4660.9 D-8-14.0
 160  120.3 B-2-45.3 /  3728.7 A#7-0.3
 202   95.3 G-2-48.9 /  2953.4 F#7-3.8
 254   75.8 D#2-45.4 /  2348.8 D-7-0.4
 380   50.6 G#1-42.8 /  1570.0 G-6+2.2
 508   37.9 D#1-45.4 /  1174.4 D-6-0.4
 762   25.3 G#0-47.4 /   782.9 G-5-2.3
1016   18.9 subsonic /   587.2 D-5-0.4
2034    9.5 subsonic /   293.3 D-4-2.1
4068    4.7 subsonic /   146.7 D-3-2.1


PAL is even more of a mess; the lower tones are pedantically still ~45cents out of tune, but the higher ones range all over place:
Code:
 div 93freq 12TETA440 3freq    12TETA440
   4 4469.4 C#8+13.4 /138550.6 ultrasonic
   8 2234.7 C#7+13.4 / 69275.3 ultrasonic
  14 1277.0 D#6+44.6 / 39585.9 ultrasonic
  30  595.9 D-5+25.1 / 18473.4 ultrasonic
  60  298.0 D-4+25.1 /  9236.7 D-9-29.8
  88  203.2 G#3-37.9 /  6297.8 G-8+7.1
 118  151.5 D#3-45.8 /  4696.6 D-8-0.7
 148  120.8 B-2-37.9 /  3744.6 A#7+7.1
 188   95.1 F#2+47.9 /  2947.9 F#7-7.1
 236   75.8 D#2-45.8 /  2348.3 D-7-0.7
 354   50.5 G#1-47.7 /  1565.5 G-6-2.7
 472   37.9 D#1-45.8 /  1174.2 D-6-0.7
 708   25.3 G#0-47.7 /   782.8 G-5-2.7
 944   18.9 subsonic /   587.1 D-5-0.7
1890    9.5 subsonic /   293.2 D-4-2.6
3778    4.7 subsonic /   146.7 D-3-1.7


By "93freq" I mean the lowest frequency represented by the LFSR when it's in "short" mode. By "3freq" I mean the frequency that's the Very Loud 31st harmonic. (93÷31=3)


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 10:45 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
lidnariq wrote:
It doesn't help that the frequencies on an NTSC deck (in period 93 mode) are ~45cents out of tune with A440

Wait, to me that sounds helpful?

Like the DPCM frequencies are all consistently out of tune by a factor of 17/16 because of that off-by-one error in its loop implementation. I shifted the tuning tables in that NSF to compensate.

If the noise frequencies are a fairly consistent deviation from A440 then that in itself is helpful, because it can be compensated by tuning to A440 + 45 cents instead of A440.


Top
 Profile  
 
 Post subject: Re: Noise Test Program
PostPosted: Thu Nov 16, 2017 10:53 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6526
Location: Seattle
It was the contrast I was attempting to call out. The "fundamental" is a quartertone off relative to the louder 31st harmonic; only one or the other is in-tune with 12TET regardless of your tuning reference.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 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