From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F1XBw-0002vN-MT for qemu-devel@nongnu.org; Tue, 24 Jan 2006 18:03:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F1XBc-0002XZ-8S for qemu-devel@nongnu.org; Tue, 24 Jan 2006 18:02:57 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F1Wa4-0001dw-4R for qemu-devel@nongnu.org; Tue, 24 Jan 2006 17:24:04 -0500 Received: from [84.96.92.60] (helo=Smtp.neuf.fr) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F1W1x-0001WF-K8 for qemu-devel@nongnu.org; Tue, 24 Jan 2006 16:48:49 -0500 Received: from [84.102.211.91] by sp604001mt.gpm.neuf.ld (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0ITM003F19OA66M1@sp604001mt.gpm.neuf.ld> for qemu-devel@nongnu.org; Tue, 24 Jan 2006 22:43:23 +0100 (CET) Date: Tue, 24 Jan 2006 22:45:44 +0100 From: Fabrice Bellard Subject: Re: [Qemu-devel] [PATCH] PC speaker emulation (fixed point) In-reply-to: <43D67218.9000107@softax.com.pl> Message-id: <43D6A008.30606@bellard.org> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT References: <43C2CA44.9080504@bellard.org> <66187480-AA25-4749-B6E7-8630B804A6EA@gmx.de> <43D0D1A4.4090304@softax.com.pl> <43D61F14.8080209@softax.com.pl> <4EECB3A5-BFC6-4003-BABF-A1EC5ED958E6@gmx.de> <43D67218.9000107@softax.com.pl> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Sebastian Kaliszewski wrote: > Joachim Henke wrote: > >> Ok, these are really strong arguments. Thanks a lot for your >> interesting statements! I'll do some testing on square waves and will >> post an updated patch, as I am also not totally satisfied with the >> current sound myself. > > > One little suggestion... > > Real PC-speaker is rather poor source of sound, and I also noticed, that > sound cards which took PC-speaker sound for themselves (some SB-clones > did route PC-speaker sound into thier own output) liked to low-pass > filter the resulting audio. So to make things as real as feasible, use > your wave table to store something like square wave with rounded corners > -- maybe sth like pow(sin(x), 0.2) (i.e. sinus rooted to 5th degree) > will sound pleasant enough. If you want to model the real PC speaker, the best to do is to generate a square signal and to pass it thru a low pass filter with a cut off frequency of a few kHz. Then you could even be able to play samples thru the simulated PC speaker using the tricks used in old MSDOS programs, provided QEMU implements a precise cycle counter (it will come someday !). Fabrice.