Re: [hatari-devel] Gain too low in DmaSnd_LowPassFilter for STE ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Gain too low in DmaSnd_LowPassFilter for STE ?
- From: David Savinkoff <dsavnkff@xxxxxxxxx>
- Date: Sun, 7 Aug 2016 17:30:58 -0600 (MDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=neo; t=1470612658; bh=Mi0EOHEKXaUgg6HzeVnvFvuiy4rUwxfuUGm+EJJOu/0=; h=Date:From:To:In-Reply-To:References:Subject; b=MCz3wvcg8tuIUelmMLv0zbvspUBzfL7eoO3wygPAX9EEKNLQivnACvGo6HzC6vPpY HlIh8LCjUKDaICUA4tBf9icXcXEKeqM+qbUsWkxoEkRyxVKGvvVB8gg+PHIeUcZ7c6 MCZcDM3x9cL24I7hBOLLitttVHcNVD0g5G7ARyDjX5Zoha6KoA2MMTfr74nY98VFNw mi+j8h3P2CEuYeFXkJRM+cYC1qGA64W98+rhFfG3BRHAeNCxRCW/t8IaBEik0BczHU PXM3c1bguSqFWrc9ELCxMbWjnI0dKEcYMhPq7AGYTgFCSNS3i6fT70wOccNNffnCko ogYSGW3ljVmBQ==
- Thread-index: +tbjmxbA3o4D7/XDsuD3fRHJmaYs1Q==
- Thread-topic: Gain too low in DmaSnd_LowPassFilter for STE ?
Hi,
Well... at least I got dmaSnd.c right.
Now I'll take my time to get more done right.
----- Nicolas Pomarède wrote:
> Le 07/08/2016 à 20:45, David Savinkoff a écrit :
> >
> > Do this instead.
> > /****** return (in * 3) << 1; */
> > and not what I said earlier,
> > but experiment
> > gotta go.
> >
>
>
> hi
>
> "return (in * 3) << 1" (which is "in *6" in fact :) ) gives much more
> hearable digi sound in the case of these musics, this sound better.
Louder is indeed better! :)
>
> As for really fine tuning the YM and DMA sound relative output volume on
> STE, I think we would need to record some STE output as a wav file when
> mixing a simple YM note with a square wave sample for example, then
> compare the resulting wav with the output of Hatari.
>
> I will be away for 3 weeks, but if someone feels like recording a real
> STE, then it could be useful to improve Hatari's relative volume level.
>
> Nicolas
>
>
>
> > ----- David Savinkoff wrote:
> >> ----- Nicolas Pomarède wrote:
> >>> Hi
> >>>
> >>> as discussed here
> >>> http://atari-forum.com/viewtopic.php?f=16&t=29615&p=299270#p299270 the
> >>> STE DMA sound samples can't be heard when using an output freq < 50066
> >>> Hz in Hatari (for example, try "salamander : planet latis")
> >>>
> >>> At 50066 Hz you hear the samples, but at 48 kHz you don't hear them
> >>> anymore. This is because 50066 explicitely turn DMA low pass filter OFF
> >>> in the code path.
> >>>
> >>> David, do you think it would be possible to increase the gain in
> >>> DmaSnd_LowPassFilter to hear the samples even when using < 50 kHz output
> >>> freq ?
> >>>
> >>> Note that in this music demo, samples already have a low volume (if you
> >>> just listen to the wav file with Audacity for example), so maybe the
> >>> fact that the sample don't use the full 8 bit range is fooling the
> >>> filter and you get an even lower volume in the end ?
> >>>
> >>> Nicolas
> >>>
> >> Hi,
> >>
> >> I will look into this later today. Note that 55 KHz has no filter so
> >> that one can re-sample it with their own filter, thus, 55 KHz
> >> samples should be sharper than a real STE.
> >>
> >> The low pass filter Hatari uses filters high frequencies a little
> >> too much.
> >>
> >> see /****** return (in * 3) << 3; */ below. Which refers to
> >> hatari/src/dmaSnd.c
> >>
> >> This will increase the gain by approx 3dB
> >>
> >> Experiment until you like it. Note that low frequencies will
> >> be boosted also. Note that just increasing the cutoff
> >> frequency will require an expensive filter.
> >>
> >> /**
> >> * LowPass Filter Left
> >> */
> >> static Sint16 DmaSnd_LowPassFilterLeft(Sint16 in)
> >> {
> >> static Sint16 lowPassFilter[2] = { 0, 0 };
> >> static Sint16 out = 0;
> >>
> >> if (DmaSnd_LowPass)
> >> {
> >> out = lowPassFilter[0] + (lowPassFilter[1]<<1) + in;
> >> lowPassFilter[0] = lowPassFilter[1];
> >> lowPassFilter[1] = in;
> >>
> >> return out; /* Filter Gain = 4 */ /****** return (in * 3) << 1; */
> >> }else
> >> {
> >> return in << 2; /****** return (in * 3) << 3; */
> >> }
> >> }
> >>
> >> /**
> >> * LowPass Filter Right
> >> */
> >> static Sint16 DmaSnd_LowPassFilterRight(Sint16 in)
> >> {
> >> static Sint16 lowPassFilter[2] = { 0, 0 };
> >> static Sint16 out = 0;
> >>
> >> if (DmaSnd_LowPass)
> >> {
> >> out = lowPassFilter[0] + (lowPassFilter[1]<<1) + in;
> >> lowPassFilter[0] = lowPassFilter[1];
> >> lowPassFilter[1] = in;
> >>
> >> return out; /* Filter Gain = 4 */ /****** return (in * 3) << 1; */
> >> }else
> >> {
> >> return in << 2; /****** return (in * 3) << 3; */
> >> }
> >> }
> >>
> >>
> >>
> >
> >
> >
>
>
>