Looped Noise in ppmck Channel D @1

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

Post Reply
User avatar
8bitmatt
Posts: 31
Joined: Wed Feb 02, 2011 2:24 pm
Location: Oklahoma
Contact:

Looped Noise in ppmck Channel D @1

Post by 8bitmatt »

Is it possible to make the 'looped noise' actually work with ppmck?

When trying to use @1 (or even @0) on the D channel (as described here) you get an error when compiling.

Code: Select all

8: Unuse command in this track
Using ppmck "release 8" shows the error but still compiles. Using ppmck "release 9 ex5" (the latest I've been able to find) shows the error and fails to compile. Remove the @1 or @0 on channel D and both versions compile with no errors.

This really complete ppmck guide doesn't mention the looped noise option. Although at the bottom in the "Quick Track Table" section, it does suggest that the command should be available.
ionustron
Posts: 34
Joined: Wed Apr 14, 2010 12:25 pm

Post by ionustron »

You can activate it with a simple pitch envelope.
cak
Posts: 34
Joined: Mon Jun 28, 2010 8:35 pm
Location: oregon

Post by cak »

@EP0={-4 | 0}
@EP1={16 | 0}
@EP2={12 | 0}
D t120 o0 v8 c d- d e- e f g- g a- a b- b EP0 a- a b- b
D t120 o0 v8 EP1 c d- d e- e f g- g a- a b- b EP2 a- a b- b
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 521
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Post by Jarhmander »

You can simply use "D16" in the D track.

Use EP macros when you want to activate/deactivate looped noise in a macro.
User avatar
8bitmatt
Posts: 31
Joined: Wed Feb 02, 2011 2:24 pm
Location: Oklahoma
Contact:

Post by 8bitmatt »

Thanks guys! This is great! I literally spent a few hours last night trying to find this info to no avail. It's amazing how many dead links there are when searching for mml stuff.

~J-@D!~ wrote:You can simply use "D16" in the D track.
Use EP macros when you want to activate/deactivate looped noise in a macro.
This rules. I get no errors when compiling and its works as expected. So why does this work? What is the command doing?
ionustron
Posts: 34
Joined: Wed Apr 14, 2010 12:25 pm

Post by ionustron »

~J-@D!~ wrote:You can simply use "D16" in the D track.

Use EP macros when you want to activate/deactivate looped noise in a macro.
Weird. I abuse ep with noise more than I should so I never noticed that one!
cak
Posts: 34
Joined: Mon Jun 28, 2010 8:35 pm
Location: oregon

Post by cak »

8bitmatt wrote:Thanks guys! This is great! I literally spent a few hours last night trying to find this info to no avail. It's amazing how many dead links there are when searching for mml stuff.

~J-@D!~ wrote:You can simply use "D16" in the D track.
Use EP macros when you want to activate/deactivate looped noise in a macro.
This rules. I get no errors when compiling and its works as expected. So why does this work? What is the command doing?
"D" is detune...it works on all channels except E (I think).

I've never tried it on the noise channel...brilliant find ~J-@D!~!
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 521
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Post by Jarhmander »

8bitmatt wrote:Thanks guys! This is great! I literally spent a few hours last night trying to find this info to no avail. It's amazing how many dead links there are when searching for mml stuff.

~J-@D!~ wrote:You can simply use "D16" in the D track.
Use EP macros when you want to activate/deactivate looped noise in a macro.
This rules. I get no errors when compiling and its works as expected. So why does this work? What is the command doing?
I don't have th esource here, so I can be wrong.

But basically, PPMCK encodes notes into a byte with the high nibble being the octave and the low nibble, the scale. With harmonic channels, the lower nibble is used to find a frequency and the octave information alter the frequency (on most channels, which are period-driven, it should be used to shift right N times, N being octave).

With the noise channel though, octave information is discarded and there is no frequency table, instead the lower nibble is used directly, altered with the current pitch offset (either with D and/or EP macro) and is written to $400E.

This is the $400E register according to apu_ref.txt:

Code: Select all

$400E   s--- pppp   short mode, period index
We must know to that for period-based channels, the current pitch offset is substracted from the calculated frequency value instead of being added; when doing "A D3 c e g" for example, pitch goes up (intuitively).

What "D16" does to the noise channel though, is substract "16" from the note lower nibble, giving values in the range $F0 - $FF, and writing those values to $400E will activate the short looped noise.
Post Reply