[comp.sys.amiga] Low Pass Filter

leo@tandem.Tandem.com (Leo Hejza) (05/11/89)

At the risk of flames, I have an old, often asked question, and one
other one

I am in the process of writing a digital sound synthesis program
for the Amiga. Rather tha using the D/A hardware to play samples
I am using it to play back a stream of digitized information. The
information is generated by a program which emulates analog synthesis
modules (e.g. oscillators, filters, envelope generators), under
control of a musical score input file. The program is functional now,
I had eight voices playing last night.

Now the questions, How do I turn off the D/A low pass filter. I'm playing
28K+ samples /second back and want to recover all the information which
is there. I already pass the output through a steep digital low pass
filter below the Nyquist frequency so aliasing won't be a problem.

Other question, is my playback scheme the same as an SMUS player. If so
could someone send me the file format? I'll change my output to be compatible.

Thanks for any help. I'll send the program out after the user interface
exists.

sneakers@heimat.UUCP (Dan "Sneakers" Schein) (05/13/89)

In Message <434@tandem.Tandem.com>, leo@tandem.Tandem.com (Leo Hejza) writes:

>Now the questions, How do I turn off the D/A low pass filter. I'm playing
>28K+ samples /second back and want to recover all the information which
>is there. I already pass the output through a steep digital low pass
>filter below the Nyquist frequency so aliasing won't be a problem.

  Heres the code I wrote for AmigaMail awhile back.....

---<CUT HERE>---
/* Toggle the 500 & B2000 sound filter on/off */
/* 10-JAN-88   Dan Schein - Commodore (CATS)  */

#include <exec/types.h>
#include <stdio.h>
#include <hardware/cia.h>
#include <hardware/custom.h>
#include <hardware/intbits.h>

extern struct CIA ciaa;

UBYTE oldbits;

void main(), SetFilter(), RestoreFilter();

void main()
{
    SetFilter();                   /* Turn filter OFF                 */

    Delay(45);                     /* Do your thing here.........     */

    RestoreFilter();               /* Restore filter to original      */
}

void SetFilter()
{
    Disable();                     /* Let me alone!                   */
    oldbits = ciaa.ciapra;         /* Get the current state of filter */
    ciaa.ciapra |= CIAF_LED;       /* Force the filter off            */
    Enable();                      /* All done :-)                    */
}

void RestoreFilter()
{
    Disable();                     /* Let me alone!                   */
    if (!(oldbits & CIAF_LED))     /* Check to see if filter was on   */
    {                              /* Filter was on - turn it back on */
        ciaa.ciapra &= (~ CIAF_LED);
    }
                                   /* Filter was off - leave it off   */
    Enable();                      /* All done :-)                    */
}
---<CUT HERE>---

   AmigaMail is published by CATS 12 times a year and is included FREE to all
   Commercial/Certified developers -or- via a subscription. Look into it,
   there great reading and they make great refrence material ;-)

   Sneakers

--
                                      ___
    Dan "Sneakers" Schein            ////          BERKS AMIGA BBS
    Sneakers Computing              ////   80+ Megs of software & messages
    2455 McKinley Ave.      ___    ////         12/2400 Baud - 24 Hrs
    West Lawn, PA 19609     \\\\  ////              215/678-7691
                             \\\\////
    {pyramid|rutgers|uunet}!cbmvax!heimat!sneakers