Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - How does time multiplexing work on the YM2413 OPLL?

Reply to topic
Author Message
  • Joined: 24 Sep 2018
  • Posts: 66
Reply with quote
How does time multiplexing work on the YM2413 OPLL?
Post Posted: Sun Apr 19, 2020 5:43 pm
One of the facts that is often reported about the YM2413 is that its built-in DAC outputs only one channel at a time, switching between them rapidly. Which saves some arithmetic.

Question: what is the schedule of that switching?

Relevants facts: there are 72 cycles between every internal 'tick'. In full-melodic mode there are 9 channels, which is conveniently a divisor of 72. But in rhythm mode there are 11 potential sounds at a time — the 6 melodic channels plus the 5 drum sounds. 11 does not evenly divide 72.

That said, four of the five drum sounds use only a single operator each which means that they share channels in pairs, and the full-fat OPL2 has a per-channel non-FM mode, in which the modulator and carrier run independently and the channel is merely the sum of their output.

So perhaps the 11 noises in rhythm mode still form 9 channels, with 8, 4, 2 or 1 cycle spent per channel?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14685
  • Location: London
Reply with quote
Post Posted: Sun Apr 19, 2020 10:21 pm
There’s a lot of reverse engineering info at https://github.com/andete/ym2413/ and copies at https://www.smspower.org/Development/YM2413 . Since the melody and rhythm are output on separate pins, I suspect they operate independently.
  View user's profile Send private message Visit poster's website
  • Joined: 24 Sep 2018
  • Posts: 66
Reply with quote
Post Posted: Mon Apr 20, 2020 2:18 am
I immediately feel foolish re: melodic versus rhythm. From what I've read the rhythm section reuses ADSR envelopes so it definitely needs a DAC and therefore may end up in a single scheduling list despite the separate output but there's certainly no reason to assume that like there would be if everything were on a single pin.

I'll check out that repository; it's a shame it doesn't have a formal licence attached even though it is meant to communicate research rather than code. I'm otherwise primary working with the various dumps of internal ROMs that are now generally around — both the exact negative-log-sin table and the corresponding exponential tables from the OPL2 and the instrument banks from both the OPLL and the related VRC7*. I'm just starting out though, so I don't even really have my FM synthesis working properly; I'm not entirely clear why yet but hopefully just an attenuation error. Everything sounds too pure and sine-ish.

* which I've not seen anybody mention here, but here it is. Seemingly very fresh. Discovering that somebody smart had reverse-engineered that is what has motivated me finally to add FM synthesis to my emulator.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!