VIDEO TEST 0004: Demonstrating SSG Hardware Envelopes in #PMD98 #MML
Silent Sinner in Scarlet’s Video Test #0004
Demonstrating that KAJA’s PMD98 (Professional Music Driver for NEC PC-9801 & PC-9821) can support playback of SSG hardware envelopes, albeit not in a straightforward way. It all boils down to programming specific frequency, signal-type (tone/noise/both/neither), volume, & envelope-shape ([reverse/normal] sawtooth/triangle/etc.) instructions exclusively via register-write & rest commands (rather than the usual note/volume/mode commands) for everything happening in the channel where envelopes are to be used (including traditional non-envelope notes). Why only register (MML: y) & rest (MML: r) commands & not pitch-interval (MML: c/d/e/f/g/a/b -/=/+), detune (MML: D), noise-period (MML: w), volume (MML: V/v), or tone/noise-mode (MML: P) commands? Because for some reason, anytime a typical note command is issued, envelope-specific register writes fail to materialize (at least in software emulation – I have not tested this behavior in real hardware because I don’t own a PC-98).
So, resorting exclusively to register writes to pull off this 18-minute-long test, here I demonstrate (via Aaron Giles’ YMFM emulation core, as implemented by C60 into PMDWin.dll 0.50 & later versions –current version in use is 0.52– & used in FMPMD2000) the various types of signals (or “notes”) the SSG can produce within one same channel by invoking tone, noise, & envelope modes in isolation as well as combinations of any or all of them:
0:00 (intro)
0:01 No Oscillation (DC pulse; MML mode P0 at V15)
0:02 Pure Tone (square wave, C₁ to B₈; MML mode P1)
0:34 Pure Noise (periods w31 to w1; MML mode P2)
0:42 Tone+Noise (C₁~B₈ square + w31/w16/w4/w1 noise; MML mode P3)
2:49 Pure Envelope (C₁~B₄ reverse sawtooth, C₁~B₃ reverse triangle, C₁~B₄ sawtooth, & C₁~B₃ triangle)
3:45 Envelope+Tone (C₁~B₃/B₄ rev.saw/rev.tri/saw + B₅/B₆/B₇/B₈ square)
6:40 Envelope+Noise (C₁~B₃/B₄ rev.saw/rev.tri/saw + w31/w16/w4/w1 noise)
9:36 Envelope+Tone+Noise (C₁~B₃/B₄ r.saw/r.tri/saw + B₅/B₆/B₇ square + w16/w4/w1 noise)
16:10 Preset Drums (@1 @2 @4 @8 @16 @32 @64 @128 @256 @512 @1024 @2048 @4096 @8192)
16:25 (MML nXXX SFXs absent, please read video description)
For this test, SSG channel #3 (#2 in hoot... Sound Hardware Emulator) –mapped to MML channel I– was used as the output sound channel, even though all three SSG channels (& the first three FM channels) have been used in the MML code to execute the register commands, this to simplify the code into parallel execution loops (& exploiting the fact that the PMD driver doesn’t read all channels at once but rather sequentially). I discovered that PMD reads MML channels in the following order:
G, H, I, (D, E, F,) A, B, C, [C2, [C3, [C4,]]] (J,) K, {PPZ1, {PPZ2, {PPZ3, {PPZ4, {PPZ5, {PPZ6, {PPZ7, {PPZ8}}}}}}}}
(parenthesized FM4/5/6 channels D, E, & F, & ADPCM channel J, if used, can only send y$XX register writes to the Yamaha YM2608/OPNA’s back port 0x1XX whereas SSG-specific registers are in the front port 0x0XX, so any y commands issued there have no effect on the SSG chain of command other than delaying subsequent register writes from other channels)
[bracketed FM3-extended channels C2, C3, &/or C4 – as specified in MML property #FM3Extend, i.e. XYZ, abc, def, etc.; the execution order here is carried out as slot1, slot2, slot3, slot4. Example: C, a, b, c if MML maps C→slot1/s1, a→slot2/s2, b→slot3/s4, & c→slot4/s8]
{braced PMDPPZ channels PPZ1 to PPZ8 – as specified in MML #PPZExtend, i.e. STUVWXYZ}
Two big disadvantages of this method of playing notes via register writes instead of simple note commands (at least in emulation):
① SSG#3 (channel I) can no longer be muted by FMPMD2000’s (& also Winamp in_FMPMD plugin’s) mask subpanel, so isolating any other channels from any project making use of SSG hard envelopes thru this register-manipulation method will require that a variant (with no y$X commands writing to SSG#3) be compiled.
② MML commands n1 to n127 (for SSG preset sound effects) no longer work, even in channel I; at least the first 13 of those (n1~n13) are the same as preset drums @2~@8192, which together with @1 are normally played thru SSG#3 via Rxx macros executed in virtual channel K (which still works).
For the oscilloscope view, an external-trigger waveform (using only pure-square & pure-reverse-sawtooth notes) was used to ensure the square shapes in P3 tone+noise notes & the envelope shapes remain consistently aligned (or, at least, stable in time for the case of triangle notes, as you see in the video).
Tools used:
KAJA’s MML compiler MC.EXE (PMD 4.8S)
C60’s FMPMD2000 0.31 (PMDWin.dll 0.52)
Audacity 2.3.1
nyanpasu64’s corrscope 0.8.1 (+ FFmpeg 5.0-essentials)
GNU Image Manipulation Program (GIMP) 2.10
VapourSynth R62
VirtualDub2 build 44282
Special thanks:
🌸 Hakurei 🌸 (on Discord): for discussion about envelopes & SSG registers.
@High_Quality_Nintendo_OSTs: for how to do external triggering in corrscope.
Other Videos By SilSinn9801/Silent Sinner In Scarlet
Other Statistics
Counter-Strike: Source Statistics For SilSinn9801/Silent Sinner In Scarlet
SilSinn9801/Silent Sinner In Scarlet currently has 136 views spread across 1 video for Counter-Strike: Source. His channel published less than an hour of Counter-Strike: Source content, or 5.20% of the total watchable video on SilSinn9801/Silent Sinner In Scarlet's YouTube channel.