NandemoFM v1.10 released

NandemoFM v1.10 released

by PAC on 07-08-2015, 18:06
Topic: Software
Tags: music
Languages:

Tiny Yarou has done it again! Few months ago was the turn of NandemoSCC and it is now for NandemoFM to show us how to play PSG games with FM sound! In the same way than NandemoSCC, in this case and as is obvious, the PSG channels are switched to FM channels. If you are a lover of the OPLL, it's your chance!

This tool runs on any MSX generation but keep in mind that if you want to play MSX2 games an MSX turbo R is required. You can listen some nice examples here and here.

This forum topic was opened last week. Feel free to solve your doubts there.

Relevant link: NandemoFM v1.10

Comments (27)

By fernando.collazo.5682

Master (251)

fernando.collazo.5682's picture

08-08-2015, 06:35

Awesome work!!
Now waiting for Nandemo OPL4 LOL!

By jurjen

Supporter (16)

jurjen's picture

08-08-2015, 09:52

Nice!

By anonymous

incognito ergo sum (118)

anonymous's picture

08-08-2015, 12:07

Sorry to have the discordant opinion here but... I prefer the original PSG sounds.

Most of the songs sound out of tune and/or with strange artifacts.
Furthermore, the PSG noise channel (which is very important for drums and other SFX) is lost.

Sorry. Don't like at all. And I don't understand the need of this kind of tools neither.

By Manuel

Ascended (16974)

Manuel's picture

08-08-2015, 15:33

warau: there's no need. It's just for fun!

By PAC

Guardian (5881)

PAC's picture

08-08-2015, 16:49

Some games sound better than others but that doesn't mean that this tool is an absolute nonsense. In my opinion it is an incentive and a new way of playing a lot of games again, same than NandemoSCC. Smile

By Grauw

Ascended (9342)

Grauw's picture

08-08-2015, 23:14

Great follow-up to NandemoSCC! Smile

By Randam

Paladin (1017)

Randam's picture

09-08-2015, 22:39

This is uber awesomeness. Thank you Tiny Yarou.

By SLotman

Paragon (1221)

SLotman's picture

10-08-2015, 10:30

Aw, didn't work with Hype or Moon Patrol Sad

But it did work with Ye Ar Kung Fu, and it was amazing Smile

Edit: Even recorded it on video!
https://www.youtube.com/watch?v=8ClK5xyQ8wQ

By KdL

Paragon (1336)

KdL's picture

11-08-2015, 23:51

I like these tools. I suggest to implement a smart mode that it grabs the best instruments and volumes automatically.

By Parn

Hero (607)

Parn's picture

12-08-2015, 13:51

Judging by how much better it sounds with both PSG and OPLL playing together, I'd suggest creating a tool to add PSG sound to FM-only games.

Or even better, a tool that added SCC sound to FM music. This way there could be no chance of PSG conflict, and it would dramatically improve FM sound.

By KdL

Paragon (1336)

KdL's picture

13-08-2015, 16:01

v1.20 is out Smile

By erikd

Master (255)

erikd's picture

18-08-2015, 19:58

Very inventive stuff, I love it Smile

By Sander

Ambassador (1854)

Sander's picture

21-08-2015, 12:31

Excellent work.

By jay.jay.coby

Supporter (8)

jay.jay.coby's picture

22-08-2015, 04:39

I have success with Out-Run (MegaROM Cartridge) with NandemoFM v1.2 converter on PC.
To convert correctly I use this configuration:
Auto Start ticked
Original ROM Type= Megarom (ASCII8 Mapper)
BANK1 Control=Fixed to 4000H
PSG Noise=Force On
OPLL Data=Copy from PSG
BIOS=Custom(DRAM)
The others adjust I mantain the original
The instruments can vary and you can try any combination of instruments.
I also have runned Mopiranger directly from openMSX using a FS-A1GT config with FMBoot.COM with success.
Good luck to everyone!

By jay.jay.coby

Supporter (8)

jay.jay.coby's picture

22-08-2015, 05:58

Well, I try the FM and the SCC version in some games with luck/no luck.
In Treasure of USAS I put both but the game decrease speed in most.
It's playable but in slow motion.
Zanac Ex I put in SCC but not im FM....
And so goes on!

By SLotman

Paragon (1221)

SLotman's picture

22-08-2015, 20:08

I would love to understand how this works under the hood - I imagine implementing this into emulators - so all games could work with it (even games that writes directly to ports).

Knowing how this works, games that uses ports could also be adapted ^_^

PS:I do know this intercept BIOS calls - what I'm speaking of is how data is converted from PSG to FM...

By erikd

Master (255)

erikd's picture

22-08-2015, 22:55

@SLotman
I think it's a matter of converting PSG register values to their FM counterparts, and probably pre-selecting the FM patches.
So for example a frequency register is written to in the PSG, intercept that value, and write a value to the FM channel's frequency register that leads to the same frequency, etc.
I could imagine the trickiest part is reliably recognizing when a note starts and finishes, and how to convert them to triggering the FM envelope generators (as I suppose most PSG music doesn't use its own envelopes but just write to volume registers).

But it's probably a lot easier to do in an emulator than on the real machine, and you'll be a lot more flexible to do stuff that would otherwise be very hard or impossible (for example converting PSG to an emulated SID chip, converting SCC to VST instruments, the sky is the limit Wink)

By SLotman

Paragon (1221)

SLotman's picture

23-08-2015, 19:08

erikd wrote:

@SLotman
I think it's a matter of converting PSG register values to their FM counterparts, and probably pre-selecting the FM patches.
So for example a frequency register is written to in the PSG, intercept that value, and write a value to the FM channel's frequency register that leads to the same frequency, etc.

Yeah, that part I understand - what I keep thinking is how to convert the values written in the PSG port to the ones in the FM port.

By iamweasel2

Hero (608)

iamweasel2's picture

24-08-2015, 03:02

This is an amazing work, as much as it was the SCC version ! It would be nice to have a repository with the already patched roms with their best settings, so we don't need to learn how to configure each game individually (or maybe a database file that is read by the tool that recognizes the game being loaded and apply the best settings).

By anonymous

incognito ergo sum (118)

anonymous's picture

24-08-2015, 06:51

SLotman wrote:

Yeah, that part I understand - what I keep thinking is how to convert the values written in the PSG port to the ones in the FM port.

Maybe a basic (and inevitable) crude and global analysis of the ADSR (if any) used by the PSG software 'instruments' can be interpreted closely enough to decide, "this has a slow attack, so it must be a string section", or "quick attack and decay, then it fades down into a prolonged sustain, so probably they meant a piano there". If any variation is wanted, then you don't need a crystal ball to predict that the algorhythm to program such a thing will be extremely tricky. HW PSG presets would be easier, but they are generally not used in 'Japanese' game music.
Also, what people seem to forget here, is that the SCC volume is strictly linear, while PSG volumes are 'logarithmic'. Hence, there is no 100% accurate 'conversion table' to be made; it'd be all on approach, and 'close enough'.
With no disrespect meant, I am surprised by how fast people are satisfied by results of just having SCC or FM mimicking the PSG channels. Really good results are only reached by re-arranging the whole thing. There is no 'magical' algorhythm or code that will automagically make stuff sound good by just traversing the tone frequency data to another chip, but people already seem to be happy with just hearing the tones on their favorite chip, so who am I to criticize?

By anonymous

incognito ergo sum (118)

anonymous's picture

24-08-2015, 06:54

Addition: Those Konami Game Collection reworkings of the soundtracks to SCC, like Knightmare, Nemesis, Twinbee, etcetera; they didn't just assign SCC waves to the original music data; they totally re-arranged all that stuff. It's not like, you have three channels PSG
(1) drums/accompaniment
(2) basslines
(3) melody
and that there's some kind of code that calculates "let's do some chords on those left over SCC channels, let's invent a new bassline and more drumfills here and there since we have more channels". Even Windows 10 or the biggest mainframe isn't smart enough to do that. For the time being, we need human interferance. Wink

By Tiny Yarou

Supporter (11)

Tiny Yarou's picture

24-08-2015, 08:07

Algorithm to convert from PSG to OPLL is this.(Not accurate)
In fact, all of this I am writing in Z80-assembler.

// Relationship between PSG and frequency
//  frq = 111860.78125 / PSGparam
//
// Relationship between OPLL and frequency
//  OPLLparam = ( frq * (2^18) / (50*1000) ) / (2^(b-1))  ; b=octave
//
// Relationship between OPLL and PSG
//  OPLLparam = ( 586472.6528 / PSGparam ) >> (b-1)

for (ch=0; ch<=2; ch++ )
{
	// Calc OPLL data
	OPLLparamNow = 586472.6528 / ( GetPSGport(ch*2) + GetPSGport(ch*2+1)*256 );
	PSGvolNow = GetPSGport(8+ch);
	
	// Calc octave
	fNum = OPLLparamNow;
	for ( b=1; fNum>=512; b++ )
	{
		fNum = fNum >> 1;
	}
	
	// KeyOn by note change
	if ( ABS(OPLLparamNow - OPLLparamPrev[ch]) > NOTECHG )
	{
		// NOTECHG is a constant for determining whether to play another note.
		OPLLKeyOn(ch,fNum,b);
	}
	
	// KeyOn by volume up
	if ( PSGvolNow == 0 ) OPLLKeyOff(ch);
	if ( PSGvolNow > PSGvolPrev[ch] ) OPLLKeyOn(ch,fNum,b);

	// Save data
	OPLLparamPrev[ch] = OPLLparamNow;
	PSGvolPrev[ch] = PSGvolNow;
}

By KdL

Paragon (1336)

KdL's picture

27-08-2015, 21:28

I think it's a great intent succeeded. Congrats!! Smile

By erikd

Master (255)

erikd's picture

27-08-2015, 21:48

@Tiny Yarou

Very interesting, thanks for sharing!
I expected it to be a bit more complex, but maybe you left out some details here.
But then again, the best solutions are usually deceptively simple and to the point Smile

By erikd

Master (255)

erikd's picture

27-08-2015, 22:19

JohnHassink wrote:

Maybe a basic (and inevitable) crude and global analysis of the ADSR (if any) used by the PSG software 'instruments' can be interpreted closely enough to decide, "this has a slow attack, so it must be a string section", or "quick attack and decay, then it fades down into a prolonged sustain, so probably they meant a piano there". If any variation is wanted, then you don't need a crystal ball to predict that the algorhythm to program such a thing will be extremely tricky.

That would be impossible to do in real-time though. Once you know what the envelope looks like, you're already too late Smile

Quote:

Also, what people seem to forget here, is that the SCC volume is strictly linear, while PSG volumes are 'logarithmic'. Hence, there is no 100% accurate 'conversion table' to be made; it'd be all on approach, and 'close enough'.

Yes, that's an issue since both chips have just 4 bits of volume precision. But that lack of precision also means that volume settings were never set with any great precision by the composer to begin with, so it probably doesn't really matter all that much.

Quote:

With no disrespect meant, I am surprised by how fast people are satisfied by results of just having SCC or FM mimicking the PSG channels. Really good results are only reached by re-arranging the whole thing. There is no 'magical' algorhythm or code that will automagically make stuff sound good by just traversing the tone frequency data to another chip, but people already seem to be happy with just hearing the tones on their favorite chip, so who am I to criticize?

Well, I don't think anyone would argue that this sort of thing is anything other than cool inventive experiments that can lead to cool sounding results.
Of course there's no magic formula that works for everything here. But that doesn't make the effort any less interesting.

By SLotman

Paragon (1221)

SLotman's picture

28-08-2015, 06:39

@Tiny Yarou
Thanks for explaining! You made my day Smile

By msxski

Resident (54)

msxski's picture

05-09-2015, 01:14

Would be nice with a demo video featuring only the same game.
1. Game with original designated audio hardware.
2. FM.
3. PSG.
4. SCC.