Skip to content

Super Cobra on co12294 and other sound chips

Original compositions, as well as ports and remixes of existing songs, can be posted in this forum, as long as they are in VGM format of course.

Moderator: Staff

Super Cobra on co12294 and other sound chips

Post by nitrofurano »

i was trying to convert a simple vgm tune, from Super Cobra (ay-3-8910, from msx1) to co12294 sound chip (Atari "Pokey"), just by editing a vgm file as hexdump

after trying this, it seems that converting vgm files, from one sound chip to another, seems to be not that hard (i'm curious about among yamaha ym chips! :D - counting with quality losses, obviously )

this one seems simple, since both ay-3-8910 and co12294 seems quite similar each other
Attachments
supercobra_playstart_co12294.zip
(1.98 KiB) Downloaded 266 times
Last edited by nitrofurano on 2019-01-09, 10:53:54, edited 1 time in total.

Post by nitrofurano »

and here is the ym2413 version
Attachments
supercobra_playstart_ym2413.zip
(1.87 KiB) Downloaded 264 times

Post by nitrofurano »

saa1099...
Attachments
supercobra_playstart_saa1099.zip
_
(2.02 KiB) Downloaded 250 times

Post by nitrofurano »

rp2a03 (nes apu) ...
Attachments
supercobra_playstart_rp2a03.zip
(1.19 KiB) Downloaded 221 times

Post by nitrofurano »

sn76489 (with some help from deflemask, for the germanic notation frequencies)
Attachments
supercobra_playstart_sn76489.zip
(1.91 KiB) Downloaded 234 times

Post by nitrofurano »

and k052539... (scc+)
Attachments
supercobra_playstart_k052539.zip
(2.02 KiB) Downloaded 223 times

Post by nitrofurano »

the original rip, ay-3-8910, with some cleanup on the hexdump (k052539 version is actually based on this one)
Attachments
supercobra_playstart_ay38910.zip
(866 Bytes) Downloaded 242 times

Post by nitrofurano »

a question: how easily can we do the same on other yamaha ym chips (like ym2203, ym2612, etc.) as i did with ym2413 above?

i guess it wouldn’t be that hard, since ym2413 seems to be the simplest yamaha ym chip, and we only need to choose the instrument, and work on the frequency and volume registers as i did on ym2413?

(about ym2203, i’m mentioning using the fm chanels only, not the ay-3-8910 ones)
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

For the YM2203 and its successors you have to setup the instrument manually by writing to registers 30/34/38/3C/40/.../98/9C and B0 (and B4 for YM2608 and later).
After doing that, you can write to the frequency registers and turn the tone on.

Post by nitrofurano »

does that mean we can‘t change each channel volume on the fly on ym2203 as we can do on ym2413?
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

You can change everything on the fly, but depending on the channel configuration the volume (stored in the TL registers at 0x4#) of certain operators will change the characteristics of the sound and not the volume.
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

You have to change the TL value of the carriers as specified by the algorithm.

The table below shows the amount of carriers for each algorithm. To change the volume of a channel without affecting the timbre, start from the last operator and go backwards, change the TL value until you've done this <n> times. This applies to the OPN and OPM chips (Nevermind the naming of the operators as M1, C1 etc in the YM2151 manual, that does not affect the algorithms).

Note that the TL register uses logarithmic steps, so each step of the TL register equals -0.75 dB. That means that you'll just have to add your volume change to the default value of the TL register as specified by the instrument. You might want to generate a lookup table if you use linear volume in your code.

Code: Select all

+-----------+----------+
| Algorithm | Carriers |
+----------------------+
| 0,1,2,3   | 1        |
| 4         | 2        |
| 5,6       | 3        |
| 7         | 4        |
+-----------+----------+

Post by nitrofurano »

still struggling to understand...
perhaps a simple vgm, or a register log, or something else, might help me understand better?
(trying to work on fm chips is something still very new for me, even after all these decades!!!! :D - i was more into psg chips)
  • User avatar
  • ValleyBell Offline
  • Posts: 4767
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Maybe you should start with OPL or OPL2 first - those feature only 2 operators per channel.
There is a decent reference here. (I think the OPL3 programmer's guide is a bit nicer, but the additional feature might make it a bit more confusing.)

For OPL channel 0, you set up the instrument by writing to registers 20/23/40/43/60/63/80/83/C0, then set the frequency (register A0/B0, those are similar to OPLL register 10/20).
If you set the connection type/algorithm to 0 ("FM"), then the volume is register 43 only. If it's set to 1 ("AM"), volume is in register 40 and 43.
The page also has an example instrument listed.

Post by nitrofurano »

i'm messing even with this "op" nomenclature! :D - i started this: https://etherpad.net/p/yamahaymchips
Post Reply