Re: [hatari-devel] 7an's Hi-Hats

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


----- Nicolas Pomarède wrote:
> Le 29/06/2017 à 22:01, David Savinkoff a écrit :
> > Hi,
> > 
> > I was looking at hatari/src/sound.c :: YM2149_RndCompute()
> > 
> > This function must be executed at the same rate as the noise
> > frequency register in the YM2149.
> > YM2149_RndCompute() is, however, executed on a per sample
> > basis which is not the same. Thus, different sound.
> > 
> > 
> 
> Hi
> 
> do you mean in YM2149_NextSample_250() ? code is :
> 
>   if ( Noise_count >= Noise_per )
>   {
>      Noise_count = 0;
>      Noise_val = YM2149_RndCompute();                	
>   }
> 
> so it correctly updates noise output each time the counter reached the 
> current period.
> 
> And when comparing STF wav recording with Hatari's wav this gives indeed 
> similar wave signals and phase duration for noise.
> 
> Or did you mean sthg else ?

I mean the code here (although I had to look at older code because
of hg.tuxfamily.org not working).

The problem is that:  if ( Noise_count >= Noise_per )
should be a for() loop because if someone chooses a frequency of
125kHz, YM2149_RndCompute() needs to be called 125000 times
per second. In this example, the noise generator makes frequencies
from 125kHz down to 125kHz/2^17 and some of these frequencies
are above the nyquist limit of the sampling rate.

(Assuming 125kHz is possible with the registers - What is the highest frequency?)



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/