[hatari-devel] LMC1992 and Microwire emulation
Laurent Sallafranque
laurent.sallafranque at free.fr
Sun Mar 14 23:29:42 CET 2010
Hi David,
>> do you plan to add things?
> We'll work together on this one until it works.
Great, that's nice of you.
>> or implement it ?
> Your job :)
No problem.
for the rest, I think the best would be 2 precalculated tables if that's
not too much job.
Hatari can precalculate values at the beginning and fill the lookup tables.
Like this, it'll take the lower CPU time to get the filter values for
left and right channel.
I don't know if combined parameters are closer to STE reality or
separate ones are better
(you're the specialist here ;)
Anyway, we must find the best compromize between speed and accuracy.
From my point of view, I would say option 3 :
-A lookup table may be used to access the coefficients, depending
on the bass and treble settings.
Actually, I've got 2 buffers :
- 1 for the left channel sound
- 1 for the right channel sound
From my understanding, bass and treble are independent.
Bass and treble are the same value for both left channel and right channel.
So, if the 14400 elements is too hard to compute automatically at
Hatari's startup,
we should use the 2 tables and combine them by programming.
Another 2 question :
- I've seen that you use 512 size buffers to compute the bass/treble.
My buffers are not sized by 512. Will it be a problem ?
- Ste's sound frequency can be 6258.0 Hz, 12517.0 Hz, 25033.0 Hz or
50066.0 Hz
Will the filter works for all these frequencies or will we have to
compute 4 tables ?
Again thanks a lot.
Regards
Laurent
David Savinkoff a écrit :
> Hi,
>
> > Can I use your code to include it into hatari?
> Yes.
>
> > do you plan to add things?
> We'll work together on this one until it works.
>
> > or implement it ?
> Your job :)
>
> > As on STe / TT the bass and treble parameters can vary from -12 dB
> > to +12 dB independently, which variables in your code should I map
> > to bass value and treble value ?
>
> IIRfilterL() and IIRfilterR() currently share the same coefficients,
> thus filtering the left and right sound channels the same (as is
> the case on the Atari).
>
> The Bass and Treble will be independent. There are three ways this
> could be done:
> -A program will be made to generate separate bass and treble
> coefficients.
> -A program will be made to combine the bass and treble coefficients
> -A lookup table may be used to access the coefficients, depending
> on the bass and treble settings.
>
> Three considerations:
> - It is possible to generate separate bass and treble coefficients
> 'on the fly' in Hatari, then combine the coefficients, then use them
> every time the bass or treble changes (no look up table)
> - It is possible to put separate bass and treble coefficients into two
> separate lookup tables and combine them 'on the fly' every time the
> bass or treble changes.
> - It is possible to put combined bass and treble coefficients into one
> lookup table, then use them every time the bass or treble changes.
>
> Bass alone needs 3 coefficients for one setting. Treble is the same.
> There are 24 independent settings for bass and treble on the Atari.
> A bass lookup table would be 3*24=72 elements long, likewise, the
> treble table. Thus, two 72 element single dimensional arrays are used
> in this case.
>
> A combined lookup table would be a single two dimensional array of
> (5 coefficients * 24 settings) by (5 coefficients * 24 settings).
> Thus 14400 elements would be used. This array could be initialized
> in Hatari, or could be part of the program data.
>
> The coefficients in BassTrebCut12dB were semi-laboriously derived
> with a simple calculator, pencil, paper and eraser.
>
More information about the hatari-devel
mailing list