It is currently Sun Dec 10, 2017 7:19 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: YM2612 frequency range
PostPosted: Mon May 04, 2015 6:12 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2420
I've been playing around with TFM and I notice that if the pitch is too high, I get a lot of noise. Is that the deal with a real YM2612, or is that an emulation problem? If this limitation is on the real YM2612, how do I know what the cut off point is? I heard that channel mixing is done by dithering/flickering through the 6 channels, but doesn't that mean that the 53kHz sampling rate is reduced to 9kHz?


Top
 Profile  
 
PostPosted: Tue May 05, 2015 10:07 am 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1248
Yamaha's FM synths are digital, so they deal with samples, and when you play a high enough frequency, you indeed get aliasing. In fact, when you turn the feedback all the way up, the "noise" you get is actually a mess of aliasing.

Also, the chip's clock is much higher than the chip's output sample rate, so the channel-cycling likely occurs at a faster rate than the sample rate.


Top
 Profile  
 
PostPosted: Tue May 05, 2015 1:07 pm 
Offline
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 592
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
The range is from infrasonic freqs (under 1Hz) to exactly half the sample rate for given clock (clock / 144), in case of PAL MD the highest freq is (53203424 / 7 / 144) / 2 ~ 26390.5873 Hz.
Aliasing plays a huge role in how the instruments sound, and the more harsher your instrument is the higher harmonics it gets, the more it affects your sound. All the fuzz and noise is from the aliasing. If you don't want that noise adjust the KeyScale parameters to get ADSR progress quicker (behaviour of real instruments) and perhaps make instruments especially for the higher notes which have increased TL values for some of the operations.

_________________
http://www.tmeeco.eu


Top
 Profile  
 
PostPosted: Tue May 05, 2015 4:57 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2420
Could it be possible for an emulator to sound better than the real thing?


Top
 Profile  
 
PostPosted: Tue May 05, 2015 4:59 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5885
Location: Canada
psycopathicteen wrote:
Could it be possible for an emulator to sound better than the real thing?

Of course. Emulators can do the same thing, or something different. If there's something you think is better, they can do that too. At least, if they're well made.


Top
 Profile  
 
PostPosted: Wed May 06, 2015 1:03 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
psycopathicteen wrote:
Could it be possible for an emulator to sound better than the real thing?

They always sound better than the real thing actually, to rather breaking points even >.>; (try listening to Thunder Force IV's guitars without any sort of low pass filtering and you will understand what I mean, your ears will bleed - Sonic Spinball's guitars suffer from the same issue) The only point where they sound worse is in the edge cases which aren't emulated even remotely properly (usually involving SSG-EG or using the wrong emulated rate).


Top
 Profile  
 
PostPosted: Thu May 07, 2015 11:40 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2420
If C9 is at 8khz, and the niquist frequency is at 26khz, then that means you can't have a MUL setting of more than 3. Harmonic frequencies might still be problematic though.

If you adjust every note frequency to be divisible by the sampling rate, would that get rid of some quantization noise?


Top
 Profile  
 
PostPosted: Thu May 07, 2015 2:39 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
If you have a melody at C-9 then you'll destroy everybody's ears... (remember A-4 is 440Hz, which is far away from 26KHz)


Top
 Profile  
 
PostPosted: Thu May 07, 2015 5:31 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2420
Would it still help to round notes to the nearest divisible frequency, such as C-4 being at sample-rate/192


Top
 Profile  
 
PostPosted: Thu May 07, 2015 5:42 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19322
Location: NE Indiana, USA (NTSC)
NES CPU: 315/176 MHz
Genesis CPU: 4725/616 MHz

That could help, but you'd lose tuning precision for high notes. The question becomes whether it'd be noticeable. NES pulse wave frequencies must divide evenly into CPU/16, or 315 MHz/(176*16) = 111,860.8 Hz, so there's a loss of precision at the high end. Triangle wave frequencies must divide into half that, which is why high-pitched triangle waves tend to detune. Atari's POKEY has similar tuning problems.

So how do frequency and "block" translate into an actual frequency? Is the clock source CPU/144 = 4725000000/88704 = 53267 Hz or otherwise?


Top
 Profile  
 
PostPosted: Thu May 07, 2015 6:15 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
It's a bit more complex than that but yep, it's 1 sample every 144 cycles (and yes, the source clock is the same one used for the 68000 - which also means it varies depending on whether it's NTSC or PAL, but it's so minor that you'll probably just want to ignore it unless you're an audiophile).

I don't recall the details, but block is pretty much a bit shift left (since it's used to determine the octave - one octave/block up = multiply by 2). As for frequencies, this is what Echo uses for each pitch (from C to B), although it's a blend of the frequencies of NTSC and PAL speeds:
Code:
FMFreqTable:
    dw  644, 681, 722, 765
    dw  810, 858, 910, 964
    dw  1021, 1081, 1146, 1214

The maximum is 2047 so you have to resort to blocks to move onto the next octave =/ (you can use lesser values for going down, although you lose some precision)


Top
 Profile  
 
PostPosted: Thu May 07, 2015 7:08 pm 
Offline
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 592
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
Code:
FOR Okt% = 0 TO 7            ' Generate musical note to OPN freq table ------
 FOR NoteS% = 60 TO 71
  MiniStep! = 0
  FOR MiniS% = 0 TO 15
   MFREQ! = 8.1757989156# * (2 ^ ((NoteS% + MiniStep!) / 12))
   OPNnoteStep(Okt%,NoteS%-60,MiniS%)=((MFREQ!*131072)/OPNclk)OR(Okt% SHL 11)
  MiniStep! += (1 / 16)
  NEXT MiniS%
 NEXT NoteS%
NEXT Okt%

This is what I use to create a freq table I use in my stuff. 60 to 71 corresponds to a specific octave in MIDI scale.
% = signed int, # = double precision float, ! = single precision float. OPNclk is 53203424 or 53693175 / 7 / 144
You only need to generate single octave and in my case 16 sub note freqs, octaves are handled by the chip natively.

_________________
http://www.tmeeco.eu


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group