[hatari-devel] LMC1992 and Microwire emulation

Laurent Sallafranque laurent.sallafranque at free.fr
Thu Mar 11 21:25:45 CET 2010


Hi,

> Laurent, maybe we can postpone this feature for the version after the
> next public release?


It's no problem. For now, I've already implemented the Microwire 
behaviour (mixing between Yamaha and DMA, and getting values for left, 
right and master volume, and values for bass and treble).

I've also implemented a static logarythmic table for sound management 
(left, right) and another table for Master volume management.

All of this can be enough for the next release.

TODO : actually, from my point of view, there's just to :

- adjust correctly the -12 db attenuation for the Yamaha sound when 
mixed with the DMA in Microwire mode 0 (the value I use actually is 
taken directly from my static volume table)
- add the FIR filter just before the volume loop.
- adapt the volume loop if necessary.

There's just to add FIR and modify Volume loop after the following 
comment in DMASND.C :

    /* Apply LMC1992 sound modifications (Left, Right and Master Volume */
    /* Todo: Bass and treble */

    // Here should be implemented the FIR filter

    // the last following loop is for left, right and Master volume.

    for (i = 0; i < nSamplesToGenerate; i++) {
        nBufIdx = (nMixBufIdx + i) % MIXBUFFER_SIZE;
        MixBuffer[nBufIdx][0] = (((MixBuffer[nBufIdx][0] * 
microwire.leftVolume) >> 16) * microwire.masterVolume) >> 16;
        MixBuffer[nBufIdx][1] = (((MixBuffer[nBufIdx][1] * 
microwire.rightVolume) >> 16) * microwire.masterVolume) >> 16;
    }


My filters studies are too far away (and I'm a bit too lazy to return 
into this theory for now).
If David feels it, I would be really happy to let him code the filter.
There's no need to have this feature for the next release anyway, we can 
spread it without.

Best regards,

Laurent


Thomas Huth a écrit :
>  Hi!
>
> On Wed, 10 Mar 2010 17:45:03 -0700 (MST)
> David Savinkoff <dsavnkff at telus.net> wrote:
>  
>   
>> *** hatari can let the host computer do the following work ***
>>
>> Next, the stereo sound is stereo filtered by the bass and treble
>> filters. Next, the sound goes to an overall volume control. Next,
>> the sound goes through left/right front/back balance controls.
>> Note that only the front stereo is used.
>>
>> The stereo sound is sent to audio connectors. This stereo
>> sound is also mixed to mono and sent to a speaker, or the RF
>> modulator.
>>
>> I ran kmix and alsamixer and was able to adjust the tone of
>> Hatari 1.3.1. Thus, if Hatari can communicate the volume
>> and tone settings, this is definitely the way to go.
>>     
>
> That's a nice idea, but I think it is not feasible to implement.
> AFAIK there is no system-independent API to talk to the mixer of the
> host computer. That means we would have to write separate code for
> ALSA, for OSS, for Windows, for Mac OS X, etc. That's no fun at all.
>
> I'd say we should rather go the FIR filter way. I also took a class
> about FIR filters at my university, but that's already a couple of
> years ago... and I currently don't have much spare time.
> Laurent, maybe we can postpone this feature for the version after the
> next public release?
>
>  Thomas
> _______________________________________________
> hatari-devel mailing list
> hatari-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/hatari-devel
>
>
>   




More information about the hatari-devel mailing list