Chat

Author Topic: YM2612 Multi Frequency Mode AND CSM Mode  (Read 24707 times)

Offline marcb0t

  • Member
  • Posts: 123
YM2612 Multi Frequency Mode AND CSM Mode
« on: January 08, 2013, 01:39:23 AM »
Greetings Delek,

I am new here, but have been using your program for a few months, and really like it!

My favorite chipset is the YM2612 Genesis/MegaDrive set combined with the PSG and sampling. I grew up playing Genesis games, and I like the primitive FM sounds.

I read that you've already implemented the Multi Frequency Mode for Channel 3, but have not assigned an effect parameter to control it yet.

I wanted to request if you could add this soon, and also add the other Special Mode which is CSM Channel 3 control. It's an undocumented Special Mode that works on real hardware, but Yamaha failed to communicate this with Sega. Nemesis on the Spritesmind board discovered it's functionality through reverse engineering and playing around with the YM2612.

CSM mode is a formant synthesis controller according to my understanding, and you could technically make phoneme (words made out of vowel sounds) like older computer speech programs. Here is are a couple of posts that might be helpful for you implementing this feature:

http://gendev.spritesmind.net/forum/viewtopic.php?t=386&postdays=0&postorder=asc&start=75&sid=e30fd6c169bae0523b098b1d53032ec3

This one links to some assembly code where someone did CSM mode for a similar Yamaha FM chip. Perhaps this could be helpful?

http://gendev.spritesmind.net/forum/viewtopic.php?t=1231

I would really like to be able to make actual Mega Drive hardware phonetically sound out my avatar name: marcb0t  ;D

I understand you're busy with updating and programming, and you are doing an outstanding job. I'm really impressed with how much you seem to care about perfecting your software, and I really appreciate all the effort. I will not get pushy on the matter, but hope you will consider this.

I will be posting a song on the music thread that I made using Deflemask pretty soon.

Sincerely,
marcb0t
 

Offline marcb0t

  • Member
  • Posts: 123
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #1 on: January 08, 2013, 01:45:09 AM »
Hi Delek,

One other thing. On the actual YM2612 chip, there is another undocumented register which causes the PCM channel to have a very smooth panning effect. It affects the other FM channels by quieting the volume, and the PCM channel gets really loud... supposedly. Do you think you might be able to add this in a future release of Deflemask? I am not as concerned about this one as I am with Special Mode CSM synthesis, but it would be cool for making Mega Drive remixes!  ;D

Here is a link which explains more:

http://gendev.spritesmind.net/forum/viewtopic.php?t=1118

Thank you for all your considerations.

Sincerely,
marcb0t   

Offline Delek

  • Salí para ver
  • Administrator
  • Hero Member
  • Posts: 1770
    • Delek's Website
    • Email
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #2 on: January 08, 2013, 09:38:19 AM »
I will look around and see how this hidden modes work, all of them requires to update the internal DefleMask emulator, because seems that it does not emulates it, also these are really obscure properties not widely used, so it will take some time (low priority for difficult and low user demand).
Regards.

Offline marcb0t

  • Member
  • Posts: 123
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #3 on: January 08, 2013, 12:22:05 PM »
Hi Delek,

Thank you! That really means a lot to me.

It's true, these modes are not used by many people (if any at all!  ;) ) However, it was very possible to do these things with original game hardware, and I like to exploit hidden and unusual features of things.

Apparently, the YM2612 core that Shiru used for VGM Music Maker supported CSM mode, but Shiru had not gotten around to making this function accessible in his tracker. Perhaps this could be useful for the Deflemask core?

Here is the file: http://dl.dropbox.com/u/10252384/fm2612.cpp

You'll find text toward the bottom stating these comments and commands:


      /* CSM mode: if CSM Key ON has occured, CSM Key OFF need to be sent       */
      /* only if Timer A does not overflow again (i.e CSM Key ON not set again) */
      OPN->SL3.key_csm <<= 1;

      /* CSM Mode Key ON still disabled */
      /* CSM Mode Key OFF (verified by Nemesis on real hardware) */
      FM_KEYOFF_CSM(cch[2],SLOT1);
      FM_KEYOFF_CSM(cch[2],SLOT2);
      FM_KEYOFF_CSM(cch[2],SLOT3);
      FM_KEYOFF_CSM(cch[2],SLOT4);
      OPN->SL3.key_csm = 0;
   }
}

I'm no programmer, so I don't know how much of the surrounding code is the actual programming of CSM mode. If I'm not mistaken, this is the core for MAME YM 2612 emulation, and is very up to date based on Nemesis's research in 2009 and after.

I hope this helps and makes your job easier... I'm such a nerd!  ;D

Have a great day,
marcb0t

Offline jrlepage

  • Jr. Member
  • Posts: 60
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #4 on: January 25, 2013, 09:18:02 PM »
I'd like to bump this request! Specifically multi-frequency mode. Setting operator frequencies individually for channel 3 would be a tremendous addition to Deflemask! The MAME core already supports it; all you need is a single effect probably, something like 18xy:

x:
0 = off
1 = affect operator 2
2 = affect operator 3
3 = affect operator 4

y = offset in semitone from operator 1 (whose frequency is the note that's note column)

I'm sure this can be done. :)

As for the formant thing, I'm not really familiar with it, nor do I have much interest for it at present time, but if it's not too much work, I'd be thrilled to see it happen too!

Offline marcb0t

  • Member
  • Posts: 123
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #5 on: January 31, 2013, 08:11:38 PM »
Dear jrlepage,

Thank you for your support and suggestions on this topic. What you mentioned is the same technique that Mr. Shiru used for VGM Music Maker Multi Frequency support.

It works fine, but I think I may have a better suggestion. This is what I propose:

Make 4 NEW effect parameters:

M1 = When set to M101, this turns Multi Frequency Special Mode ON!  :D    When set to M111, it sets Operator 1 to turn the Feedback dial to the first level, and can be 12, 13, 14, etc. all the way to 7... Since only operator 1 can use Feedback in Multi Frequency mode according to my understanding. M110 turns Feed back off but stays in Special Mode.

M2 = Operator 2 Frequency control. M240 will make Operator 2 have the same note and octave as Operator 1. Settings lower than 40 will make Operator 2 go down 1 semitone at a time. Going all the way to M27F will make the semitones go up. This will allow for maximum frequency control and should work the same for M3, and M4 below.

M3 = Operator 3 Frequency Control. Start at M340 and go up or down to change notes.

M4 = Operator 4 Frequency Control. Start at M440 and go up or down to change notes.

That should allow us to scale up and down the octaves independently of each other which should be about as easy to implement as Jrlepages suggestion (I hope  :-\ ). The only problem with both of our suggestions is that once you change the note for Operator 1, then you have to adjust the other 3 Operators accordingly.

Mr. Delek, if you are ever in the mood for this, I think that making each operator have its own note entry field with effect field would be ideal for User friendly implementation of Multi Frequency Mode. If you are able to, you can make a button expand Channel 3 to show note control for all the operator, or have it fold back in to just on single note per channel view. Then all you would need is say an effect called SMxx to switch Special Mode on and off, and use a global effect to adjust the feedback.

As I've said before, I'm no programmer, but that latter option sounds like it would be quite a bit of work for ya. It would definitely be appreciated, though. I really like your program and I see you've put some very hard work into it... probably much more than I realize.  ;D

I could be wrong on how flexible MFM is for Channel 3, so feel free to correct me if I misunderstand anything.

Take care both you guys,

Marcb0t

(P.S. If the M1 effect is already used for something else then maybe OAxx, OBxx, OCxx, ODxx, where OA01 turns Multi Frequency mode on, etc. Or it can be any letters you prefer.)

Offline marcb0t

  • Member
  • Posts: 123
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #6 on: January 31, 2013, 08:25:58 PM »
Hi again,

For CSM formant generation mode, here's what I propose:

CSxx could be the effect to switch it on when on 01. The note will obviously change the note  :P, but setting the effect higher than 01 could be used to change Timer A speed to alter the vowel sounds - A, E, I, O, U, AE, etc.

Now I could also be wrong about this, and maybe the vowel sound changes according to the frequency, but I don't know. My understanding is that Timer A in the Mega Drive Hardware is constantly turning on and off at a set speed, and then you can enter your note with the vowel sound created by Timer A. With the speed of the timer going faster, you should get more of an EEEEEEEEE sound, and lower will go from AAAAA down to OOOOOO.  I'll have to play with some assembly programming sometime to find out for sure.

Thanks again guys, you too Jrlepage. I understand that you've been helping Delek with programming Deflemask in certain areas. Did you make or contribute to Famitracker programming? It's my favorite NES tracker, and works great!


Hasta luego,
marcb0t

FlashingYoshi

  • Guest
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #7 on: January 31, 2013, 08:59:58 PM »
Marc, these are honestly good requests, but the effect values you gave are not exactly standard convention.

Each effect in Deflemask is in hexadecimal value, so your effect names are out of the question. As for 40 being the starting point, this is not standard tracker behaviour. The starting point in almost any tracker is 80.

Other than that, I totally agree! (As for ASM programming, do you have a Genesis? Because emulators don't implement the formant.)

Offline marcb0t

  • Member
  • Posts: 123
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #8 on: February 01, 2013, 01:38:23 AM »
Greetings Flashing Yoshi,

Actually, I just found this with a quick google search:

http://www.wii-homebrew.com/wii-homebrew/genesis-plus-gx-v140-stark-verbesserter-sega-megadrive-emulator-im-neuem-gewand

Here's a quote about their sound core rewrite in their improvements list:

Quote
* improved YM2612 core general accuracy (SSG-EG, CSM mode,...) (based upon Nemesis recent tests on real hardware)

That one is for the Wii. I don't have one, but not a problem.

Here's one for the PC:

Regen v0.95

http://emulationrealm.net/modules/impression/singlearticle.php?aid=688&title=multiple_sega_system_emulator_-_regen_v095_-_released

Quote
* Added correct CSM mode support. Thanks to Nemesis again.

Ah yes. That's 2 down. I've never used Regen, but I'll give it a shot with Nemesis .bin file to see if it indeed does work... after I do my taxes though  8)

Have you ever heard of it? I think I had before but was already happy with Gens and Kgen a while back. If you know how to convert assembly code to a working file for an emulator such as converting it to a .bin file that would be helpful. I'm very inexperienced with programming.

Now about the hexadecimal convention, I tested it out, and you are right my friend. Whichever way Delek would want to set the naming convention, or starting the center of the effect with 80 instead of 40 is perfectly fine with me. As long as it works it would be really sweet.

Thank you for clearing that up, and for your support of the features. I have a lot of musical ideas where these things could be useful.

Take care,
marcb0t

FlashingYoshi

  • Guest
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #9 on: February 03, 2013, 06:12:15 PM »
Yes, I've heard of both. But one, I don't have Homebrew Channel, and two, I don't use Regen because of the SRAM problems. Had no clue that it supports CSM.

Offline B00daW

  • Newbie
  • Posts: 6
  • Delek FTW
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #10 on: September 16, 2016, 12:57:46 AM »
*necrobump*

OK.  Found a pretty solid way to debug the CSM mode.

1.) Aly James made a CSM tool located at this post with directions on how to use it. > http://chipmusic.org/forums/post/169688/#p169688
2.) Exodus emulator emulates the CSM and Special mode of YM2612 register $27. > http://www.exodusemulator.com/downloads/current-release
3.) Load Aly James's test ROM from step one.
3a.) Go to Debug > Mega Drive > YM2612 > and then select Channel 3 radio button.
4.) Play around with the ROM and watch in realtime.  As you can see the proper mode for CSM is #2 which would be the MS(Bit) of $27 being 1.  CSM mode changes with F-num and Timer A values. :)

(Possibly unrelated...  On page 36 the documentation of the CH3 CSM mode for the OPNA (YM2608) chip ( http://nemesis.hacking-cult.org/MegaDrive/Documentation/YM2608J%20Translated.PDF )does not appear to have the same bitwise value; but should have the same behavior of generation.)

Exodus sound core is also open source > https://bitbucket.org/exodusemulator/exodus/src/ceac297d914fc0d5f2b10225dbb89d56be4ebbe5/Devices/YM2612/?at=default
« Last Edit: September 16, 2016, 01:03:42 AM by B00daW »

Offline marcb0t

  • Member
  • Posts: 123
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #11 on: September 16, 2016, 02:49:29 AM »
*necrobump*

OK.  Found a pretty solid way to debug the CSM mode.

1.) Aly James made a CSM tool located at this post with directions on how to use it. > http://chipmusic.org/forums/post/169688/#p169688
2.) Exodus emulator emulates the CSM and Special mode of YM2612 register $27. > http://www.exodusemulator.com/downloads/current-release
3.) Load Aly James's test ROM from step one.
3a.) Go to Debug > Mega Drive > YM2612 > and then select Channel 3 radio button.
4.) Play around with the ROM and watch in realtime.  As you can see the proper mode for CSM is #2 which would be the MS(Bit) of $27 being 1.  CSM mode changes with F-num and Timer A values. :)

(Possibly unrelated...  On page 36 the documentation of the CH3 CSM mode for the OPNA (YM2608) chip ( http://nemesis.hacking-cult.org/MegaDrive/Documentation/YM2608J%20Translated.PDF )does not appear to have the same bitwise value; but should have the same behavior of generation.)

Exodus sound core is also open source > https://bitbucket.org/exodusemulator/exodus/src/ceac297d914fc0d5f2b10225dbb89d56be4ebbe5/Devices/YM2612/?at=default
Oh boy... I just love these kinds of necro posts!

Thanks for digging that up boodaw. I'm not sure how I missed that back in 2013. I was all over the CSM mode and Sega Genesis sound chip research.

It really would be cool to have CSM as a usable function in Deflemask someday. Because of your post, we might be one step closer!


Offline dj.tuBIG/MaliceX

  • Newbie
  • Posts: 14
    • codingchords.com
YM2612 Multi Frequency Mode AND CSM Mode
« Reply #12 on: September 04, 2017, 10:30:09 PM »
Would it be possible to get YM2151's CH1 CSM mode supported too?
~ quack ~