Re: [hatari-devel] 7an's Hi-Hats |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: Nicolas Pomarède <npomarede@xxxxxxxxxxxx>
- Subject: Re: [hatari-devel] 7an's Hi-Hats
- From: David Savinkoff <dsavnkff@xxxxxxxxx>
- Date: Thu, 29 Jun 2017 18:45:28 -0600 (MDT)
- Cc: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=neo; t=1498783528; bh=c+8TIJwQJi0VyvRdLANkHeiVi8f4B0rSpgr7oBUJh1o=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=KtSRR9PU78fFg5dDp3CrNfTl2V07amHMnPFJVsW8ewSyXoRdGny1NsWPovb7Fz212 C7PzME9JsjuWVxn3Dzs/+QZK+r+hz0kZd4/puAGfaUr+8bgQWA6JVhqi1Ks/yZtxAF ZxqYp57xi5zQw0Yw4XnAvTjZ3e1a/ZQpsijFrxXdVP21uGolrKyEcnh5RIR7dgFBT0 TNAh9z6RquruKth8UY2nM7mGWEFEcv+Blvz2MefpIXLl+oiVXi573E32z++tDlvqlq TThE6xuSmVqSsi7yR6YY9fis8n6BuVzgrrZr/fuHWtDhdoMtg+G498V9MiakbkOsLy ZId4wbm9gAGwA==
- Thread-index: GpD/IEOZVdmV4TxDjNcWwQymiwMWHQ==
- Thread-topic: 7an's Hi-Hats
----- 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?)