Re: [hatari-devel] Preserving YM2149 sound phase |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Preserving YM2149 sound phase
- From: David Savinkoff <dsavnkff@xxxxxxxxx>
- Date: Tue, 18 Oct 2016 12:16:59 -0600 (MDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=neo; t=1476814621; bh=zkjZYaBPqQKX4T13viXcaNIDFUvcFjndGv5d7Uq/0GE=; h=Date:From:To:In-Reply-To:Subject; b=x1AjEyn8/7+rF8LRztYAa7I+MOyVe+Dg6PBwbXWX+AgMVvAtAn1pZy83Yd/GRZ5Tv X4aI8QTMY9Nc76CZNAZfJg0UnXMG0JyZe5Po2B7ncMqkpHfHdifz/uXjv9Hdruac30 C9KKCxpIRGhxxCBDcaseuFyEmva7ey0Rjtc+0xakPafJ/dupkmpCPe7us4J9XD2X3h kcy72BNygTRNdrCi9hrATdUIKbNriEyfZC5SZUvuSz4BE5RTjEEkMsDh20mI3uznLL GTawyzO8eZJGnOF2r9nVM5Ai5Cj/ZnXhLnl4T6xMEoYMWmvhC6i3q40ZhrUKNgDFjt gJbigMZFAp5aQ==
- Thread-index: 3M39+0wlEMYyuTNKAZ/2WXHvOSWc4w==
- Thread-topic: Preserving YM2149 sound phase
----- Nicolas Pomarède wrote:
> Le 17/10/2016 à 23:46, David Savinkoff a écrit :
> > Hi Nicolas,
> >
> > The following was posted on Atari Forum, and was
> > partially investigated:
> > ****
> > http://www.atari-forum.com/viewtopic.php?f=18&t=27521&sid=a0d1b43f0f66988900541b039ab5f6d4#p285292
> >
> > "Postby troed » Sun Dec 20, 2015 10:20 pm
> > Re: some questions about YM2149F vs emulators vs MIST
> >
> > There are several ways in which Hatari doesn't sound like an
> > original machine. The first version of 7an's song for our
> > STNICCC demo "Closure" had to be scrapped altogether.
> > He wrote the song(s) in Hatari which apparently always plays
> > all voices in phase, while on actual hardware they fall in
> > and out of phase (sometimes cancelling each other out completely).
> > This is somewhat better emulated by SC68."
> > ****
> >
> > The enclosed patch tested ok on the few demos that I tried.
> > Please see if it works for you.
> >
> > This patch preserves the value in posA, posB and posC
> > rather than over-writing the value when stepA, stepB
> > or stepC is zero. Thus reducing interference with the phase.
> >
> > stepA, stepB and/or stepC are no longer set to zero when a
> > frequency is higher than the sampling rate, this affects
> > phase also.
> >
> > I'm hoping this patch solves the phase problem.
> >
> > Sincerely,
> > David Savinkoff
> >
>
> Hi
>
> thanks for your patch ; I'm aware of the problem, but before applying
> any new patch, I'd like to do some "high frequency" recording of the
> analog YM output of my STF to carefully measure what happens exactly
> when PerLo/PerHi are changed, depending on which point of the square
> wave we're at the moment of the change.
>
> Basically, this all depends on own the YM uses the PerLo/Hi value :
> - does it starts an internal counter from 0 and change phase when
> counter reaches Per ?
> - does it starts an internal counter from Per and decrement it and
> change phase when it reaches 0
> - If so, does it change phase when reaching Per (or 0) or at the next
> iteration ?
>
> I saw numerous implementations of the YM (or its derivative), each one
> claiming "compatibilty" with the original chip (fpga, vhdl, MAME, ...),
> but each one with a different way to count :( It seems the correct way
> is to start at 0 and change when reaching Per, but that's I want to
> measure (that's not how Hatari works at the moment, hence the problem)
>
> To do so, I'm planning some very precise writes in the sound register
> (sync'ed with the video counter) to get a very reproducable test and to
> be able to change PerLo or PerHi at some exact point where the phase is
> supposed to change in the YM (or just after/before).
> Depending on whether each write will have an effect or not, I will be
> able to determine how the YM takes Per regs into account and if a change
> to them is immediate or not.
>
> Nicolas
>
Hi Nicolas,
I'm confident, from what you say, the phase problem is as good as fixed.
Sincerely,
David Savinkoff