GENNY VST - Beta available for download!

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

superjoebob
Very interested
Posts: 65
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

GENNY VST - Beta available for download!

Post by superjoebob » Wed Feb 22, 2012 7:14 am

BETA NOW OPENLY AVAILABLE!!!! :D

Here's the VST version:
http://www.wonthelp.info/GENNY_beta_2.zip
And the FL version:
http://www.wonthelp.info/GENNY_betaFL_2.zip


Oh yeah I guess I'll call it GENNY now instead of Genny, so we can differentiate it from the slang term for Genesis. I guess it stands for "Guys, Every Nerd Needs YM2612"

I've been working nonstop every day on GENNY for a few weeks now, and it's almost ready to release! Here's what it looks like in FL Studio:
Image

I want to make a new thread for it when it's released, since it's a completed project and it's entirely different than my old VST. In the meantime, I'll keep you guys updated on its progress here.

Interesting stuff:
-32 and 64 bit VST
-Will work on Mac
-Supports 16 midi channels controlling a YM2612 and an SN76489
-Imports TFI, TYI, VGI, and reads instruments from VGM/VGZ files
-Will also export VGI instruments
-Supports DAC sample playback

-Supports audio logging in VGM format
This is actually implemented now, I just need to clean it up and optimize a bit. Example:
Original song mixed with 10 instances of YM2612 VST:
https://soundcloud.com/superjoebob/hard-corps
Song partially ported and dumped using GENNY:
http://www.wonthelp.info/hardCorps.vgz

-Already has FL Studio native plugin support, allowing piano roll note bending and volume automation

I also wrote an envelope generator for the SN76489 support, here's a sample of what it sounds like: http://www.wonthelp.info/gennytest.mp3
and a sample of (early) SN76489 VGM dumping http://www.wonthelp.info/tester2.vgm
See above for a better example of what VGM dumping can do.

I'm curious what you guys would like to see in a plugin like this, I'd like to add everything I can possibly add to make it capable of creating any Genesis sound possible.
Last edited by superjoebob on Sat Mar 22, 2014 10:15 pm, edited 22 times in total.
On a never ending quest to compose for the Genesis/Megadrive

Nemesis
Very interested
Posts: 773
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Sat Feb 25, 2012 2:44 am

Wow, that's a really interesting project! If you've got specific questions about the implementation, I'm more than happy to help out whatever way I can. I'll definitely give this a try when it's up and running.

SmartOne
Very interested
Posts: 77
Joined: Sun Sep 21, 2008 5:18 am

Post by SmartOne » Wed Mar 07, 2012 4:41 pm

Genesis Plus GX (MAME) has the best YM2612.

superjoebob
Very interested
Posts: 65
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Mon Mar 12, 2012 6:28 am

Been working hard on the VST today, finished implementing algorithm selection, channel enable/disable, and full operator parameter automation via midi! I've been trying to figure out how to do realtime operator changes while a note is playing though, and I can't seem to figure out how. Was hoping you could help me with this one Nemesis :D. Pretty much looking for the way to do note frequency bends, and operator bends if that's possible.

Smart One, thanks for the tip, I went and downloaded the Genesis Plus GX source and attempted to move all the static stuff in the 2612 implementation into a class (DLL's really don't like static memory space all that much, had to do the same for the Gens implementation). Managed to get it building but it appears to be malfunctioning. I'm using all the same functions I was using from the gens core to interact with the chip emulation, but the chip doesn't seem to be giving me anything but zeros in my sample buffer. I've set up the config and done all the initialization. You guys have any idea what I could be missing with this?
On a never ending quest to compose for the Genesis/Megadrive

TmEE co.(TM)
Very interested
Posts: 2373
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Mon Mar 12, 2012 2:40 pm

ADSR and some other settings take effect only on new note-on event
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

superjoebob
Very interested
Posts: 65
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Thu Mar 15, 2012 8:01 pm

That's too bad, was looking forward to doing some cool operator slide effects ^^. Managed to figure out the note bending though, going to implement pitch slide as my next addition. For anyone who uses FL Studio I'm also thinking of doing a native VST to allow pitch bending using the piano roll.

More good news, I managed to get the Genesis Plus GX 2612 emulation working with the VST, and it sounds absolutely fantastic. Here's a sample of the new VST sound:
http://www.wonthelp.info/superjoebob/YM2612Test_New.mp3
On a never ending quest to compose for the Genesis/Megadrive

superjoebob
Very interested
Posts: 65
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Sun Mar 18, 2012 1:08 am

Having some strange issues with the Plus GX implementation... For some reason the notes played with the Plus GX are off key compared to the notes played with Gens. I can mix the VST with other instruments if I'm using the Gens implementation, but if I'm using the GX one the notes will clash, even when I play a C5 on the GX beside a C5 on a piano.

Everything is the same except for the implementations of the emulators, is the GX just off key?

EDIT:
Could it be a clock issue? Strangely if I divide the clock(7670592) by 4 when I pass it into Gens, the notes I play are much much lower in pitch. But, when I divide the clock by 4 when I pass it into GX Plus, the output is exactly the same...

EDIT:
Whatever the hell "hq_fm" is in the GX Plus implementation setting it to 0 fixes the problem. Looks like it was defaulting the frequency to 53267hz with that on. Any idea why that would be? Feel like it sounds better with hq_fm on, its a shame it doesn't mesh with other instruments...
On a never ending quest to compose for the Genesis/Megadrive

Eke
Very interested
Posts: 856
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Sun Mar 18, 2012 9:51 am

Hq FM emulates the chip at its original "samplerate", and with the MAME core, you will need to resample the output to your output samplerate using an external resampler (as opposed to GENS which uses linear interpolation and does this internally).

In genesis plus gx implementation, when hq fm option is set, clock and rate values passed to ym2612_init function are not used, the emulator renders one sample (through ym2612_update) each 144 emulated CPU cycles.
When it is off, clock and rate values are only used to compute a frequency ratio and adjust the chip inner emulation in regard to that: this can however make some frequency sound inaccurate so it's better to have it on.

You can have a look into Fir_resampler.c, audio.c and system.c for how the resampler is used.

superjoebob
Very interested
Posts: 65
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Tue Mar 27, 2012 6:33 am

EDIT:
Nvm, just nailed it. :D
Seems to be working good now, time to move on from this road block!
Out of curiosity, does the audio get re-sampled or otherwise changed to be the correct pitch on real hardware? I just cant shake the feeling that it doesn't sound quite as good re-sampled as it did at 53267hz...

STUFF FROM BEFORE:
Makes sense, I can't seem to get it to work properly though. I've followed your implementation from Gens Plus, and even tried implementing a completely different resampler, but I think I'm missing some basic concepts to how re-sampling works. What I'm doing right now, is as follows:

A function gets called in the VST when it's ready to process audio. The function has an integer as a parameter which represents how many samples the VST is ready to receive, and a buffer of floats for me to fill with samples (-1.0 to 1.0). Here's what I'm doing:

I'm initializing Fir_Resampler with this:

Code: Select all

_resampler.Fir_Resampler_time_ratio( 53693175 / (double)44100 / (144.0 * 7.0), 0.995 );
and re-sampling like this:

Code: Select all

	
   float* out1 = outputs[0];
	float* out2 = outputs[1];

	VSTInterface* i = (VSTInterface*)editor;
	if( i != nullptr )
		i->Update(_channels);

	for(int j = 0; j < sampleFrames; j++ )
	{
		out1[j] = 0;
		out2[j] = 0;
	}

	int* buffer = _resampler.Fir_Resampler_buffer();
	int reqFrames = sampleFrames;
	int curFrame = 0;

	if( _leftoverSamples > 0 )
	{
		for( int i = 0; i < _leftoverSamples; i += 2 )
		{
			out1[curFrame] += (float)(_samples[_finishFrame + i] / (float)32767);
			out2[curFrame] += (float)(_samples[_finishFrame + i+1] / (float)32767);		
			curFrame++;
			reqFrames--;
		}
	}
	_finishFrame = 0;
	_leftoverSamples = 0;

	int avail = 0;	
	while( 1 )
	{
		avail = _resampler.Fir_Resampler_avail();
		if( (avail / 2) >= reqFrames )
			break;

		_resampler.Fir_Resampler_write( 2 );
		_hardware.Update( buffer, 1 );
		buffer = _resampler.Fir_Resampler_buffer();
	}
	_resampler.Fir_Resampler_read( _samples, avail );

	for( int i = 0; i < reqFrames * 2; i+=2 )
	{
		out1[curFrame] += (float)(_samples[i] / (float)32767);
		out2[curFrame] += (float)(_samples[i+1] / (float)32767);
		curFrame++;
		avail -= 2;
	}

	if( avail > 0 )
	{
		_finishFrame = curFrame * 2;
		_leftoverSamples = avail;
	}
I'm pretty much cycling through updates until I've generated enough samples to fill sampleFrames number of frames. I then resample the buffer, convert it into floats, and put it into the output buffers I'm given. If I have more frames than I need, I save them for next time. The output of this, is a very low pitched garbled sound with a slight hint of any sort of note. Am I missing something?
On a never ending quest to compose for the Genesis/Megadrive

Eke
Very interested
Posts: 856
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Sat Apr 07, 2012 12:24 pm

superjoebob wrote:EDIT:
Nvm, just nailed it. :D
Seems to be working good now, time to move on from this road block!
Out of curiosity, does the audio get re-sampled or otherwise changed to be the correct pitch on real hardware? I just cant shake the feeling that it doesn't sound quite as good re-sampled as it did at 53267hz...
Off course, real hardware does not do such thing as resampling, FM chip outputs analog audio and the "sampling rate" is only the rate at which audio output is being updated FOR ALL 6 CHANNELS.

It has been verified that YM2612 will update a single channel output each 24 cycles of input clock, which make a sample rate of VCLK/(24*6) = approx. 53267hz on NTSC consoles.

Resampling is only needed in emulators because obviously your PC (or whatever) soundcard only supports a limited set of input samplerate...

superjoebob
Very interested
Posts: 65
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Sun Apr 08, 2012 9:25 pm

I Figured I was being stupid ^^. Obviously a resample is gonna have to do then, still sounds pretty damn good compared to what I had. Thanks Eke!
On a never ending quest to compose for the Genesis/Megadrive

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Thu Apr 26, 2012 3:56 am

hmm, somebody got to this before i could finish mine...

superjoebob
Very interested
Posts: 65
Joined: Fri Oct 15, 2010 7:06 am
Location: Vancouver, Canada
Contact:

Post by superjoebob » Tue Dec 11, 2012 5:41 am

Beta released! Check out the main post for more details you can get it at http://wonthelp.info/2612/ym2612-vst-release-v-0-9/
On a never ending quest to compose for the Genesis/Megadrive

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Tue Dec 11, 2012 9:40 pm

As someone who loves Genesis sound & uses VSTs often, will this eventually get an x64 version?

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Tue Dec 11, 2012 11:08 pm

Will this also be open-source? I'd love to see what I could do differently to set my upcoming one apart from this one.

Post Reply