VOGONS


First post, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie

Wikipedia states this "feature" was removed in the YMF262 (OPL3), but I don't know what this "feature" even is, what it's sound like, what it's for... I've seen a few, very few DOS games and programs that make use of the RHYTHM but not this "composite sine mode" Wikipedia lists.

Anybody have any idea what this even is?

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 1 of 14, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie

It was meant to be used for speech synthesis I think. Never tried it myself but I guess setting all operators to use sine waves and additive synthesis would be the same thing.

Reply 2 of 14, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie

Speech synthesis? Like how it was done on Slipheed on the NEC PC-8801?

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 3 of 14, by Lord Nightmare

User metadata
Rank Newbie
Rank
Newbie

It's CSW (composite Sine Wave) synthesis; it also involves the two opl2 timers, and I believe it works almost identically to how it works on other chips like the ym2612 used on the sega genesis. One timer controls pitch, the other controls maybe pulse width?

Edit: CSW speech synthesis for dummies: do LPC analysis of speech. find all the peaks (these are most likely your formants). place a sine wave at each peak starting at the highest one, going down until you run out of sine waves. move around the sine waves each frame (i.e. <=~50ms period) as the peaks change and move.

Edit2: the lowest frequency high peak is most likely your pitch/first formant/'f0'. There are complicated mathematical ways to best estimate the fundamental pitch, or simpler/less accurate ways which are analog (gold) or digital using voting between 5 algorithms (gold-rabiner), and more still. Some simply use the highest peak as the fundamental frequency/pitch.

See wikipedia article on "Sinewave synthesis" for more info.

LN

Last edited by Lord Nightmare on 2014-08-12, 00:23. Edited 3 times in total.

"When life gives you zombies... *CHA-CHIK* ...you make zombie-ade!"

Reply 4 of 14, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie

I don't know how Silpheed did it, but the general idea would be to deconstruct a speech sample into multiple sine waves using discrete Fourier transformation, then you can add these sine waves together to recreate the original sample.

In fact you could create just about any sound, as long as you have enough sine wave oscillators.

Reply 5 of 14, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie

This is getting interesting. But I don't suppose there are any readily available demos that test this mode? And is it emulated in DosBOX's OPL emulator? I don't have a system in this house that can turn on that can use a legit OPL2 chip. (nor do I think my father even has a old soundblaster with a legit YM3812)

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 7 of 14, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie

It's pretty easy to see/hear why the CSM mode was excluded from the OPL3, given the pre-processing requirement of the samples, and rather lackluster playback quality. The PWM method, which works equally well on both the OPL2 and OPL3, is arguably the better means of digital-audio playback from the OPL chips.

On the other hand, applying CSM techniques to create a singing Sound Canvas is just flat-out awesomesauce. Here's a thread on the QuestStudios forum with links to videos demonstrating MIDI-based CSM:

http://queststudios.com/smf/index.php?topic=3502.0

Reply 8 of 14, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie

I can't watch any of the links because of a lack of HTML5 player on that website linked in the forum post......

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 9 of 14, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
DracoNihil wrote:

I can't watch any of the links because of a lack of HTML5 player on that website linked in the forum post......

Hmm. The "mobile" player applet works with both IE9 and Chrome. You can get around the HTML5 requirement by using the player in the main "NicoVideo" website though (which requires an account).

Reply 10 of 14, by DracoNihil

User metadata
Rank Oldbie
Rank
Oldbie

The applet that pops up in a popup window needs flash, I don't want to use flash I want to watch with Firefox\Pale Moon's built in HTML5 support. Or VLC if that's possible too.

“I am the dragon without a name…”
― Κυνικός Δράκων

Reply 12 of 14, by Roxor

User metadata
Rank Newbie
Rank
Newbie

The thing I'd like to know about this mode is: How do you actually use it?

The Adlib Programming Guide mentions it, then promptly dismisses it saying there are better-quality methods of speech synthesis available. The register map in that document gives which bit in which register to set to enable it, but that's it, and the datasheet for the OPL2 isn't any more informative.

Maybe you're just expected to play around until you get it working? Unfortunately, the closest I can get to a system with an OPL2 in it is DOSBox, and I don't really expect the developers to have been perfectionists enough to implement a virtually-unused feature when they had more-pressing problems to concern themselves with.

Ah, well, I suppose I can always try my hand at implementing the sinewave speech synthesis technique in PureData, just to see if I understand it properly. That could be a fun afternoon.

Reply 13 of 14, by Tiido

User metadata
Rank l33t
Rank
l33t

On other OPx chips it is a mode where one timer controls key on/off bits to precisely control duration of sound output from ops on a specific channel. It is a small amount of assistance from hardware to do formant based speech synthesis. I don't know what is the special channel where this is doable on OPL2 though, the application manual of YM3812 doesn't go into any details either...

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 14 of 14, by Roxor

User metadata
Rank Newbie
Rank
Newbie

I've just spent some time looking through the MAME OPL1/2 emulation code. Seems the answer to which channel the mode applies to is "all of them".

When Timer A resets, it triggers a function called CSMKeyControll() on each of the nine channels. Here's the function (from https://github.com/mamedev/mame/blob/master/s … sound/fmopl.cpp):

void CSMKeyControll()
{
SLOT[SLOT1].KEYON(4);
SLOT[SLOT2].KEYON(4);

/* The key off should happen exactly one sample later - not implemented correctly yet */

SLOT[SLOT1].KEYOFF(~4);
SLOT[SLOT2].KEYOFF(~4);
}

If I'm understanding it correctly, it seems like it turns both operators on then off again, so they would run through the release phase of their ADSR envelopes. Not sure how much of a difference the bug noted in the comments makes, though.

Some additional searching shows this file is present among the DOSBox sources, so it looks like DOSBox implements CSM mode identically to MAME.

While I'm still not quite sure how to use CSM mode, this does at least get me close enough to understanding how things work that I can see some potential avenues to take.