FMDrive VST / YM2612 + Extended Vsti (Some News!)

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

Moderator: BigEvilCorporation

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

Post by Eke » Thu May 16, 2013 10:11 pm

TmEE co.(TM) wrote:

Code: Select all

SELECT CASE OPNmode
CASE 1                             'YM3438 mode
 OPNbuf(i%, 0) = Lft AND &HFF80
 OPNbuf(i%, 1) = Rit AND &HFF80
CASE 2                             'YM2612 mode
 IF (Lft > 0) AND (Lft < 256) THEN
  OPNbuf(i%, 0) = Lft AND &HFF00
 ELSE
  OPNbuf(i%, 0) = Lft AND &HFF80
 END IF
 IF (Rit > 0) AND (Rit < 256) THEN
  OPNbuf(i%, 1) = Rit AND &HFF00
 ELSE
  OPNbuf(i%, 1) = Rit AND &HFF80
 END IF
CASE ELSE                          'Silky smooth mode
 OPNbuf(i%, 0) = Lft
 OPNbuf(i%, 1) = Rit
END SELECT
I do this in my core and it produces spectrally correct output compared to real chips, to the last details. I have not came up with any cleaner way to do this, maybe a bigass array to do translation so there's no compares and jumps...
EDIT: now looking at it, I need to do this crushing before panning stuff, will save cycles :P
i think it would be more correct to apply a bitmask on each channel output, considering they are sequentially input to DAC, then sum up the channels, don't you think ? ( not sure why but i just noticed that i was even applying it at operator output, which seems wrong and might be a result of poor optimization attempt


also, not sure if i am missing something in your code but when sample value is within [0-255], having it masked with FF00h always result to zero so AND operation is uneeded ;-)

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

Post by TmEE co.(TM) » Thu May 16, 2013 10:50 pm

EDIT: More corrections...

YM2612 output ramp sequence is -256 .... -2, -2, 0, 1, 2, 3 .... 255
YM3438 output ramp sequence is -256 .... -2, -1, 0, 1, 2, 3 .... 255

Rest removed here, too much false info :P
Last edited by TmEE co.(TM) on Fri May 17, 2013 9:59 pm, edited 2 times in total.
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

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Fri May 17, 2013 2:00 am

EDIT :Information added to the YM2612 sticky doc...
Maybe you might also have to take in account the internal noise witch IIRC output some frequencies around 50 and 100hz when played an A 220hz for example, that might cross modulate something too.., even when no operator are keyed on.

Cheers
Last edited by Aly James on Sat Nov 30, 2013 3:18 pm, edited 1 time in total.

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

Post by TmEE co.(TM) » Fri May 17, 2013 11:07 am

The 50 and 100Hz is ripple from power supply (it will be 60 and 120Hz in NTSC land). There's gonna be higher harmonics too but a lot more faint.
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

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

Post by Eke » Fri May 17, 2013 8:48 pm

TmEE co.(TM) wrote: The output never has the value of "1" on 2612, so I see no point in doing it on channel per channel basis.
If you sum up 4 channel output that are all $007C ("0") , you end up with a "Lft" / "Rft" value equal to $01F0 ("+3") while it should have remain "0". In fact, Gmaniac even confirmed that carrier operators output (14-bit) was shifted by 5 before being added in the accumulator so the mask should actually be applied before even generating the channel output since you lose some precision in case of algos 4-7 (the mistake in my code is that the mask ended up being applied on modulator inputs as well, which I believe is wrong since the accumulator is not used for slot connections)

Also what you say about "+1" level being the same as "0" seems to ontradict what Gmaniac observed and mentionned in the YM2612 thread: he wrotes that "-2" was the same "-1" but "+1" was different om "0".This makes me wonder what is the real behavior and if it can accurately be observed.

From what we now know of the YM2612 DAC, it only use 8 lowest bits of 9-bit accumulator, which allow 256 different analog levels, then the sign bit being used to set the analog outputs voltage reference to either GND or VCC, so 0 relates to -256 ("100h"), ..., +255 to -1 ("1FFh") and therefore if something is wrong in the DAC array with +1, it should also be wrong with -255, etc...

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

Post by TmEE co.(TM) » Fri May 17, 2013 9:58 pm

I have remembered bunch of this stuff wrong/incomplete. -1 and -2 are the flattened values among other things.

*Discard first 5 bits.
*Sum the operators and clamp to 9 bits.
*Output to DAC while eating up couple of values due to a bug.
*Do next channel.

It makes sense as you no longer need 14bit adder, only 9bit one, especially since output is not 14bits.
I'll definitely add that to my core on 2612 and 3438 modes.

About the DAC bug, it will need closer looks. I'll do those looks in not so fan future.
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

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Sun May 19, 2013 11:12 am

Something interesting I forgot to tell (but might not be new for you ^^) is when I set the output of a channel to "mute", B4H LEFT&RIGHT bit==0;
Playing some notes here do not play silence but the same line as normal except (center) already distorted from the start and at a lower volume.
The very last ms ends with quantize effect on top of that.
TL as almost no effect on the slot until near max attenuation.

So when I said that the sine shape (assuming we have a pure sine in this example) is slowly changing into an almost square wave is not exactly what is happening.
I think that the distorted line and the clean line simply adds together from the start.
The fact that we only ear the last portion is obviously because, as the clean line reaches low volume, the frequency richer distorted part underneath become prominent and that is also why some sounds seems to have a longer tail on the hardware then on clean emulation.
The positive portion of the sine also seems to be slightly shifted to the right the more the attenuation goes.
So there might be something in here just before MOL and MOR...
--------------------------------------------------------------------------
Here is a wave recording of the effect.
1// B4 D7 and D6 are set (center)
2// (mute)

LADER ALONE
--------------------------------------------------------------------------

Nothing related @TIIDO: do you have some links with interesting musical examples of the use of PCM custom waveforms, drums samples etc..as custom operator wf with the YMF292 aka SCSP, I have a hard time finding some.. ?
Cheers

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

Post by TmEE co.(TM) » Sun May 19, 2013 1:09 pm

I had so much fun working around that problem in my MD sound engine that Pier Solar eventually used, in the end I did not get a perfect workaround. This is fixed in YM3438 and MD2 implementation.
I never really thought it may be an analog problem, it can explain why it is so immune to workarounds. I basically ended up using dummy instruments with really short (but in theory inaudible sound) to get internals to silence state on the channel. It was effective but fairly ugly to implement.

As for SCSP, no... I don't know anyone doing interesting stuff on Saturn with it and I won't be doing any for a while either. But you can get a taste by looking at SY-77 and SY-99 keyboards which use essentially same system.
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

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Mon May 20, 2013 11:35 am

On a personal point of view, I prefer the sound with the "bug" it gives a very personal sound to the YM2612 and it can be use creatively :)

I have just checked the F1SR..the formant thing kind of remind me the CSM mode, without the need to program formants... ^^

Today I have made a tribute to Yuzo koshiro in my spare time
Here it is:
---------------------------------------------------------------
NINJA STEP from Revenge of Shinobi soundtrack
PAL version

---------------------------------------------------------------
FMDrive in HD mode. and a little mixed and arranged.

http://soundcloud.com/alyjameslab/ninja ... mdrive-vst

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Tue May 21, 2013 5:31 am

Eke wrote: and how did you implemented the characteristic DAC "distorsion" ?
Some more infos :)
This basically what gives me the best results, thinking about what could happen between MOL and MOR and the sign bit thing..and the same behavior his observed on the hardware. Here is a digital emulation.
The pulse line is masked by the clean signal when there is no attenuation (as the clean line is noticeably higher) and is almost unaffected by TL or EG attenuation. see post above.
hope that helps :)
EDIT: I Forgot to mention that I also offset the negative pulse as the attenuation increase...resulting in a change of the pulse wave duty cycle from 50/50 to almost 90/10. This reflect in the tone in the end.

Image

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Wed May 22, 2013 4:08 pm

YM2612 HARDWARE (non standard creative usage)
Setup in these videos is:
FMDrive VST sends MIDI data to the GENMDM MIDI interface that sends register writes to the YM2612 chip in REALTIME.

REAL HARDWARE USE: Using SSG as a "fake" CSM vocal type effect.
(fast SSG envelope can sort of emulate the auto key on / off behavior of CSM mode)

http://youtu.be/MDVZqjSTsp0

REAL HARDWARE USE: Using FMDrive random bytes generator (LFSR) to write a custom 14bytes waveform on the DAC.
(changing the LFSR clock speed will increase the randomness)

http://youtu.be/cXBY5uVfVZY

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Fri May 31, 2013 8:08 pm

Regarding the ladder effect, I will post my latest implementation on the YM2612 sticky doc :)
I finally find a way to implement this at no cpu cost..
viewtopic.php?t=386&postdays=0&postorder=asc&start=684
Last edited by Aly James on Wed Mar 19, 2014 6:32 am, edited 1 time in total.

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Tue Oct 01, 2013 9:05 am

Just to let you know that FMDrive vst got updated to 1.23!
-added extra features and corrections.
-accuracy improved again.
-GenMDM midi mapping already done on startup for those who have one.

Free for all registered user :)

UPDATE >> http://youtu.be/Hdlj8Vjof6c


what I usually do is making the song with FMDrive (and lately Super PSG beta), clean up the live recorded poly notes, if there is some, to be sure everything sent to GenMDM channel is mono, record automation etc...If I want the hardware output, I then hook up GenMDM and route the MIDI content to it and voila!

for now on it is damn close :)

DIRECT AUDIO COMPARISON >> http://youtu.be/8Mk26qRBwjQ

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Sat Oct 12, 2013 12:51 am

Wireless YM2612 hand control test!...using leapmotion controller >> FMdrive VSTi and GenMDM
http://youtu.be/Xuui8f5Oafk

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Tue Dec 17, 2013 9:38 pm

Super PSG VST (SN76489 SMS version with extended features...) is now available :)
http://www.alyjameslab.com/alyjameslabsuperpsg.html

Post Reply