How to compile Nyquist with LPC functions

Note: this is compiled with MSVC 6 in Windows

1. Translate lpreson.alg : Result lpreson.h, lpreson.c
2. Translate allpoles.alg: Result allpoles.h, allpoles.c
3. lpanal.h and lpanal.c are coded in C (no alg file)
4. Modify the files
                    sndfint.c
                    sndfnintptrs.h
                    sndfintdefs.h
   as it is show below
   (I modify this "by hand" although it may be automatized)
5. Add all these files to Nyquist project
6. Compile

----------------------------------------------------------------------------------

To add these functions to Nyquist "by hand"  edit the files and add this C code







SOURCE CODE FOR sndfint.c



#include "lpanal.h"

/* xlc_snd_lpanal -- interface to C routine snd_lpanal */
/**/
LVAL xlc_snd_lpanal(void)
{
	LVAL arg1 = xlgetarg();
    long arg2 = getfixnum(xlgafixnum());
	LVAL result;

	xllastarg();
	result = snd_lpanal(arg1,arg2);
	return (result);
}

#include "allpoles.h"

/* xlc_snd_allpoles -- interface to C routine snd_allpoles */
/**/
LVAL xlc_snd_allpoles(void)
{
    sound_type arg1 = getsound(xlgasound());
	LVAL arg2 = xlgetarg();
    double arg3 = testarg2(xlgaanynum());
    sound_type result;

	xllastarg();
	result = snd_allpoles(arg1, arg2, arg3);
	return cvsound(result);
}


#include "lpreson.h"

/* xlc_snd_lpreson -- interface to C routine snd_lpreson */
/**/
LVAL xlc_snd_lpreson(void)
{
    sound_type arg1 = getsound(xlgasound());
	LVAL arg2 = xlgetarg();
    double arg3 = testarg2(xlgaanynum());
    LVAL result;

	xllastarg();
	result = snd_lpreson(arg1, arg2, arg3);
	return cvsound(result);
}


=========================================================================


SOURCE CODE FOR  sndfintptrs.h

  { "SND-LPANAL", S, xlc_snd_lpanal},
  { "SND-ALLPOLES", S, xlc_snd_allpoles},
  { "SND-LPRESON", S, xlc_snd_lpreson},
 

=========================================================================

SOURCE CODE FOR sndfintdefs.h

extern LVAL xlc_snd_lpanal(void);
extern LVAL xlc_snd_allpoles(void);
extern LVAL xlc_snd_lpreson(void);





