diff --git a/lib-src/libnyquist/nyquist/Readme.txt b/lib-src/libnyquist/nyquist/Readme.txt index f5feba403..185bb71e8 100644 --- a/lib-src/libnyquist/nyquist/Readme.txt +++ b/lib-src/libnyquist/nyquist/Readme.txt @@ -1,5 +1,5 @@ -README file for Nyquist Version 3.09 -28 Dec 2014 +README file for Nyquist Version 3.15 +11 Sep 2018 Roger B. Dannenberg LICENSE: see license.txt @@ -8,9 +8,17 @@ WEB SITE: http://www.cs.cmu.edu/~music/nyquist INSTALLING NYQUIST ==================== You can download pre-compiled versions for Windows and OS X. +After downloading, please see + +---------------------------------------+ + | http://www.cs.cmu.edu/~music/nyquist/ | + +---------------------------------------+ +for additional information, or look for one of + - nyquist/doc/readme-win.txt + - nyquist/doc/readme-mac.txt + - nyquist/doc/readme-linux.txt -You can compile Nyquist from sources for Windows, OS X, linux, and -other versions of Unix. For details, see one of these files: +You can compile Nyquist from sources for Windows, OS X, linux, +and other versions of Unix. For details, see one of these files: - sys/win/README.txt - sys/mac/README.txt - sys/unix/README.txt @@ -19,38 +27,68 @@ other versions of Unix. For details, see one of these files: IMPLEMENTATION STATUS ===================== +Version 3.15 provides: + Fix to retain selected nyquist directory + Fix for NyquistIDE in paths with spaces + Extension list file can be selected in Preferences for testing +Version 3.14 provides: + New runtime configuration: a nyquist directory in user's home + directory has all documentation, libraries, extensions, + and only executables are "hidden" and read-only. +Version 3.13 provides: + Extension Manager and many examples moved to extensions +Version 3.12 provides: + Fix for Help:Manual and links to docs on OS X 12 (I hope) + Fix for reverb function (3.11 broke it) + Better type checking for OSC table parameter +Version 3.11e provides: + Works again as 64-bit executable on Windows 10 +Version 3.11b provides: + fix to FFT, apparently only affects only 64-bit Windows + improved formatting of reference manual (PDF) and minor + documentation changes +Version 3.11 provides: + Significantly more parameter checking and error reporting for + Nyquist primitives. +Version 3.10 provides: + phasevocoder -- new phase vocoder function + pv-pitch-time -- phase vocoder + resampling for independent pitch + and speed control + convolve -- new fast convolution + interactive control of sounds with make-slider-panel, + close-slider-panel, make-slider, make-button, slider, + lpslider, get-slider-value, snd-slider, stop-on-zero, trigger, + snd-stop-on-zero, and snd-trigger functions + bug fix to snd-down (called by force-srate) that could crash Nyquist + adjustable upper limit on memory allocated for sounds, see + snd-set-max-audio-mem function Version 3.09 provides: Various bug fixes OS X version is significantly faster Security features added to limit CPU, memory, file access (default is still unrestricted; this feature is to protect servers) - Version 3.08 provides: NyquistIDE opens documentation properly on default browser NyquistIDE forcefully terminates nyquist process on exit if needed bug fix for mixed sample rate signal handling, affects many primitives timed-seq and score-play avoid stack overflow on finely spaced events sampler() primitive does error checking to avoid infinite loop - Version 3.07 provides: Bug fixes in NyquistIDE Envelope Editor NyquistIDE installs symbolic links to lib and demos directories from nyquist directory (where documentation is kept) so these folders are not hidden in the app bundle. Bug fix in quantize and snd-quantize functions. - Version 3.06 provides: 64-bit architecture support Access to OGG and FLAC file formats Updates for MSVC++2010, VS2012, XCode 4.5 This is a deadline-driven release. Expect an update soon. - Version 3.05 provides: New "UPIC Editor" window in NyquistIDE Fix to escape backslashes in default windows directory Fix to other problems with Preferences Arpeggiator example in nyquist/demos - Version 3.04 provides: Updates to libraries, including liblo and PortAudio Documentation uses both syntax SAL and Lisp syntax @@ -84,32 +122,32 @@ Version 2.38 provides: bug fixes in Equalizer editor additional documentation for demos/plight/drums.lsp option click or right click on completion list to get help - manual can be displayed in an internal window in jNyqIDE + manual can be displayed in an internal window in NyquistIDE Version 2.37 provides: fix for byte order on Mac PPC that prevented pianosyn.lsp from loading Version 2.36 provides: - cross-platform browser launching in jNyqIDE - fix search path set by jNyqIDE (OS X-related bug introduced in 2.35) + cross-platform browser launching in NyquistIDE + fix search path set by NyquistIDE (OS X-related bug introduced in 2.35) fix bug in slider update code on OS X Version 2.35 provides: fix for Open Sound Control under Windows/jNyqIDE - other minor jNyqIDE fixes + other minor NyquistIDE fixes Version 2.34 provides: - fix to ^U (send selection to Nyquist) in jNyqIDE + fix to ^U (send selection to Nyquist) in NyquistIDE default sound file path for Mac OS X is /tmp Nyquist exits when EOF detected -- try to make orphans abort Version 2.33 provides: additional documentation for Open Sound Control interface and utility programs Version 2.32 provides: - envelope editor in jNyqIDE - EQ editor in jNyqIDE - score editor in jNyqIDE + envelope editor in NyquistIDE + EQ editor in NyquistIDE + score editor in NyquistIDE slider support in Nyquist OSC (Open Sound Control) interface OSC test program and serial-to-OSC program drum machine (as separate download) - jNyqIDE has pop-up menus and per-file menu bars + NyquistIDE has pop-up menus and per-file menu bars Version 2.31 provides: new compositional algorithm support in xm.lsp many bug fixes diff --git a/lib-src/libnyquist/nyquist/cmt/cext.h b/lib-src/libnyquist/nyquist/cmt/cext.h index 665c13df6..8ae668c24 100644 --- a/lib-src/libnyquist/nyquist/cmt/cext.h +++ b/lib-src/libnyquist/nyquist/cmt/cext.h @@ -19,7 +19,8 @@ Pointer -- pointer to char, a generic pointer ABS() -- absolute value of any type of number MAX() -- maximum of two numbers MIN() -- minimum of two numbers -ROUND() -- round a double to long +ROUND32() -- round a double to int +ROUNDBIG() -- round a double to intptr_t NULL -- pointer to nothing, a constant EOS -- end of string, a constant '\0' @@ -45,6 +46,8 @@ EXIT(n) -- calls exit(n) after shutting down/deallocating resources #include #include #include +#include +#include #if HAS_STDLIB_H #include @@ -178,11 +181,21 @@ public void EXIT(int); MALLOC is not defined! #endif -#define ROUND(x) ((long) ((x) + 0.5)) - +#define ROUND32(x) ((int) ((x) + 0.5)) +// on 32-bit machines, ROUNDBIG rounds to int32_t +// on 64-bit architectures, ROUNDBIG rounds to int64_t +#define ROUNDBIG(x) ((intptr_t) ((x) + 0.5)) +/* obsolete: ROUND is needed for both ints, e.g. sample rates, + and big ints, e.g. sample counts, so we have two ROUND + functions. We use intptr_t for ROUNDBIG because long on + Windows is only 32 bits, while intptr_t is 64 bits. + With the addition of these 2 functions, we never + "NEED_ROUND" and trying to use round will cause an error. + */ /* for compatibility */ #ifdef NEED_ROUND -#define round ROUND +// #define round ROUND +#define round you should not use round #endif #ifndef min diff --git a/lib-src/libnyquist/nyquist/cmt/cmtcmd.c b/lib-src/libnyquist/nyquist/cmt/cmtcmd.c index 311a5876a..28814678d 100644 --- a/lib-src/libnyquist/nyquist/cmt/cmtcmd.c +++ b/lib-src/libnyquist/nyquist/cmt/cmtcmd.c @@ -14,7 +14,7 @@ #define HASHELEM(p) ((p).symbol_name) #define HASHVAL 50 #define HASHENTRIES 50 -#define HASHENTER hash_lookup +#define HASHENTER lookup #define HASHNOCOPY #include "hashrout.h" @@ -23,7 +23,7 @@ void defvar(name, addr) char *name; int *addr; { - int i = hash_lookup(name); + int i = lookup(name); HASHENTRY(i).symb_type = var_symb_type; HASHENTRY(i).ptr.intptr = addr; } @@ -33,7 +33,7 @@ void defun(name, addr) char *name; int (*addr)(); { - int i = hash_lookup(name); + int i = lookup(name); HASHENTRY(i).symb_type = fn_symb_type; HASHENTRY(i).ptr.routine = addr; } @@ -44,7 +44,7 @@ void defvec(name, addr, size) int *addr; int size; { - int i = hash_lookup(name); + int i = lookup(name); HASHENTRY(i).symb_type = vec_symb_type; HASHENTRY(i).size = size; HASHENTRY(i).ptr.intptr = addr; diff --git a/lib-src/libnyquist/nyquist/cmt/cmtcmd.h b/lib-src/libnyquist/nyquist/cmt/cmtcmd.h index 22a64620a..9ad1cac31 100644 --- a/lib-src/libnyquist/nyquist/cmt/cmtcmd.h +++ b/lib-src/libnyquist/nyquist/cmt/cmtcmd.h @@ -25,7 +25,7 @@ typedef struct symb_descr { } ptr; } symb_descr_node; -int hash_lookup(char *s); +int lookup(char *s); void defvar(char *name, int *addr); void defvec(char *name, int *addr, int size); typedef int (*defun_type)(); diff --git a/lib-src/libnyquist/nyquist/cmt/midifns.c b/lib-src/libnyquist/nyquist/cmt/midifns.c index e8f748293..78ee06b1f 100644 --- a/lib-src/libnyquist/nyquist/cmt/midifns.c +++ b/lib-src/libnyquist/nyquist/cmt/midifns.c @@ -110,7 +110,7 @@ #define BREAKTEST #endif -#ifdef __APPLE__ +#ifdef UNIX_MACH #include #include #include @@ -131,7 +131,7 @@ #endif /* UNIX_IRIX_MIDIFNS */ #endif /* UNIX_IRIX */ #endif /* UNIX */ -#endif /* __APPLE__ */ +#endif /* UNIX_MACH */ #ifdef ITC static int ignore_realtime = 0; @@ -395,7 +395,7 @@ void eventwait(timeout) } #else /* !UNIX_ITC */ #ifdef UNIX -/* see machmidi.c for UNIX_MACH implementation */ +/* see machmidi.c for UNIX_MACH (OS X) implementation */ #ifndef UNIX_MACH #ifdef UNIX_IRIX_MIDIFNS void eventwait(timeout) @@ -1614,6 +1614,8 @@ private void musicterm() * random number (lo <= result <= hi) ****************************************************************************/ +/* to avoid confusion and dead code, take this out */ +#ifdef ALL_CMT long randseed = 1534781L; short cmtrand(short lo, short hi) @@ -1659,6 +1661,8 @@ void settime(newtime) #endif #endif } +#endif //ALL_CMT + /**************************************************************************** * timereset @@ -1745,7 +1749,7 @@ void tracemidi(boolean flag) ***********************************************************************/ #ifdef DOS - +#include /* binary value of hex char */ private int xval(int c) @@ -1754,7 +1758,7 @@ private int xval(int c) static char t[]="0123456789abcdef"; for (i=0; i<16; i++) - if(tolower(c)==t[i]) return(i); + if (tolower(c)==t[i]) return(i); return (-1); } @@ -1814,7 +1818,7 @@ private void midi_init() gprintf(TRANS,"MPUBASE %s\n",t); base=atox(t); } - if(err = mOpen(base, irq)) { + if (err = mOpen(base, irq)) { mClose(err); EXIT(1); } diff --git a/lib-src/libnyquist/nyquist/cmt/moxc.c b/lib-src/libnyquist/nyquist/cmt/moxc.c index f62d65d59..11f94e704 100644 --- a/lib-src/libnyquist/nyquist/cmt/moxc.c +++ b/lib-src/libnyquist/nyquist/cmt/moxc.c @@ -18,6 +18,16 @@ * 4-Mar-91 | GWL : DOS allows odd inst addrs * 10-Oct-94 | nix : posicionador tridimensionale interface * 28-Apr-03 | DM : true->TRUE, false->FALSE +* 18-May-15 | RBD : The varargs hack to allow arbitrary parameters (only +* | limited by total size) passed to cause() breaks down on ia64 +* | where args are not passed uniformly on the stack. To fix this +* | the beautiful cause() that survived 30 years of ports, will +* | finally have to go. The new cause() will take only one +* | parameter to pass along to callees. It will be of type +* | call_args_node (the same type used by the scheduler to store +* | the args.) It will now be up to the caller to pack the real +* | args into call_args_node, and up to the callee to unpack. +* | (packing/unpacking were previously hidden in moxc.c) *****************************************************************************/ #include "switches.h" @@ -72,7 +82,7 @@ extern char *app_syntax; * * EXPORTS: * -* cause(delay, routine, p1, p2, ..., p8) +* cause(delay, routine, packed_args) * moxcdone -- set to TRUE to quit * eventtime -- ideallized current time * @@ -151,7 +161,7 @@ void catchup() eventtime = (my_base->next_time) >> 8; call = remove_call(my_base); virttime = call->u.e.time; - (*(call->u.e.routine))(CALLARGS(call)); + (*(call->u.e.routine))(&(call->u.e.p)); call_free(call); } /* now that we've possibly pulled events out of the timebase, adjust @@ -174,6 +184,7 @@ void catchup() ****************************************************************************/ #ifndef DOTS_FOR_ARGS +THIS CODE IS OBSOLETE void cause(delay, routine, p) delay_type delay; int (*routine)(); @@ -181,16 +192,10 @@ void cause(delay, routine, p) #else #include -void cause(delay_type delay, ...) -/* note: the routine parameter is not checked because any routine type can - be passed as a parameter, but in the call struct it's an int (*)() - */ +void cause(delay_type delay, void (*routine)(call_args_type args), call_args_type p) #endif { register call_type call = call_alloc(); -#ifdef DOTS_FOR_ARGS - va_list xp; -#endif if (!call) { gprintf(ERROR, "cause: out of memory\n"); @@ -200,11 +205,10 @@ void cause(delay_type delay, ...) #ifdef DOTS_FOR_ARGS call->u.e.time = virttime + delay; call->u.e.priority = 128; /* default priority */ - va_start(xp, delay); - call->u.e.routine = (int (*)()) va_arg(xp, long *); - call->u.e.p = va_arg(xp, call_args_node); - va_end(xp); + call->u.e.routine = routine; + call->u.e.p = *p; #else + THIS CODE IS OBSOLETE call->u.e.time = virttime + delay; call->u.e.priority = 128; /* default priority */ call->u.e.routine = routine; @@ -214,17 +218,14 @@ void cause(delay_type delay, ...) if (call->u.e.routine == 0) { gprintf(ERROR,"cause called with NULL routine\n"); EXIT(1); -#ifndef DOS /* IBM allows odd addresses */ -#if (__APPLE__ != 1 || __i386__ != 1) /* Intel Mac allows odd addresses */ +/* Intel (x86 or x86_64) allows odd routine addresses; + * RISC architectures do not. + */ +#if (!defined(DOS) && __i386__ != 1 && __x86_64__ != 1) } else if (((long) call->u.e.routine) & 1) { gprintf(ERROR, "cause called with bad routine address: 0x%lx\n", call->u.e.routine); -#ifndef GCC_MODEL_CPU -#define GCC_MODEL_CPU "GCC_MODEL_CPU is undefined for this compilation" -#endif - gprintf(ERROR, GCC_MODEL_CPU); EXIT(1); -#endif #endif } #endif @@ -248,6 +249,7 @@ void cause(delay_type delay, ...) ****************************************************************************/ #ifndef DOTS_FOR_ARGS +THIS CODE IS OBSOLETE void causepri(delay, pri, routine, p) delay_type delay; int pri; @@ -256,13 +258,10 @@ void causepri(delay, pri, routine, p) #else /* already included stdarg.h */ -void causepri(delay_type delay, int pri, ...) +void causepri(delay_type delay, int pri, void (*routine)(call_args_type args), call_args_type args) #endif { register call_type call = call_alloc(); -#ifdef DOTS_FOR_ARGS - va_list xp; -#endif if (!call) { gprintf(ERROR, "cause: out of memory\n"); @@ -272,10 +271,8 @@ void causepri(delay_type delay, int pri, ...) #ifdef DOTS_FOR_ARGS call->u.e.time = virttime + delay; call->u.e.priority = pri; /* default priority */ - va_start(xp, pri); - call->u.e.routine = (int (*)()) va_arg(xp, long *); - call->u.e.p = va_arg(xp, call_args_node); - va_end(xp); + call->u.e.routine = routine; + call->u.e.p = *args; #else call->u.e.time = virttime + delay; call->u.e.priority = pri; /* default priority */ @@ -286,13 +283,14 @@ void causepri(delay_type delay, int pri, ...) if (call->u.e.routine == 0) { gprintf(ERROR,"cause called with NULL routine\n"); EXIT(1); -#ifndef DOS /* IBM allows odd addresses */ -#if (__APPLE__ != 1 || __i386__ != 1) /* Intel Mac allows odd addresses */ +/* Intel (x86 or x86_64) allows odd routine addresses; + * RISC architectures do not. + */ +#if (!defined(DOS) && __i386__ != 1 && __x86_64__ != 1) } else if (((long) call->u.e.routine) & 1) { gprintf(ERROR, "causepri called with bad routine address: 0x%lx\n", call->u.e.routine); EXIT(1); -#endif #endif } #endif @@ -332,7 +330,7 @@ private void callrun() insert_base(timebase); virttime = call->u.e.time; /* virtual time of the call */ if (moxcdebug) callshow(call); - (*(call->u.e.routine))(CALLARGS(call)); + (*(call->u.e.routine))(&(call->u.e.p)); call_free(call); } diff --git a/lib-src/libnyquist/nyquist/cmt/moxc.h b/lib-src/libnyquist/nyquist/cmt/moxc.h index 975ebb91e..db165c836 100644 --- a/lib-src/libnyquist/nyquist/cmt/moxc.h +++ b/lib-src/libnyquist/nyquist/cmt/moxc.h @@ -12,9 +12,10 @@ extern int moxcdone; void catchup(void); void callallcancel(void); #ifdef DOTS_FOR_ARGS -void cause(delay_type delay, ...); -void causepri(delay_type delay, int pri, ...); +void cause(delay_type delay, void (*fn)(call_args_type), call_args_type p); +void causepri(delay_type delay, int pri, void (*fn)(call_args_type), call_args_type p); #else +THIS CODE IS OBSOLETE void cause(); void causepri(); #endif diff --git a/lib-src/libnyquist/nyquist/cmt/seq.c b/lib-src/libnyquist/nyquist/cmt/seq.c index de54e4746..3de2e5b25 100644 --- a/lib-src/libnyquist/nyquist/cmt/seq.c +++ b/lib-src/libnyquist/nyquist/cmt/seq.c @@ -36,12 +36,11 @@ boolean external_midi_clock = FALSE; boolean suppress_midi_clock = FALSE; private void insert_event(seq_type, register event_type); -private void process_event(seq_type); +private void process_event(call_args_type args); private char *chunk_alloc(seq_type seq, int size); -private void clock_tick(seq_type seq, time_type fraction); -private void ramp_event(seq_type seq, event_type event, unsigned int value, - unsigned int to_value, int increment, time_type step, int n); +private void clock_tick(call_args_type args); +private void ramp_event(call_args_type args); /*private*/ void send_macro(register unsigned char *ptr, int voice, short parameter[], int parm_num, int value, int nline); @@ -104,15 +103,19 @@ chunk_type chunk_create(boolean first_flag) /* clock_tick -- advance the clock and send a tick */ /**/ -private void clock_tick(seq_type seq, time_type fraction) +private void clock_tick(call_args_type args) { + seq_type seq = (seq_type) args->arg[0]; + time_type fraction = (time_type) args->arg[1]; int delay; fraction += clock_ticksize; delay = fraction >> 16; fraction &= 0xFFFF; if (seq->runflag && clock_ticksize && seq->note_enable) { midi_clock(); - cause((delay_type)delay, clock_tick, seq, fraction); + args->arg[0] = seq; + args->arg[1] = (void *)(size_t)fraction; + cause((delay_type)delay, clock_tick, args); } else { clock_running = FALSE; midi_stop(); @@ -120,8 +123,9 @@ private void clock_tick(seq_type seq, time_type fraction) } } -private void cycle(seq_type seq) +private void cycle(call_args_type args) { + seq_type seq = (seq_type) args->arg[0]; seq_reset(seq); seq_play(seq); } @@ -555,9 +559,9 @@ event_type insert_seti(seq, stime, sline, voice, addr, value) void noop(seq_type seq) {} -private void process_event(seq) - seq_type seq; +private void process_event(call_args_type args) { + seq_type seq = (seq_type) args->arg[0]; register event_type event; if (!seq->runflag) return; while ((event = seq->current) && (event->ntime <= virttime)) { @@ -621,9 +625,12 @@ private void process_event(seq) clock_ticksize = event->u.clock.ticksize; if (!clock_running && !suppress_midi_clock && !external_midi_clock) { + call_args_node args; clock_running = TRUE; midi_start(); - clock_tick(seq, 0L); + args.arg[0] = seq; + args.arg[1] = (void *)(size_t)0; + clock_tick(&args); } break; case MACCTRL_VALUE: @@ -641,6 +648,7 @@ private void process_event(seq) case CTRLRAMP_VALUE: case DEFRAMP_VALUE: { int from, to; + call_args_node re_args; if (!enabled) break; step = event->u.ramp.step; @@ -658,8 +666,14 @@ private void process_event(seq) /* Note: Step is always non-zero */ n = event->u.ramp.dur / step; increment = (increment << 8) / n; - ramp_event(seq, event, from << 8, to << 8, - (int) increment, step, n); + re_args.arg[0] = seq; + re_args.arg[1] = event; + re_args.arg[2] = (void *)(size_t)(from << 8); + re_args.arg[3] = (void *)(size_t)(to << 8); + re_args.arg[4] = (void *)(size_t)increment; + re_args.arg[5] = (void *)(size_t)step; + re_args.arg[6] = (void *)(size_t)n; + ramp_event(&re_args); seq->noteoff_count++; break; } @@ -679,7 +693,7 @@ private void process_event(seq) seq->current = event->next; } if (seq->current) { - cause((delay_type)(event->ntime - virttime), process_event, seq); + cause((delay_type)(event->ntime - virttime), process_event, args); } else if (seq->noteoff_count == 0 && seq->note_enable) { /* if we're just advancing to a start point, note_enable will be * FALSE and this won't get called: @@ -693,23 +707,30 @@ private void process_event(seq) /* ramp_event -- generate a ramp */ /**/ -private void ramp_event(seq, event, value, to_value, increment, step, n) - seq_type seq; - register event_type event; - unsigned int value; - unsigned int to_value; - int increment; - time_type step; - int n; +private void ramp_event(call_args_type args) { + seq_type seq = (seq_type) args->arg[0]; + event_type event = (event_type) args->arg[1]; + /* these 2 casts are ok because value (the starting point of the ramp) + * and to_value (the ending point) are unsigned int's representing a + * fractional MIDI data value with an 8-bit fractional part. */ + unsigned int value = (unsigned int) ((size_t) args->arg[2]); + unsigned int to_value = (unsigned int) ((size_t) args->arg[3]); + /* increment is also a fixed-point fraction, so int is fine */ + int increment = (int) ((size_t) args->arg[4]); + time_type step = (time_type) args->arg[5];; + /* n is the number of steps remaining. int is big enough. */ + int n = (int) ((size_t) args->arg[6]); + if (seq->runflag) { int voice = vc_voice(event->nvoice); /* printf("ramp_event: value %d to_value %d increment %d step %d n %d time %d\n", value, to_value, increment, step, n, virttime); */ if (n == 0) value = to_value; - else { - causepri((delay_type)step, 5, ramp_event, seq, event, value + increment, - to_value, increment, step, n - 1); + else {/* update value */ + args->arg[2] = (void *)(size_t)(value + increment); + args->arg[6] = (void *)(size_t)(n - 1); /* update n */ + causepri((delay_type)step, 5, ramp_event, args); } if (event->value == CTRLRAMP_VALUE) { int ctrl = event->u.ramp.ctrl; @@ -723,7 +744,8 @@ private void ramp_event(seq, event, value, to_value, increment, step, n) event->u.ramp.u.def.parm_num, value >> 8, event->nline); } - if (n == 0) seq_end_event(seq); + /* really passing seq, but it's already in args: */ + if (n == 0) seq_end_event(args); } } @@ -829,12 +851,15 @@ void seq_at_end(seq, fn) void seq_cause_noteoff_meth(seq_type seq, time_type delay, int voice, int pitch) { if (seq->note_enable) { + call_args_node args; pitch += seq->transpose; while (pitch < 0) pitch += 12; while (pitch > 127) pitch -= 12; seq->noteoff_count++; - causepri((delay_type) delay, 10, seq->noteoff_fn, - seq, voice, pitch); + args.arg[0] = seq; + args.arg[1] = (void *)(size_t)voice; + args.arg[2] = (void *)(size_t)pitch; + causepri((delay_type) delay, 10, seq->noteoff_fn, &args); } } @@ -878,16 +903,16 @@ void seq_cycle(seq_type seq, boolean flag, time_type dur) /* * Assumes that noteoff_count was incremented when event started. */ -void seq_end_event(seq) - seq_type seq; +void seq_end_event(call_args_type args) { + seq_type seq = (seq_type) args->arg[0]; /*gprintf(TRANS, "nd");*/ seq->noteoff_count--; if (seq->current == NULL /* finished seq */ && seq->noteoff_count == 0 /* finished noteoff's */ && seq->runflag /* we've not been stopped */) { if (seq->cycleflag) { - cause((delay_type) (seq->cycledur - virttime), cycle, seq); + cause((delay_type) (seq->cycledur - virttime), cycle, args); } else if (seq->stopfunc) { (*(seq->stopfunc))(seq); } @@ -903,8 +928,7 @@ void seq_end_event(seq) * frees storage occupied by a seq ****************************************************************************/ -private void seq_free_meth(seq) - seq_type seq; +private void seq_free_meth(seq_type seq) { seq_free_chunks(seq); if (seq->timebase) timebase_free(seq->timebase); @@ -1015,11 +1039,16 @@ void seq_midi_touch_meth(seq_type seq, int voice, int value) /* seq_noteoff_meth -- turn a seq note off */ /**/ -void seq_noteoff_meth(seq_type seq, int voice, int pitch) +void seq_noteoff_meth(call_args_type args) { + /* seq_type seq = args->arg[0]; -- unused */ + /* these are 8 bit values stored in pointers; coerce + * in 2 steps to avoid compiler warnings */ + int voice = (int) ((size_t) args->arg[1]); + int pitch = (int) ((size_t) args->arg[2]); midi_note(voice, pitch, 0); /*gprintf(TRANS, "_e");*/ - seq_end_event(seq); + seq_end_event(args); } @@ -1116,8 +1145,12 @@ void seq_reset_meth(seq_type seq) seq->noteoff_count = 0L; seq->runflag = TRUE; seq->paused = TRUE; - if (seq->current) - cause((delay_type)(seq->current->ntime - virttime), process_event, seq); + if (seq->current) { + call_args_node args; + args.arg[0] = seq; + cause((delay_type)(seq->current->ntime - virttime), + process_event, &args); + } timebase_use(old_timebase); } diff --git a/lib-src/libnyquist/nyquist/cmt/seq.h b/lib-src/libnyquist/nyquist/cmt/seq.h index 4177d2c86..85548b2e3 100644 --- a/lib-src/libnyquist/nyquist/cmt/seq.h +++ b/lib-src/libnyquist/nyquist/cmt/seq.h @@ -173,7 +173,7 @@ typedef struct seq_struct { void (*midi_ctrl_fn)(struct seq_struct * seq, int voice, int ctrl, int value); void (*midi_program_fn)(struct seq_struct * seq, int voice, int prog); void (*midi_touch_fn)(struct seq_struct * seq, int voice, int value); - void (*noteoff_fn)(struct seq_struct * seq, int voice, int pitch); + void (*noteoff_fn)(call_args_type args); void (*noteon_fn)(struct seq_struct * seq, int chan, int pitch, int vel); void (*free_fn)(struct seq_struct * seq); void (*reset_fn)(struct seq_struct * seq); @@ -215,8 +215,8 @@ chunk_type chunk_create(boolean first_flag); (*(((seq_type) seq)->midi_program_fn))(seq, voice, prog) #define seq_midi_touch(seq, voice, value) \ (*(((seq_type) seq)->midi_touch_fn))(seq, voice, value) -#define seq_noteoff(seq, voice, pitch) \ - (*(((seq_type) seq)->noteoff_fn))(seq, voice, pitch) +#define seq_noteoff(seq, args) \ + (*(((seq_type) seq)->noteoff_fn))(args) #define seq_noteon(seq, voice, pitch, vel) \ (*(((seq_type) seq)->noteon_fn))(seq, voice, pitch, vel) #define seq_free(seq) (*(((seq_type) seq)->free_fn))(seq) @@ -262,7 +262,7 @@ seq_type seq_copy(seq_type from_seq); /* LISP: (SEQ-COPY SEQ) */ seq_type seq_create(void); /* LISP: (SEQ-CREATE) */ void seq_cycle(seq_type seq, boolean flag, time_type dur); #define seq_duration(seq) (((seq_type) seq)->chunklist->u.info.duration) -void seq_end_event(seq_type seq); +void seq_end_event(call_args_type args); #define seq_events(seq) (((seq_type) seq)->chunklist ? \ (((seq_type) seq)->chunklist->u.info.eventlist) : NULL) #define seq_dictionary(seq) (seq)->chunklist->u.info.dictionary @@ -278,7 +278,7 @@ void seq_midi_ctrl_meth(seq_type seq, int voice, int ctrl, int value); void seq_midi_program_meth(seq_type seq, int voice, int prog); void seq_midi_touch_meth(seq_type seq, int voice, int value); void seq_noteon_meth(seq_type seq, int voice, int pitch, int vel); -void seq_noteoff_meth(seq_type seq, int chan, int pitch); +void seq_noteoff_meth(call_args_type args); time_type seq_pause(seq_type seq, boolean flag); void seq_play(seq_type seq); #define seq_rate(seq) ((seq_type) seq)->rate diff --git a/lib-src/libnyquist/nyquist/cmt/seqmread.c b/lib-src/libnyquist/nyquist/cmt/seqmread.c index 52f0c5798..c9dcd49a3 100644 --- a/lib-src/libnyquist/nyquist/cmt/seqmread.c +++ b/lib-src/libnyquist/nyquist/cmt/seqmread.c @@ -54,43 +54,41 @@ long prev_ticksize; /* remember the previous ticksize */ int sysex_id = 0; -void smf_noteoff(); -void smf_error(); -void smf_header(); -void smf_trackstart(); -void smf_trackend(); -void smf_noteon(); -void smf_pressure(); -void smf_parameter(); -void smf_pitchbend(); -void smf_program(); -void smf_chanpressure(); -void smf_sysex(); -void smf_metamisc(); -void smf_metaseq(); -void smf_metaeot(); -void smf_timesig(); -void smf_smpte(); -void smf_tempo(); -void smf_keysig(); -void smf_metaspecial(); -void smf_metatext(); -void smf_arbitrary(); +void smf_noteoff(int, int, int); +void smf_error(char *); +void smf_header(int, int, int); +void smf_trackstart(void); +void smf_trackend(void); +void smf_noteon(int, int, int); +void smf_pressure(int, int, int); +void smf_parameter(int, int, int); +void smf_pitchbend(int, int, int); +void smf_program(int, int); +void smf_chanpressure(int, int); +void smf_sysex(int, char *); +void smf_metamisc(int, int, char *); +void smf_metaseq(int); +void smf_metaeot(void); +void smf_timesig(int, int, int, int); +void smf_smpte(int, int, int, int, int); +void smf_tempo(int); +void smf_keysig(int, int); +void smf_metaspecial(int, int, char *); +void smf_metatext(int, int, char *); +void smf_arbitrary(int, char *); private seq_type the_score; static FILE *F; -int filegetc() +int filegetc(void) { /* int temp = getc(F); printf(" %x ", temp);*/ return(int)(getc(F)); } -void seq_read_smf(seq, fp) - seq_type seq; - FILE *fp; +void seq_read_smf(seq_type seq, FILE *fp) { F = fp; initfuncs(); @@ -140,13 +138,13 @@ void seq_read_smf(seq, fp) */ unsigned long divisions = 24L; -time_type gio_time() +time_type gio_time(void) { return (tempomap_lookup(the_tempomap, Mf_currtime) + 125L) / 250L; } -void smf_header(format,ntrks,division) +void smf_header(int format, int ntrks, int division) { /* gprintf(TRANS, "Header format=%d ntrks=%d division=%d\n", format,ntrks,division); */ @@ -159,17 +157,17 @@ void smf_header(format,ntrks,division) } -void smf_trackstart() +void smf_trackstart(void) { /* gprintf(TRANS, "Track start\n"); */ } -void smf_trackend() +void smf_trackend(void) { /* gprintf(TRANS, "Track end\n"); */ } -void smf_noteon(chan,pitch,vol) +void smf_noteon(int chan, int pitch, int vol) { snding_type snding; if (vol == 0) { /* convert to a noteoff */ @@ -190,7 +188,7 @@ void smf_noteon(chan,pitch,vol) snding->channel = chan; } -void smf_noteoff(chan,pitch,vol) +void smf_noteoff(int chan, int pitch, int vol) { snding_type *snding_ptr; register snding_type snding; @@ -214,14 +212,14 @@ void smf_noteoff(chan,pitch,vol) } -void smf_pressure(chan,pitch,press) +void smf_pressure(int chan, int pitch, int press) { prtime(); gprintf(TRANS, "Pressure, chan=%d pitch=%d press=%d (IGNORED)\n", chan + 1, pitch, press); } -void smf_parameter(chan,control,value) +void smf_parameter(int chan, int control, int value) { int ctrl = 0; /* prtime(); @@ -245,7 +243,7 @@ void smf_parameter(chan,control,value) * NOTE: the midifile code from Tim Thompson has the msb and lsb bytes swapped. * Thus the parameter msb is really the low order byte and lsb is high order. */ -void smf_pitchbend(chan,msb,lsb) +void smf_pitchbend(int chan, int msb, int lsb) { /* prtime(); gprintf(TRANS, "Pitchbend, chan=%d msb=%d lsb=%d\n",chan+1,msb,lsb); */ @@ -253,14 +251,14 @@ void smf_pitchbend(chan,msb,lsb) ((lsb << 7) + msb) >> 6); } -void smf_program(chan,program) +void smf_program(int chan, int program) { /* prtime(); gprintf(TRANS, "Program, chan=%d program=%d\n",chan+1,program); */ insert_ctrl(the_score, gio_time(), 0, PROGRAM_CTRL, chan + 1, program); } -void smf_chanpressure(chan,press) +void smf_chanpressure(int chan, int press) { /* prtime(); gprintf(TRANS, "Channel pressure, chan=%d pressure=%d\n",chan+1,press); @@ -268,9 +266,7 @@ void smf_chanpressure(chan,press) insert_ctrl(the_score, gio_time(), 0, TOUCH_CTRL, chan + 1, press); } -void smf_sysex(leng,mess) -int leng; -char *mess; +void smf_sysex(int leng, char* mess) { char symb[10]; def_type defn; @@ -295,8 +291,7 @@ char *mess; gprintf(TRANS, "Sysex, leng=%d (IGNORED)\n",leng); */ } -void smf_metamisc(type,leng,mess) -char *mess; +void smf_metamisc(int type, int leng, char *mess) { prtime(); gprintf(TRANS, @@ -304,8 +299,7 @@ char *mess; type, leng); } -void smf_metaspecial(type,leng,mess) -char *mess; +void smf_metaspecial(int type, int leng, char *mess) { prtime(); gprintf(TRANS, @@ -313,8 +307,7 @@ char *mess; type, leng); } -void smf_metatext(type,leng,mess) -char *mess; +void smf_metatext(int type, int leng, char *mess) { static char *ttype[] = { NULL, @@ -333,22 +326,28 @@ char *mess; type = unrecognized; } -void smf_metaseq(num) +void smf_metaseq(int num) { prtime(); - gprintf(TRANS, "Meta event, sequence number = %d (IGNORED)\n",num); + gprintf(TRANS, "Meta event, sequence number = %d (IGNORED)\n", num); } -void smf_metaeot() +void smf_metaeot(void) { /* prtime(); gprintf(TRANS, "Meta event, end of track\n"); */ } -void smf_keysig(sf,mi) +void smf_keysig(int sf, int mi) { /* prtime(); - gprintf(TRANS, "Key signature, sharp/flats=%d minor=%d\n",sf,mi); */ + gprintf(TRANS, "Key signature, sharp/flats=%d minor=%d\n", sf, mi); */ +} + +void smf_sqspecific(int id, char *msg) +{ + prtime(); + gprintf(TRANS, "Sequencer-specific event ID = %d (IGNORED)\n", id); } /* smf_tempo -- handle a midifile tempo change */ @@ -359,8 +358,7 @@ void smf_keysig(sf,mi) * to get units of millisec and 24ths of quarter notes. insert_clock * expects this to have a 16 bit fractional part. */ -void smf_tempo(tempo) -long tempo; +void smf_tempo(int tempo) { time_type ctime = gio_time(); long ticksize = scale(tempo, 1024L, 375L); @@ -383,7 +381,7 @@ long tempo; } } -void smf_timesig(nn,dd,cc,bb) +void smf_timesig(int nn, int dd, int cc, int bb) { /* int denom = 1; while ( dd-- > 0 ) @@ -394,7 +392,7 @@ void smf_timesig(nn,dd,cc,bb) nn,denom,cc,bb); */ } -void smf_smpte(hr,mn,se,fr,ff) +void smf_smpte(int hr, int mn, int se, int fr, int ff) { prtime(); gprintf(TRANS, @@ -402,26 +400,24 @@ void smf_smpte(hr,mn,se,fr,ff) hr, mn, se, fr, ff); } -void smf_arbitrary(leng,mess) -char *mess; +void smf_arbitrary(int leng, char *mess) { prtime(); gprintf(TRANS, "Arbitrary bytes, leng=%d (IGNORED)\n",leng); } -void smf_error(msg) - char *msg; +void smf_error(char *msg) { gprintf(ERROR, msg); } -void prtime() +void prtime(void) { gprintf(TRANS, "Time=%ld/%ld ",Mf_currtime, gio_time()); } -void initfuncs() +void initfuncs(void) { Mf_error = smf_error; Mf_header = smf_header; @@ -442,7 +438,7 @@ void initfuncs() Mf_smpte = smf_smpte; Mf_tempo = smf_tempo; Mf_keysig = smf_keysig; - Mf_sqspecific = smf_metaspecial; + Mf_sqspecific = smf_sqspecific; Mf_text = smf_metatext; Mf_arbitrary = smf_arbitrary; } diff --git a/lib-src/libnyquist/nyquist/cmt/seqmwrite.c b/lib-src/libnyquist/nyquist/cmt/seqmwrite.c index 2288ab293..026859546 100644 --- a/lib-src/libnyquist/nyquist/cmt/seqmwrite.c +++ b/lib-src/libnyquist/nyquist/cmt/seqmwrite.c @@ -27,7 +27,7 @@ long chunk_size_marker; int seti_counter; extern time_type a_start_time; -long last_event; /*time from last_clock_event to the last event*/ +long last_event; /* time from last_clock_event to the last event */ time_type last_clock_event; time_type last_tick_size; /* millisec per tick shifted 16 bits */ @@ -44,17 +44,16 @@ extern boolean clock_running; /* TRUE if clock is running */ extern boolean use_midi_clock; private void smfw_bend(); -private void smfw_cause_noteoff(); +private void smfw_cause_noteoff(seq_type seq, time_type delay, int voice, + int pitch); private void smfw_ctrl(); private void smfw_deltatime(); private void smfw_dotrack(); private void smfw_exclusive(); -private void smfw_noteoff(); +private void smfw_noteoff(call_args_type args); private void smfw_noteon(); -private void smfw_process_event(); -private void smfw_ramp_event(seq_type seq, event_type event, - unsigned int value, unsigned int to_value, int increment, - time_type step, int n); +private void smfw_process_event(call_args_type args); +private void smfw_ramp_event(call_args_type args); private void smfw_send_macro(); private void smfw_touch(seq_type seq, int voice, int value); private void writevarlen(); @@ -64,7 +63,7 @@ private void writevarlen(); /**/ private void smfw_bend(seq_type seq, int voice, int value) { - if(debug) gprintf(TRANS, "smfw_bend %d\n", value); + if (debug) gprintf(TRANS, "smfw_bend %d\n", value); smfw_deltatime(); putc(MIDI_BEND | (voice - 1), smfw_seq.outfile); putc(0xFF & ((value & 0x1) << 6) , smfw_seq.outfile); @@ -81,33 +80,34 @@ private void smfw_bend(seq_type seq, int voice, int value) * so no real timing delays occur. The effect is to sort events by their * specified time. */ -private void smfw_cause_noteoff(seq, delay, voice, pitch) - seq_type seq; - time_type delay; - int voice; - int pitch; +private void smfw_cause_noteoff(seq_type seq, time_type delay, int voice, + int pitch) { - if(debug) gprintf(TRANS, "cause noteoff at %ld...", virttime + delay); + call_args_node args; + if (debug) gprintf(TRANS, "cause noteoff at %ld...", virttime + delay); pitch += seq->transpose; while (pitch <= 0) pitch += 12; while (pitch >= 127) pitch -= 12; seq->noteoff_count++; - causepri((delay_type) delay, 10, seq->noteoff_fn, - seq, voice, pitch); - + args.arg[0] = seq; + args.arg[1] = (void *)(size_t)voice; + args.arg[2] = (void *)(size_t)pitch; + causepri((delay_type) delay, 10, seq->noteoff_fn, &args); } -private void smfw_clock_event(old_ticksize, new_ticksize) - time_type old_ticksize, new_ticksize; +private void smfw_clock_event(call_args_type args) { + time_type old_ticksize = (time_type)(args->arg[0]); + time_type new_ticksize = (time_type)(args->arg[1]); time_type temp_ticksize = new_ticksize; new_ticksize = scale(new_ticksize, 375L, 1024L); /* (new_ticksize >> 16) * 24000 ms/clock becomes us/midiquarter */ - if(debug) gprintf(TRANS, "smfw_clock: write %ld (time:%ld) ->->->tempo %ld\n", + if (debug) gprintf(TRANS, + "smfw_clock: write %ld (time:%ld) ->->->tempo %ld\n", new_ticksize, virttime, 2500L / (new_ticksize / 24000)); - /*use old ticksize to write the delta for the clock event*/ + /* use old ticksize to write the delta for the clock event */ last_tick_size = old_ticksize; smfw_deltatime(); last_tick_size = temp_ticksize;/* reset to = new_tick_size */ @@ -120,8 +120,10 @@ private void smfw_clock_event(old_ticksize, new_ticksize) last_clock_event = virttime; last_event = 0L; - /*no time expired between last clockevent and last event(they are the same).*/ - /*next clock event will be exactly the next this_event from last_clock_event*/ + /* no time expired between last clockevent and last event + * (they are the same). Next clock event will be exactly the + * next this_event from last_clock_event + */ } @@ -129,7 +131,7 @@ private void smfw_clock_event(old_ticksize, new_ticksize) /**/ private void smfw_ctrl(seq_type seq, int voice, int ctrl_name, int value) { - if(debug) gprintf(TRANS, "smfw_ctrl %d: %d\n", ctrl_name, value); + if (debug) gprintf(TRANS, "smfw_ctrl %d: %d\n", ctrl_name, value); smfw_deltatime(); putc(MIDI_CTRL | (voice - 1), smfw_seq.outfile); putc(ctrl_name, smfw_seq.outfile); @@ -145,13 +147,16 @@ private void smfw_deltatime() time_type use_ticksize = (clock_ticksize != last_tick_size) ? last_tick_size : clock_ticksize; time_type this_event = virttime - last_clock_event; - if(debug) gprintf(TRANS, "delta! ticksize: %lu Lastev: %ld ThisevScaled: %lu Thisev: %lu ", - clock_ticksize, last_event, (this_event * ((2500L << 16) / use_ticksize)) / 100, - this_event); + if (debug) gprintf(TRANS, + "delta! ticksize: %lu Lastev: %ld ThisevScaled: %lu Thisev: %lu ", + clock_ticksize, last_event, + (this_event * ((2500L << 16) / use_ticksize)) / 100, + this_event); - this_event = ((virttime - last_clock_event) * ((2500L << 16) / use_ticksize)) / 100; + this_event = ((virttime - last_clock_event) * + ((2500L << 16) / use_ticksize)) / 100; - if(debug) gprintf(TRANS, "--- deltatime: %lu\n", this_event - last_event); + if (debug) gprintf(TRANS, "--- deltatime: %lu\n", this_event - last_event); writevarlen((long) (this_event - last_event)); last_event = this_event; @@ -159,8 +164,7 @@ private void smfw_deltatime() /* smfw_dotrack -- write the remainder of a track */ -private void smfw_dotrack(seq) - seq_type seq; +private void smfw_dotrack(seq_type seq) { long end_marker; timebase_type old_timebase = timebase; @@ -178,40 +182,45 @@ private void smfw_dotrack(seq) seq->paused = TRUE; last_clock_event = 0L; last_event = 0L; - if(debug) gprintf(TRANS, "dotrack (reset) %d %ld (%lu) \n", + if (debug) gprintf(TRANS, "dotrack (reset) %d %ld (%lu) \n", smfw_seq.track, last_event, virttime); - if (seq->current) - cause((delay_type)(seq->current->ntime - virttime), smfw_process_event, - seq); + if (seq->current) { + call_args_node args; + args.arg[0] = seq; + cause((delay_type)(seq->current->ntime - virttime), smfw_process_event, + &args); + } set_virttime(timebase, MAXTIME); catchup(); putc(0x00, smfw_seq.outfile); - putc(0xFF, smfw_seq.outfile);/*end of track chunk*/ + putc(0xFF, smfw_seq.outfile); /* end of track chunk */ putc(0x2F, smfw_seq.outfile); putc(0x00, smfw_seq.outfile); end_marker = ftell(smfw_seq.outfile); - fseek(smfw_seq.outfile, chunk_size_marker, 0);/*go back to enter chunksize*/ - chunk_size = (end_marker - chunk_size_marker) - 4;/* - 4 for 4 size bytes*/ - if(debug) gprintf(TRANS, "bytes written in previous track: %ld \n\n", chunk_size); + /* go back to enter chunksize: */ + fseek(smfw_seq.outfile, chunk_size_marker, 0); + /* - 4 for 4 size bytes: */ + chunk_size = (end_marker - chunk_size_marker) - 4; + if (debug) gprintf(TRANS, "bytes written in previous track: %ld \n\n", + chunk_size); putc((int) ((0xFF & (chunk_size >> 24))), smfw_seq.outfile); putc((int) ((0xFF & (chunk_size >> 16))), smfw_seq.outfile); putc((int) ((0xFF & (chunk_size >> 8))), smfw_seq.outfile); putc((int) ((0xFF & chunk_size)), smfw_seq.outfile); - fseek(smfw_seq.outfile, end_marker, 0);/*return file pointer to end of track*/ + /* return file pointer to end of track */ + fseek(smfw_seq.outfile, end_marker, 0); timebase_use(old_timebase); } /* smfw_exclusive -- write a system excl. msg to midi file */ -private void smfw_exclusive(length, msg) -int length; -unsigned char *msg; +private void smfw_exclusive(int length, unsigned char *msg) { int length_count = 0; - if(debug) gprintf(TRANS, "SYSEX (time:%ld)\n", virttime); + if (debug) gprintf(TRANS, "SYSEX (time:%ld)\n", virttime); smfw_deltatime(); @@ -219,14 +228,14 @@ unsigned char *msg; putc(*msg++, smfw_seq.outfile); length_count++; } - if(*(--msg) != MIDI_EOX) gprintf(TRANS, "ERROR: no end of sysex\n"); + if (*(--msg) != MIDI_EOX) gprintf(TRANS, "ERROR: no end of sysex\n"); } private void smfw_msg_write(n,c1,c2,c3) int n; unsigned char c1,c2,c3; { - if(debug) gprintf(TRANS, "MSGWRITE %d bytes (time:%ld)\n", n, virttime); + if (debug) gprintf(TRANS, "MSGWRITE %d bytes (time:%ld)\n", n, virttime); smfw_deltatime(); switch(n) { case 1: putc(c1, smfw_seq.outfile); @@ -244,9 +253,13 @@ private void smfw_msg_write(n,c1,c2,c3) /* smfw_noteoff -- write noteoff to midi file */ /**/ -private void smfw_noteoff(seq_type seq, int voice, int pitch) +private void smfw_noteoff(call_args_type args) { - if(debug) gprintf(TRANS, "smfw_noteoff %d: %d (time:%ld)\n", voice, pitch, virttime); + /* seq_type seq = args->arg[0]; -- unused */ + int voice = (int)(size_t)args->arg[1]; + int pitch = (int)(size_t)args->arg[2]; + if (debug) gprintf(TRANS, + "smfw_noteoff %d: %d (time:%ld)\n", voice, pitch, virttime); smfw_deltatime(); putc(NOTEOFF | (voice - 1), smfw_seq.outfile); putc(pitch, smfw_seq.outfile); @@ -259,11 +272,10 @@ private void smfw_noteoff(seq_type seq, int voice, int pitch) * NOTE: the seq parameter is not used here, but is passed in by the * seq_noteon macro, so we have to have a placeholder for it. */ -private void smfw_noteon(seq, voice, pitch, vel) - seq_type seq; - int voice, pitch, vel; +private void smfw_noteon(seq_type seq, int voice, int pitch, int vel) { - if(debug) gprintf(TRANS, "smfw_noteon %d: %d %d(time:%ld)\n", voice, pitch, vel, virttime); + if (debug) gprintf(TRANS, + "smfw_noteon %d: %d %d(time:%ld)\n", voice, pitch, vel, virttime); smfw_deltatime(); putc(NOTEON | (voice - 1), smfw_seq.outfile); putc(pitch, smfw_seq.outfile); @@ -273,183 +285,221 @@ private void smfw_noteon(seq, voice, pitch, vel) /* smfw_process_event -- write a seq event to a midi file */ /**/ -private void smfw_process_event(seq) - seq_type seq; +private void smfw_process_event(call_args_type args) { + seq_type seq = args->arg[0]; register event_type event; if (!seq->runflag) return; while ((event = seq->current) && (event->ntime <= virttime)) { - unsigned int voice; - if ((vc_voice(event->nvoice) == smfw_seq.track) || /*if on current track*/ - (((vc_voice(event->nvoice) - 16) == smfw_seq.track) - && (smfw_seq.track > 0)) || - /* acknowledge clock change on all tracks*/ - (event->value == CLOCK_VALUE && vc_ctrl(event->nvoice) == ESC_CTRL)) { + unsigned int voice; + if ((vc_voice(event->nvoice) == smfw_seq.track) || + /* if on current track */ + (((vc_voice(event->nvoice) - 16) == smfw_seq.track) + && (smfw_seq.track > 0)) || + /* acknowledge clock change on all tracks*/ + (event->value == CLOCK_VALUE && + vc_ctrl(event->nvoice) == ESC_CTRL)) { - /* process all current (and earlier) events */ - if (is_note(event)) { /*** play a note or rest ***/ - /* if this note is not a rest, play it and schedule an off event */ - if (event->value != NO_PITCH && - (seq_channel_mask(seq) & - (1 << ((voice = vc_voice(event->nvoice)) - 1)))) { - seq_noteon(seq, voice, (0xFF & event->value), - (int) (event->u.note.ndur & 0xFF)); + /* process all current (and earlier) events */ + if (is_note(event)) { /*** play a note or rest ***/ + /* if this note is not a rest, play it and schedule an + * off event */ + if (event->value != NO_PITCH && + (seq_channel_mask(seq) & + (1 << ((voice = vc_voice(event->nvoice)) - 1)))) { + seq_noteon(seq, voice, (0xFF & event->value), + (int) (event->u.note.ndur & 0xFF)); - seq_cause_noteoff(seq, (event->u.note.ndur) >> 8, - voice, (0xFF & event->value)); - } - } else { /*** send a control command ***/ - int n; - time_type step; - int delta; - int increment; - int voice = vc_voice(event->nvoice); - ulong enabled = seq_channel_mask(seq) & (1 << (voice - 1)); - - switch (vc_ctrl(event->nvoice)) { - case PSWITCH_CTRL: - if (!enabled) break; - if(debug) gprintf(TRANS, "porta %d (time:%ld)... ", event->value, virttime); - seq_midi_ctrl(seq, voice, PORTASWITCH, 0xFF & event->value); - break; - case MODWHEEL_CTRL: - if (!enabled) break; - if(debug) gprintf(TRANS, "modw %d (time:%ld)...", event->value, virttime); - seq_midi_ctrl(seq, voice, MODWHEEL, 0xFF & event->value); - break; - case TOUCH_CTRL: - if (!enabled) break; - if(debug) gprintf(TRANS, "touch %d (time:%ld)... ", event->value, virttime); - seq_midi_touch(seq, voice, 0xFF & event->value); - break; - case VOLUME_CTRL: - if (!enabled) break; - if(debug) gprintf(TRANS, "ftvol %d (time:%ld)...", event->value, virttime); - seq_midi_ctrl(seq, voice, VOLUME, 0xFF & event->value); - break; - case BEND_CTRL: - if (!enabled) break; - if(debug) gprintf(TRANS, "bend %d (time:%ld)... ", event->value, virttime); - seq_midi_bend(seq, voice, event->value); - break; - case PROGRAM_CTRL: - if (!enabled) break; - if(debug) gprintf(TRANS, "prog %d (time:%ld)\n", event->value, virttime); - smfw_deltatime(); - putc(MIDI_CH_PROGRAM | (voice - 1), smfw_seq.outfile); - putc(0xFF & event->value, smfw_seq.outfile); - break; - case ESC_CTRL: - switch (event->value) { - time_type this_event; - case CALL_VALUE: /*called routine will write to midifile in execution */ - sequence = seq; - (*(event->u.call.routine))(event->u.call.args); - break; - case CLOCK_VALUE: - clock_ticksize = event->u.clock.ticksize; - if(debug) gprintf(TRANS, "clockevent! ticksize: %lu (time:%ld)\n", - clock_ticksize, virttime); - - if (virttime > 0) { /* any clock before this is already recorded in the header */ - if (smfw_seq.track == 0) { /* record clock event on tempo track = 0 */ - /* cause clock write in half a newtick, because it was written .5 tick early*/ - cause((delay_type) (clock_ticksize >> 17), smfw_clock_event, - last_tick_size, clock_ticksize); - last_tick_size = clock_ticksize; /*set new ticksize*/ - } else { /*not on tempo track*/ - this_event = ((virttime - last_clock_event) * - ((2500L << 16) / last_tick_size)) / 100; - if(debug) gprintf(TRANS, "track != 0: Lastev: %ld Thisev: %ld NewLast: %ld\n", - last_event, this_event, this_event - last_event); - last_event = 0L - (this_event - last_event); - last_clock_event = virttime; - /*last_event is negative, so will be ADDED to next this_event*/ - - last_tick_size = clock_ticksize; - } - } else if (debug) gprintf(TRANS, "IGNORED\n");/* if virttime <= 0 */ - break; - case MACCTRL_VALUE: - if (!enabled) break; - if (debug) gprintf(TRANS, "MACCTRL %d: %d (time:%ld)\n", - event->u.macctrl.ctrl_number, event->u.macctrl.value, virttime); - smfw_deltatime(); - putc(MIDI_CTRL | (voice - 1), smfw_seq.outfile); - putc(0xFF & event->u.macctrl.ctrl_number, smfw_seq.outfile); - putc(0xFF & event->u.macctrl.value, smfw_seq.outfile); - break; - case MACRO_VALUE: - if (!enabled) break; - if (debug) gprintf(TRANS, "MACRO sent to...\n"); - smfw_send_macro(event->u.macro.definition, - voice, event->u.macro.parameter, -1, 0); - break; - case CTRLRAMP_VALUE: - case DEFRAMP_VALUE: { - int from, to; - if (!enabled) break; - step = event->u.ramp.step; - if (event->value == CTRLRAMP_VALUE) { - if(debug) gprintf(TRANS, "CTRLRAMP (time:%ld)...", virttime); - from = event->u.ramp.u.ctrl.from_value; - to = event->u.ramp.u.ctrl.to_value; - } else { - if (debug) gprintf(TRANS, "DEFRAMP (time:%ld)...", virttime); - from = event->u.ramp.u.def.parameter[ - event->u.ramp.u.def.parm_num]; - to = event->u.ramp.u.def.to_value; + seq_cause_noteoff(seq, (event->u.note.ndur) >> 8, + voice, (0xFF & event->value)); + } + } else { /*** send a control command ***/ + int n; + time_type step; + int delta; + int increment; + int voice = vc_voice(event->nvoice); + ulong enabled = seq_channel_mask(seq) & (1 << (voice - 1)); + + switch (vc_ctrl(event->nvoice)) { + case PSWITCH_CTRL: + if (!enabled) break; + if (debug) gprintf(TRANS, + "porta %d (time:%ld)... ", event->value, virttime); + seq_midi_ctrl(seq, voice, PORTASWITCH, 0xFF & event->value); + break; + case MODWHEEL_CTRL: + if (!enabled) break; + if (debug) gprintf(TRANS, + "modw %d (time:%ld)...", event->value, virttime); + seq_midi_ctrl(seq, voice, MODWHEEL, 0xFF & event->value); + break; + case TOUCH_CTRL: + if (!enabled) break; + if (debug) gprintf(TRANS, + "touch %d (time:%ld)... ", event->value, virttime); + seq_midi_touch(seq, voice, 0xFF & event->value); + break; + case VOLUME_CTRL: + if (!enabled) break; + if (debug) gprintf(TRANS, + "ftvol %d (time:%ld)...", event->value, virttime); + seq_midi_ctrl(seq, voice, VOLUME, 0xFF & event->value); + break; + case BEND_CTRL: + if (!enabled) break; + if (debug) gprintf(TRANS, + "bend %d (time:%ld)... ", event->value, virttime); + seq_midi_bend(seq, voice, event->value); + break; + case PROGRAM_CTRL: + if (!enabled) break; + if (debug) gprintf(TRANS, + "prog %d (time:%ld)\n", event->value, virttime); + smfw_deltatime(); + putc(MIDI_CH_PROGRAM | (voice - 1), smfw_seq.outfile); + putc(0xFF & event->value, smfw_seq.outfile); + break; + case ESC_CTRL: + switch (event->value) { + time_type this_event; + /* called routine will write to midifile in execution: */ + case CALL_VALUE: + sequence = seq; + (*(event->u.call.routine))(event->u.call.args); + break; + case CLOCK_VALUE: + clock_ticksize = event->u.clock.ticksize; + if (debug) gprintf(TRANS, + "clockevent! ticksize: %lu (time:%ld)\n", + clock_ticksize, virttime); + + if (virttime > 0) { /* any clock before this is + * already recorded in the header */ + if (smfw_seq.track == 0) { + /* record clock event on tempo track = 0 */ + /* cause clock write in half a newtick, + * because it was written .5 tick early */ + call_args_node args; + args.arg[0] = (void *)(size_t)last_tick_size; + args.arg[1] = (void *)(size_t)clock_ticksize; + cause((delay_type) (clock_ticksize >> 17), + smfw_clock_event, &args); + /* set new ticksize: */ + last_tick_size = clock_ticksize; + } else { /*not on tempo track*/ + this_event = ((virttime - last_clock_event) * + ((2500L << 16) / last_tick_size)) / 100; + if (debug) gprintf(TRANS, + "track != 0: Lastev: %ld Thisev: %ld NewLast: %ld\n", + last_event, this_event, + this_event - last_event); + last_event = 0L - (this_event - last_event); + last_clock_event = virttime; + /* last_event is negative, so will be ADDED + * to next this_event */ + last_tick_size = clock_ticksize; + } + } else /* if virttime <= 0 */ + if (debug) gprintf(TRANS, "IGNORED\n"); + break; + case MACCTRL_VALUE: + if (!enabled) break; + if (debug) gprintf(TRANS, + "MACCTRL %d: %d (time:%ld)\n", + event->u.macctrl.ctrl_number, + event->u.macctrl.value, virttime); + smfw_deltatime(); + putc(MIDI_CTRL | (voice - 1), smfw_seq.outfile); + putc(0xFF & event->u.macctrl.ctrl_number, + smfw_seq.outfile); + putc(0xFF & event->u.macctrl.value, smfw_seq.outfile); + break; + case MACRO_VALUE: + if (!enabled) break; + if (debug) gprintf(TRANS, "MACRO sent to...\n"); + smfw_send_macro(event->u.macro.definition, + voice, event->u.macro.parameter, -1, 0); + break; + case CTRLRAMP_VALUE: + case DEFRAMP_VALUE: { + int from, to; + call_args_node re_args; + if (!enabled) break; + step = event->u.ramp.step; + if (event->value == CTRLRAMP_VALUE) { + if (debug) gprintf(TRANS, + "CTRLRAMP (time:%ld)...", virttime); + from = event->u.ramp.u.ctrl.from_value; + to = event->u.ramp.u.ctrl.to_value; + } else { + if (debug) gprintf(TRANS, + "DEFRAMP (time:%ld)...", virttime); + from = event->u.ramp.u.def.parameter[ + event->u.ramp.u.def.parm_num]; + to = event->u.ramp.u.def.to_value; + } + delta = to - from; + increment = delta; + if (delta < 0) delta = -delta; + /* RBD - Note: Step is always non-zero */ + n = event->u.ramp.dur / step; + increment = (increment << 8) / n; + re_args.arg[0] = seq; + re_args.arg[1] = event; + re_args.arg[2] = (void *)(size_t)(from << 8); + re_args.arg[3] = (void *)(size_t)(to << 8); + re_args.arg[4] = (void *)(size_t)increment; + re_args.arg[5] = (void *)(size_t)step; + re_args.arg[6] = (void *)(size_t)n; + smfw_ramp_event(&re_args); + seq->noteoff_count++; + break; + } + case SETI_VALUE: + /* will be printed after writing is completed: */ + seti_counter++; + *(event->u.seti.int_to_set) = event->u.seti.value; + break; + default: + gprintf(TRANS, "unexpected ESC_CTRL value\n"); + break; + } + break; + default: + gprintf(TRANS, "unexpected seq data\n"); + break; } - delta = to - from; - increment = delta; - if (delta < 0) delta = -delta; - /* RBD - Note: Step is always non-zero */ - n = event->u.ramp.dur / step; - increment = (increment << 8) / n; - smfw_ramp_event(seq, event, from << 8, to << 8, - increment, step, n); - seq->noteoff_count++; - break; - } - case SETI_VALUE: - seti_counter++; /*will be printed after writing is completed*/ - *(event->u.seti.int_to_set) = event->u.seti.value; - break; - default: - gprintf(TRANS, "unexpected ESC_CTRL value\n"); - break; } - break; - default: - gprintf(TRANS, "unexpected seq data\n"); - break; - } } + seq->current = event->next; } - seq->current = event->next; - } - if (seq->current) { /* if there is an event: delay, and then process again */ - cause((delay_type)(event->ntime - virttime), smfw_process_event, seq); + if (seq->current) { /* if there is an event: delay, then process again */ + cause((delay_type)(event->ntime - virttime), smfw_process_event, args); } } -/* smfw_ramp_event -- generate a ramp to write*/ -private void smfw_ramp_event(seq, event, value, to_value, increment, step, n) - seq_type seq; - register event_type event; - unsigned int value; - unsigned int to_value; - int increment; - time_type step; - int n; +/* smfw_ramp_event -- generate a ramp to write */ +private void smfw_ramp_event(call_args_type args) { - if(debug) gprintf(TRANS, "ramp of %d: %d to %d\n", event->u.ramp.ctrl, value >> 8, - to_value >> 8); + seq_type seq = (seq_type) args->arg[0]; + event_type event = (event_type) args->arg[1]; + unsigned int value = (unsigned int)(size_t)args->arg[2]; + unsigned int to_value = (unsigned int)(size_t)args->arg[3]; + int increment = (int)(size_t)args->arg[4]; + time_type step = (time_type)(size_t)args->arg[5]; + int n = (int)(size_t)args->arg[6]; + + if (debug) gprintf(TRANS, "ramp of %d: %d to %d\n", event->u.ramp.ctrl, + value >> 8, to_value >> 8); if (seq->runflag) { int voice = vc_voice(event->nvoice); if (n == 0) value = to_value; - else cause((delay_type)step, smfw_ramp_event, seq, event, value + increment, - to_value, increment, step, n - 1); + else { + args->arg[2] = (void *)(size_t)(value + increment); /* update value */ + args->arg[6] = (void *)(size_t)(n - 1); /* update n */ + cause((delay_type)step, smfw_ramp_event, args); + } if (event->value == CTRLRAMP_VALUE) { int ctrl = event->u.ramp.ctrl; if (ctrl == -TOUCH_CTRL) smfw_touch(seq, voice, value >> 8); @@ -461,7 +511,8 @@ private void smfw_ramp_event(seq, event, value, to_value, increment, step, n) event->u.ramp.u.def.parameter, event->u.ramp.u.def.parm_num, value >> 8); } - if (n == 0) seq_end_event(seq); + /* really passing seq, but it's already in args: */ + if (n == 0) seq_end_event(args); } } @@ -502,7 +553,7 @@ private void smfw_send_macro(ptr, voice, parameter, parm_num, value) /**/ private void smfw_touch(seq_type seq, int voice, int value) { - if(debug) gprintf(TRANS, "smfw_touch %d\n", value); + if (debug) gprintf(TRANS, "smfw_touch %d\n", value); smfw_deltatime(); putc(MIDI_TOUCH | (voice - 1), smfw_seq.outfile); putc(value, smfw_seq.outfile); @@ -541,12 +592,13 @@ void seq_write_smf(seq, outfile) /* search for clock events up till start of score */ /* careful: there may be no events at all */ while(event && event->ntime <= 0){ - if(debug) gprintf(TRANS, "event (time:%ld)\n", event->ntime); - if(vc_ctrl(event->nvoice) == ESC_CTRL && event->value == CLOCK_VALUE) { - if(debug) gprintf(TRANS, "clock %lu at 0\n", event->u.clock.ticksize); + if (debug) gprintf(TRANS, "event (time:%ld)\n", event->ntime); + if (vc_ctrl(event->nvoice) == ESC_CTRL && event->value == CLOCK_VALUE) { + if (debug) gprintf(TRANS, + "clock %lu at 0\n", event->u.clock.ticksize); starting_ticksize = event->u.clock.ticksize; break; - } + } event = event->next; } @@ -562,10 +614,10 @@ void seq_write_smf(seq, outfile) putc(0x01, smfw_seq.outfile); /*format 1 */ putc(0x00, smfw_seq.outfile); - track_count_marker = ftell(smfw_seq.outfile); /*number of tracks will be written later*/ - putc(0x00, smfw_seq.outfile); /*will be filled by track_count_marker*/ - - putc(0x02, smfw_seq.outfile);/*division resolution of 600*/ + /* number of tracks will be written later: */ + track_count_marker = ftell(smfw_seq.outfile); + putc(0x00, smfw_seq.outfile); /* will be filled by track_count_marker */ + putc(0x02, smfw_seq.outfile); /* division resolution of 600 */ putc(0x58, smfw_seq.outfile); for (i = 0; i < 17; i++) { /* for each track... */ @@ -635,7 +687,7 @@ private void writevarlen(value) { register ulong buffer; - if(debug) gprintf(TRANS, "variable length quantity..."); + if (debug) gprintf(TRANS, "variable length quantity..."); buffer = value & 0x7f; @@ -646,10 +698,10 @@ private void writevarlen(value) } for(;;) { - if(debug) gprintf(TRANS, " byte "); + if (debug) gprintf(TRANS, " byte "); putc((int) (buffer & 0xFF), smfw_seq.outfile); if (buffer & 0x80) buffer >>= 8; else break; } - if(debug) gprintf(TRANS, "written!\n"); + if (debug) gprintf(TRANS, "written!\n"); } diff --git a/lib-src/libnyquist/nyquist/cmt/seqmwrite.h b/lib-src/libnyquist/nyquist/cmt/seqmwrite.h index 458336f45..2903c54a2 100644 --- a/lib-src/libnyquist/nyquist/cmt/seqmwrite.h +++ b/lib-src/libnyquist/nyquist/cmt/seqmwrite.h @@ -1,4 +1,3 @@ /* seqmwrite.h -- midi file writer */ -void seq_write_smf(seq_type seq, FILE *outfile); /* LISP: (SEQ-WRITE-SMF SEQ FILE) */ - +void seq_write_smf(seq_type seq, FILE *outfile); diff --git a/lib-src/libnyquist/nyquist/cmt/seqread.c b/lib-src/libnyquist/nyquist/cmt/seqread.c index ab785f392..62d759d97 100644 --- a/lib-src/libnyquist/nyquist/cmt/seqread.c +++ b/lib-src/libnyquist/nyquist/cmt/seqread.c @@ -471,7 +471,7 @@ private void docall() if (fieldx == 1) fferror("Routine name expected"); else if (token[fieldx] != '(') fferror("Open paren expected"); else { - desc = &HASHENTRY(hash_lookup(symbol)); + desc = &HASHENTRY(lookup(symbol)); if (!desc->symb_type) { fieldx = 0; fferror("Function not defined"); @@ -1038,7 +1038,7 @@ private void doset(vec_flag) linex += scan(); if (!token[0]) fferror("Variable name expected"); else { - struct symb_descr *desc = &HASHENTRY(hash_lookup(token)); + struct symb_descr *desc = &HASHENTRY(lookup(token)); if (!desc->symb_type) fferror("Called function not defined"); else if (vec_flag && (desc->symb_type != vec_symb_type)) { fferror("This is not an array"); diff --git a/lib-src/libnyquist/nyquist/cmt/timebase.c b/lib-src/libnyquist/nyquist/cmt/timebase.c index 0bb1713f5..65e04a737 100644 --- a/lib-src/libnyquist/nyquist/cmt/timebase.c +++ b/lib-src/libnyquist/nyquist/cmt/timebase.c @@ -129,7 +129,7 @@ void callshow(call) gprintf(TRANS,"routine: %lx\n", (ulong)call->u.e.routine); gprintf(TRANS,"parameters:"); for (i = 0; i < MAX_CALL_ARGS; i++) { - gprintf(TRANS, " %d", call->u.e.p.arg[i]); + gprintf(TRANS, " %p", call->u.e.p.arg[i]); } gprintf(TRANS, "\n"); } diff --git a/lib-src/libnyquist/nyquist/cmt/timebase.h b/lib-src/libnyquist/nyquist/cmt/timebase.h index 9da4e902c..c154171cd 100644 --- a/lib-src/libnyquist/nyquist/cmt/timebase.h +++ b/lib-src/libnyquist/nyquist/cmt/timebase.h @@ -6,41 +6,23 @@ * call structure ****************************************************************************/ -/* ---NOTE!!! if you change MAX_CALL_ARGS, change CALLARGS macro below--- */ #define MAX_CALL_ARGS 8 typedef struct call_args_struct { - long arg[MAX_CALL_ARGS]; -} call_args_node; + void *arg[MAX_CALL_ARGS]; +} call_args_node, *call_args_type; typedef struct call { union { struct { time_type time; /* virtual time of this call */ int priority; /* an 8-bit the priority, low priority first */ - int (*routine)(); /* who to call */ + void (*routine)(); /* who to call */ call_args_node p; /* what to pass */ } e; struct call *p; /* used to link free calls */ } u; } *call_type, call_node; -/* CALLARGS - given a call_type, this macro generates an argument list */ -/* - * NOTE: originally, I thought call->u.e.p (a structure), would do it, but - * Lattice C for the Amiga has a compiler bug, and even in places where the - * bug doesn't show up, the code generated for the structure passing is - * a sequence of two loops: one to copy data to a local area on the stack, - * and one to push this data (a byte at a time!) to the top of the stack. - * With Lattice (and perhaps others, I haven't checked), it's better to - * push the data in-line. - */ -#ifdef LATTICE -#define CARG(n) call->u.e.p.arg[n] -#define CALLARGS(call) CARG(0), CARG(1), CARG(2), CARG(3), \ - CARG(4), CARG(5), CARG(6), CARG(7) -#else -#define CALLARGS(call) call->u.e.p -#endif /*************************************************************************** * timebase structure diff --git a/lib-src/libnyquist/nyquist/cmt/userio.c b/lib-src/libnyquist/nyquist/cmt/userio.c index f442376c5..35cc43b6a 100644 --- a/lib-src/libnyquist/nyquist/cmt/userio.c +++ b/lib-src/libnyquist/nyquist/cmt/userio.c @@ -1131,7 +1131,7 @@ char *c; if ((*c) == '\r') (*c) = '\n'; return(ret); -#else /* UNIX_MACH */ +#else /* __APPLE__ */ #ifndef BUFFERED_SYNCHRONOUS_INPUT int input = IOgetchar(); if (input != IOnochar) { @@ -1141,7 +1141,7 @@ char *c; } #endif /* BUFFERED_SYNCHRONOUS_INPUT */ return FALSE; -#endif /* UNIX_MACH */ +#endif /* __APPLE__ */ } #endif @@ -1246,7 +1246,7 @@ public int wait_ascii() gflush(); getrlimit(RLIMIT_NOFILE, &file_limit); select(file_limit.rlim_max+1, &readfds, 0, 0, NULL); -#endif /* !UNIX_MACH */ +#endif /* !__APPLE__ */ #endif /* ifdef UNIX */ } return (int) c; diff --git a/lib-src/libnyquist/nyquist/ffts/src/fftlib.c b/lib-src/libnyquist/nyquist/ffts/src/fftlib.c index b310d00f1..95f2ce67d 100644 --- a/lib-src/libnyquist/nyquist/ffts/src/fftlib.c +++ b/lib-src/libnyquist/nyquist/ffts/src/fftlib.c @@ -11,10 +11,10 @@ lower level fft stuff including routines called in fftext.c and fft2d.c #endif // some math constants to 40 decimal places -#define MYPI 3.141592653589793238462643383279502884197 // pi -#define MYROOT2 1.414213562373095048801688724209698078569 // sqrt(2) -#define MYCOSPID8 0.9238795325112867561281831893967882868224 // cos(pi/8) -#define MYSINPID8 0.3826834323650897717284599840303988667613 // sin(pi/8) +#define MYPI 3.141592653589793238462643383279502884197F // pi +#define MYROOT2 1.414213562373095048801688724209698078569F // sqrt(2) +#define MYCOSPID8 0.9238795325112867561281831893967882868224F // cos(pi/8) +#define MYSINPID8 0.3826834323650897717284599840303988667613F // sin(pi/8) /************************************************* @@ -32,7 +32,7 @@ unsigned long fftN = POW2(M); unsigned long i1; Utbl[0] = 1.0; for (i1 = 1; i1 < fftN/4; i1++) - Utbl[i1] = cos( (2.0 * MYPI * i1) / fftN ); + Utbl[i1] = (float) cos( (2.0 * MYPI * i1) / fftN ); Utbl[fftN/4] = 0.0; } @@ -55,7 +55,7 @@ for (i1 = 0; i1 < Nroot_1; i1++){ for (bit=1; bit <= Mroot_1; bitmask<<=1, bit++) if (i1 & bitmask) bitsum = bitsum + (Nroot_1 >> bit); - BRLow[i1] = bitsum; + BRLow[i1] = (short) bitsum; }; } @@ -289,7 +289,7 @@ ioptr[7] = f3i; //inline void fft8pt(float *ioptr); static inline void fft8pt(float *ioptr){ /*** RADIX 8 fft ***/ -float w0r = 1.0/MYROOT2; /* cos(pi/4) */ +float w0r = 1.0F/MYROOT2; /* cos(pi/4) */ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i; float f4r, f4i, f5r, f5i, f6r, f6i, f7r, f7i; float t0r, t0i, t1r, t1i; @@ -731,9 +731,9 @@ unsigned long posi; unsigned long pinc; unsigned long pnext; unsigned long NSameU; -unsigned long Uinc; -unsigned long Uinc2; -unsigned long Uinc4; +long Uinc; +long Uinc2; +long Uinc4; unsigned long DiffUCnt; unsigned long SameUCnt; unsigned long U2toU3; @@ -1795,9 +1795,9 @@ unsigned long posi; unsigned long pinc; unsigned long pnext; unsigned long NSameU; -unsigned long Uinc; -unsigned long Uinc2; -unsigned long Uinc4; +long Uinc; +long Uinc2; +long Uinc4; unsigned long DiffUCnt; unsigned long SameUCnt; unsigned long U2toU3; @@ -2138,7 +2138,7 @@ void iffts1(float *ioptr, long M, long Rows, float *Utbl, short *BRLow){ long StageCnt; long NDiffU; -const float scale = 1.0/POW2(M); +const float scale = 1.0F/POW2(M); switch (M){ case 0: @@ -2252,7 +2252,7 @@ static inline void rfft4pt(float *ioptr){ /*** RADIX 8 rfft ***/ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i; float t0r, t0i, t1r, t1i; -float w0r = 1.0/MYROOT2; /* cos(pi/4) */ +float w0r = 1.0F/MYROOT2; /* cos(pi/4) */ const float Two = 2.0; const float scale = 0.5; @@ -2323,7 +2323,7 @@ ioptr[7] = scale*f3i; //inline void rfft8pt(float *ioptr); static inline void rfft8pt(float *ioptr){ /*** RADIX 16 rfft ***/ -float w0r = 1.0/MYROOT2; /* cos(pi/4) */ +float w0r = 1.0F/MYROOT2; /* cos(pi/4) */ float w1r = MYCOSPID8; /* cos(pi/8) */ float w1i = MYSINPID8; /* sin(pi/8) */ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i; @@ -2747,7 +2747,7 @@ static inline void rifft4pt(float *ioptr, float scale){ /*** RADIX 8 rifft ***/ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i; float t0r, t0i, t1r, t1i; -float w0r = 1.0/MYROOT2; /* cos(pi/4) */ +float w0r = 1.0F/MYROOT2; /* cos(pi/4) */ const float Two = 2.0; /* bit reversed load */ @@ -2816,7 +2816,7 @@ ioptr[7] = scale*f3i; //inline void rifft8pt(float *ioptr, float scale); static inline void rifft8pt(float *ioptr, float scale){ /*** RADIX 16 rifft ***/ -float w0r = 1.0/MYROOT2; /* cos(pi/4) */ +float w0r = 1.0F/MYROOT2; /* cos(pi/4) */ float w1r = MYCOSPID8; /* cos(pi/8) */ float w1i = MYSINPID8; /* sin(pi/8) */ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i; @@ -3113,7 +3113,7 @@ float scale; long StageCnt; long NDiffU; -scale = 1.0/POW2(M); +scale = 1.0F/POW2(M); M=M-1; switch (M){ case -1: diff --git a/lib-src/libnyquist/nyquist/nyqsrc/add.c b/lib-src/libnyquist/nyquist/nyqsrc/add.c index ec5b31333..a443c242a 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/add.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/add.c @@ -343,7 +343,7 @@ D nyquist_printf("add_s1_nn_fetch: to_stop %d togo %d\n", to_stop, togo); /* consider other signal? don't run past its start time... */ if (susp->s2) { - s2_start = ROUND((susp->s2->t0 - susp->susp.t0) * + s2_start = ROUND32((susp->s2->t0 - susp->susp.t0) * susp->s2->sr); if (s2_start < susp->susp.current + togo) togo = MIN(togo, s2_start - susp->susp.current); @@ -515,7 +515,7 @@ D nyquist_printf("add_s2_nn_fetch(susp %p, snd_list %p)\n", /* if (susp->s2_ptr == zero_block->samples) { -sep21 RBD*/ if (susp->terminate_bits & 2) { if (susp->s1) { - s1_start = ROUND((susp->s1->t0 - susp->susp.t0) * + s1_start = ROUND32((susp->s1->t0 - susp->susp.t0) * susp->s1->sr); if (0) nyquist_printf("add_s_nn_fetch: s1_start %d\n", s1_start); } @@ -586,7 +586,7 @@ D nyquist_printf("add_s2_nn_fetch: to_stop %d togo %d\n", to_stop, togo); /* consider other signal? don't run past its start time... */ if (susp->s1) { - s1_start = ROUND((susp->s1->t0 - susp->susp.t0) * + s1_start = ROUND32((susp->s1->t0 - susp->susp.t0) * susp->s1->sr); if (s1_start < susp->susp.current + togo) togo = MIN(togo, s1_start - susp->susp.current); @@ -752,12 +752,12 @@ void add_zero_fill_nn_fetch(snd_susp_type a_susp, snd_list_type snd_list) (int)susp->susp.current); /* don't run past start time ... */ if (susp->s1) { - s_start = ROUND((susp->s1->t0 - susp->susp.t0) * susp->s1->sr); + s_start = ROUND32((susp->s1->t0 - susp->susp.t0) * susp->s1->sr); if (s_start < susp->susp.current + togo) { togo = s_start - susp->susp.current; } } else if (susp->s2) { - s_start = ROUND((susp->s2->t0 - susp->susp.t0) * susp->s2->sr); + s_start = ROUND32((susp->s2->t0 - susp->susp.t0) * susp->s2->sr); if (s_start < susp->susp.current + togo) { togo = s_start - susp->susp.current; } diff --git a/lib-src/libnyquist/nyquist/nyqsrc/avg.c b/lib-src/libnyquist/nyquist/nyqsrc/avg.c index a6b308ce3..321bd3048 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/avg.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/avg.c @@ -180,7 +180,7 @@ void avg_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ if (final_count == susp->susp.toss_cnt) { - n = ROUND((final_time - susp->s->t0) * susp->s->sr - + n = ROUNDBIG((final_time - susp->s->t0) * susp->s->sr - (susp->s->current - susp->s_cnt)); susp->s_ptr += n; susp_took(s_cnt, n); @@ -233,7 +233,7 @@ sound_type snd_make_avg(sound_type s, long blocksize, long stepsize, long op) this could be very big and cause integer overflow, so here, we prevent the overflow by limiting stepsize */ if (stepsize > (0x7FFFFFFF / max_sample_block_len)) { - xlerror("In SND-AVG, stepsize is too big", s_unbound); + xlfail("In SND-AVG, stepsize is too big"); } falloc_generic(susp, avg_susp_node, "snd_make_avg"); @@ -244,7 +244,7 @@ sound_type snd_make_avg(sound_type s, long blocksize, long stepsize, long op) /* minimum start time over all inputs: */ t0_min = MIN(s->t0, t0); /* how many samples to toss before t0: */ - susp->susp.toss_cnt = ROUND((t0 - t0_min) * sr); + susp->susp.toss_cnt = ROUNDBIG((t0 - t0_min) * sr); if (susp->susp.toss_cnt > 0) { susp->susp.keep_fetch = susp->susp.fetch; susp->susp.fetch = avg_toss_fetch; @@ -274,7 +274,7 @@ sound_type snd_make_avg(sound_type s, long blocksize, long stepsize, long op) if (!susp->buffer) { sound_unref(susp->s); ffree_generic(susp, sizeof(avg_susp_node), "avg_free"); - xlerror("memory allocation failed in SND-AVG", s_unbound); + xlfail("memory allocation failed in SND-AVG"); } susp->fillptr = susp->buffer; susp->endptr = susp->buffer + buffersize; diff --git a/lib-src/libnyquist/nyquist/nyqsrc/compose.c b/lib-src/libnyquist/nyquist/nyqsrc/compose.c index 564116bf5..0dd7641dd 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/compose.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/compose.c @@ -193,11 +193,11 @@ void compose_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ if (final_count == susp->susp.toss_cnt) { - n = ROUND((final_time - susp->f->t0) * susp->f->sr - + n = ROUNDBIG((final_time - susp->f->t0) * susp->f->sr - (susp->f->current - susp->f_cnt)); susp->f_ptr += n; susp_took(f_cnt, n); - n = ROUND((final_time - susp->g->t0) * susp->g->sr - + n = ROUNDBIG((final_time - susp->g->t0) * susp->g->sr - (susp->g->current - susp->g_cnt)); susp->g_ptr += n; susp_took(g_cnt, n); @@ -269,7 +269,7 @@ sound_type snd_make_compose(sound_type f, sound_type g) /* minimum start time over all inputs: */ t0_min = MIN(g->t0, t0); /* how many samples to toss before t0: */ - susp->susp.toss_cnt = ROUND((t0 - t0_min) * sr); + susp->susp.toss_cnt = ROUNDBIG((t0 - t0_min) * sr); if (susp->susp.toss_cnt > 0) { susp->susp.keep_fetch = susp->susp.fetch; susp->susp.fetch = compose_toss_fetch; diff --git a/lib-src/libnyquist/nyquist/nyqsrc/convolve.c b/lib-src/libnyquist/nyquist/nyqsrc/convolve.c index e46d26197..3b37ee074 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/convolve.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/convolve.c @@ -6,15 +6,81 @@ * of the first parameter. */ +/* Original convolve.c modified to do fast convolution. Here are some + * notes: + * The first arg is arbitrary length. The second arg is the impulse + * response, which is converted into a table. The FFT size will be + * limited to 64K, which allows convolution with up to 32K samples. + * For longer impulse responses, we'll have to do convolutions one + * 32K block at a time. I considered just limiting the convolution + * size and handling longer impulse responses in Nyquist XLISP code, + * but that would require taking FFT's of each input block multiple + * times. Here, we save the FFT's and reuse them, which should gain + * a factor of 2 in speed (we still have to inverse FFT each block + * after multiplication, which should take 1/2 the time of doing + * FFT/inverse-FFT on each block). + * + * The fast convolution works like this: + * inputs are x_snd and h_snd. + * Compute the length of h_snd in samples. + * Set fft_size = MAX_FFT_SIZE + * If length <= MAX_FFT_SIZE / 4 then + * set fft_size = (round length to power of 2) * 2 + * set N = fft_size/2 + * Set h_len = (length rounded up to multiple of fft_size/2) * 2 + * Let L = h_len/ fft_size + * Allocate H of h_len floats + * Iterate over i from 0 to L-1: + * Copy ht with zero fill into H[i] of size fft_size, + * where each H[i] of size fft_size is filled with + * fft_size/2 samples (except for the last H[i]) + * Compute FFT of H[i] in place (FFT size is fft_size) + * Allocate X of h_len floats. This represents the history + * of x_snd, which is initially all zero, so the FFT, X is all zero + * Allocate output buffers Y and R, each of size fft_size + * Iterate over j (i.e. run this to generate MAX_CONVOLVE_LEN + * samples; then j = (j + 1) mod L. + * Copy 2nd half of R to first half and zero the 2nd half. + * Note: the first time does nothing because R is initially + * filled with zeros + * Copy fft_size/2 samples of x_snd into X[j], + * where X[j] is of size fft_size and filled with + * N samples (except when x_snd terminates) + * Zero fill X[j] + * Compute FFT of X[j] in place. + * Iterate k = 0 to L-1 + * Multiply X[(j-k) mod L] by H[k] (result goes into Y). + * Compute IFFT of Y in place. Y is now time domain convolution + * of two blocks of samples. + * Add Y to R. + * Now N samples of R can be output. + * For simplicity, we'll keep processing x_snd input even after x_snd + * terminates. This will avoid special cases where we do not need all + * of X[j] at the end of the convolution. + * + * Length of output is length of x input + length of h + */ + +// You can turn on debugging output with: #define D if (1) +#define D if (0) + +#define MAX_IR_LEN 4000000 /* maximum impulse response length */ +#define MAX_LOG_FFT_SIZE 16 /* maximum fft size for convolution */ +//#define MAX_LOG_FFT_SIZE 4 /* maximum fft size for convolution */ +#define _USE_MATH_DEFINES 1 /* for Visual C++ to get M_LN2 */ +#include #include "stdio.h" #ifndef mips #include "stdlib.h" #endif #include "xlisp.h" #include "sound.h" +#include "samples.h" #include "falloc.h" #include "cext.h" +#include "fftlib.h" +#include "fftext.h" #include "convolve.h" void convolve_free(); @@ -23,21 +89,25 @@ void convolve_free(); typedef struct convolve_susp_struct { snd_susp_node susp; long terminate_cnt; + boolean know_end_of_x; boolean logically_stopped; sound_type x_snd; long x_snd_cnt; sample_block_values_type x_snd_ptr; - table_type table; - sample_type *h_buf; - double length_of_h; - long h_len; - long x_buf_len; - sample_type *x_buffer_pointer; - sample_type *x_buffer_current; + sample_type *X; // the FFTs of x_snd + int j; // which block are we processing? 0 <= j < L + sample_type *H; // the FFTs of h_snd + sample_type *Y; // product of X*H where we inverse FFT + int h_snd_len; // true length of h_snd in samples + int N; // length of convolution, FFTs are of size 2*N + int M; // log2 of 2*N, the FFT size + int L; // number of blocks: h_len / (2*N) + sample_type *R; // result buffer where output is summed + sample_type *R_current; // pointer to next sample to output } convolve_susp_node, *convolve_susp_type; - +/* void h_reverse(sample_type *h, long len) { sample_type temp; @@ -50,10 +120,11 @@ void h_reverse(sample_type *h, long len) len--; } } +*/ - -void convolve_s_fetch(register convolve_susp_type susp, snd_list_type snd_list) +void convolve_s_fetch(snd_susp_type a_susp, snd_list_type snd_list) { + convolve_susp_type susp = (convolve_susp_type) a_susp; int cnt = 0; /* how many samples computed */ int togo; int n; @@ -62,191 +133,218 @@ void convolve_s_fetch(register convolve_susp_type susp, snd_list_type snd_list) register sample_block_values_type out_ptr_reg; - register sample_type * h_buf_reg; - register long h_len_reg; - register long x_buf_len_reg; - register sample_type * x_buffer_pointer_reg; - register sample_type * x_buffer_current_reg; - register sample_type x_snd_scale_reg = susp->x_snd->scale; - register sample_block_values_type x_snd_ptr_reg; + sample_type *R = susp->R; + sample_type *R_current; + int N = susp->N; falloc_sample_block(out, "convolve_s_fetch"); out_ptr = out->samples; snd_list->block = out; while (cnt < max_sample_block_len) { /* outer loop */ - /* first compute how many samples to generate in inner loop: */ - /* don't overflow the output sample block: */ - togo = max_sample_block_len - cnt; - - /* don't run past the x_snd input sample block: */ - /* based on susp_check_term_log_samples, but offset by h_len */ - - /* THIS IS EXPANDED BELOW - * susp_check_term_log_samples(x_snd, x_snd_ptr, x_snd_cnt); - */ - if (susp->x_snd_cnt == 0) { - susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt); - - /* THIS IS EXPANDED BELOW - *logical_stop_test(x_snd, susp->x_snd_cnt); - */ - if (susp->x_snd->logical_stop_cnt == - susp->x_snd->current - susp->x_snd_cnt) { - min_cnt(&susp->susp.log_stop_cnt, susp->x_snd, - (snd_susp_type) susp, susp->x_snd_cnt); - } - - /* THIS IS EXPANDED BELOW - * terminate_test(x_snd_ptr, x_snd, susp->x_snd_cnt); - */ - if (susp->x_snd_ptr == zero_block->samples) { - /* ### modify this to terminate at an offset of (susp->h_len) */ - /* Note: in the min_cnt function, susp->x_snd_cnt is *subtracted* - * from susp->x_snd->current to form the terminate time, so to - * increase the time, we need to *subtract* susp->h_len, which - * due to the double negative, *adds* susp->h_len to the ultimate - * terminate time calculation. + /* first compute how many samples to generate in inner loop: */ + /* don't overflow the output sample block: */ + togo = max_sample_block_len - cnt; + /* if we need output samples, generate them here */ + D printf("test R_current at offset %td\n", susp->R_current - R); + if (susp->R_current >= R + N) { // true when we output half of R + int i = 0; + int k; + sample_type *Xj = susp->X + susp->j * N * 2; + sample_type *H = susp->H; + sample_type *Y = susp->Y; + int to_copy; + /* Shift R, zero fill: */ + memcpy(R, R + N, N * sizeof(*R)); + memset(R + N, 0, N * sizeof(*R)); + /* Copy N samples of x_snd into Xj and zero fill to size 2N */ + D printf("Copying N samples of x_snd into Xj at offset %td\n", Xj - susp->X); + while (i < N) { + if (susp->x_snd_cnt == 0) { + susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt); + if (susp->x_snd->logical_stop_cnt == + susp->x_snd->current - susp->x_snd_cnt) { + min_cnt(&susp->susp.log_stop_cnt, susp->x_snd, + (snd_susp_type) susp, susp->x_snd_cnt); + } + } + /* This code is not standard. Since we extend the terminate + * count by susp->h_snd_len, the "standard" call to min_cnt() + * results in extending the terminate time forever. Instead, + * we make this code run once only by setting know_end_of_x. + */ + if (!susp->know_end_of_x && + susp->x_snd_ptr == zero_block->samples) { + susp->terminate_cnt = susp->x_snd->current - susp->x_snd_cnt; + /* extend the output to include impulse response */ + susp->terminate_cnt += susp->h_snd_len; + susp->know_end_of_x = TRUE; + } + /* copy no more than the remaining space and no more than + * the amount remaining in the block */ - min_cnt(&susp->terminate_cnt, susp->x_snd, - (snd_susp_type) susp, susp->x_snd_cnt - susp->h_len); - } - } - - - togo = min(togo, susp->x_snd_cnt); - - /* don't run past terminate time */ - if (susp->terminate_cnt != UNKNOWN && - susp->terminate_cnt <= susp->susp.current + cnt + togo) { - togo = susp->terminate_cnt - (susp->susp.current + cnt); - if (togo == 0) break; - } - - - /* don't run past logical stop time */ - if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) { - int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt); - /* break if to_stop == 0 (we're at the logical stop) - * AND cnt > 0 (we're not at the beginning of the - * output block). - */ - if (to_stop < togo) { - if (to_stop == 0) { - if (cnt) { - togo = 0; - break; - } else /* keep togo as is: since cnt == 0, we - * can set the logical stop flag on this - * output block - */ - susp->logically_stopped = true; - } else /* limit togo so we can start a new - * block at the LST - */ - togo = to_stop; - } - } - - n = togo; - h_buf_reg = susp->h_buf; - h_len_reg = susp->h_len; - x_buf_len_reg = susp->x_buf_len; - x_buffer_pointer_reg = susp->x_buffer_pointer; - x_buffer_current_reg = susp->x_buffer_current; - x_snd_ptr_reg = susp->x_snd_ptr; - out_ptr_reg = out_ptr; - if (n) do { /* the inner sample computation loop */ - long i; double sum; - /* see if we've reached end of x_buffer */ - if ((x_buffer_pointer_reg + x_buf_len_reg) <= (x_buffer_current_reg + h_len_reg)) { - /* shift x_buffer from current back to base */ - for (i = 1; i < h_len_reg; i++) { - x_buffer_pointer_reg[i-1] = x_buffer_current_reg[i]; - } - /* this will be incremented back to x_buffer_pointer_reg below */ - x_buffer_current_reg = x_buffer_pointer_reg - 1; + to_copy = min(N - i, susp->x_snd_cnt); + memcpy(Xj + i, susp->x_snd_ptr, + to_copy * sizeof(*susp->x_snd_ptr)); + susp->x_snd_ptr += to_copy; + susp->x_snd_cnt -= to_copy; + i += to_copy; } - - x_buffer_current_reg++; - - x_buffer_current_reg[h_len_reg - 1] = (x_snd_scale_reg * *x_snd_ptr_reg++); - - sum = 0.0; - for (i = 0; i < h_len_reg; i++) { - sum += x_buffer_current_reg[i] * h_buf_reg[i]; + /* zero fill to size 2N */ + memset(Xj + N, 0, N * sizeof(Xj[0])); + D printf("Xj at offset %td: ", Xj - susp->X); + D for (i = 0; i < susp->N * 2; i++) { + printf("%g ", Xj[i]); } + D printf("\n"); + /* Compute FFT of Xj in place */ + fftInit(susp->M); + rffts(Xj, susp->M, 1); + /* convolve pairs of blocks and sum into Y */ + memset(Y, 0, N * sizeof(*Y)); /* initialize sum to zero */ + for (k = 0; k < susp->L; k++) { + /* Multiply Xj by H (result goes into X) */ + sample_type *X = susp->X + ((susp->L + susp->j - k) % susp->L) * N * 2; + rspectprod(X, H + k * N * 2, Y, N * 2); + /* Compute IFFT of Y in place */ + riffts(Y, susp->M, 1); + /* R += Y */ + D printf("Output block %d, X offset %td: ", k, X - susp->X); + for (i = 0; i < 2 * N; i++) { + R[i] += Y[i]; + D printf("%g ", Y[i]); + } + D printf("\n"); + } + /* now N samples of R can be output */ + susp->R_current = R; + D printf("R: "); + D for (i = 0; i < susp->N; i++) { + printf("%g ", R[i]); + } + D printf("\n"); + susp->j = (susp->j + 1) % susp->L; + } + /* compute togo, the number of samples to "compute" */ + /* can't use more than what's left in R. R_current is + the next sample of R, so what's left is N - (R - R_current) */ + R_current = susp->R_current; + togo = min(togo, N - (R_current - R)); + + /* don't run past terminate time */ + if (susp->terminate_cnt != UNKNOWN && + susp->terminate_cnt <= susp->susp.current + cnt + togo) { + togo = susp->terminate_cnt - (susp->susp.current + cnt); + if (togo == 0) break; + } - *out_ptr_reg++ = (sample_type) sum; - } while (--n); /* inner loop */ + /* don't run past logical stop time */ + if (!susp->logically_stopped && + susp->susp.log_stop_cnt != UNKNOWN && + susp->susp.log_stop_cnt <= susp->susp.current + cnt + togo) { + togo = susp->susp.log_stop_cnt - (susp->susp.current + cnt); + D printf("susp->susp.log_stop_cnt is set to %ld\n", + susp->susp.log_stop_cnt); + if (togo == 0) break; + } - susp->x_buffer_pointer = x_buffer_pointer_reg; - susp->x_buffer_current = x_buffer_current_reg; - /* using x_snd_ptr_reg is a bad idea on RS/6000: */ - susp->x_snd_ptr += togo; - out_ptr += togo; - susp_took(x_snd_cnt, togo); - cnt += togo; + n = togo; + out_ptr_reg = out_ptr; + if (n) do { /* the inner sample computation loop */ + *out_ptr_reg++ = (sample_type) *R_current++; + } while (--n); /* inner loop */ + + /* using R_current is a bad idea on RS/6000: */ + susp->R_current += togo; + out_ptr += togo; + cnt += togo; } /* outer loop */ /* test for termination */ if (togo == 0 && cnt == 0) { - snd_list_terminate(snd_list); + snd_list_terminate(snd_list); } else { - snd_list->block_len = cnt; - susp->susp.current += cnt; + snd_list->block_len = cnt; + susp->susp.current += cnt; } /* test for logical stop */ if (susp->logically_stopped) { - snd_list->logically_stopped = true; + snd_list->logically_stopped = true; } else if (susp->susp.log_stop_cnt == susp->susp.current) { - susp->logically_stopped = true; + susp->logically_stopped = true; } } /* convolve_s_fetch */ -void convolve_toss_fetch(susp, snd_list) - register convolve_susp_type susp; - snd_list_type snd_list; +void convolve_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) { + convolve_susp_type susp = (convolve_susp_type) a_susp; time_type final_time = susp->susp.t0; long n; /* fetch samples from x_snd up to final_time for this block of zeros */ - while ((round((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >= + while ((ROUNDBIG((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >= susp->x_snd->current) susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->x_snd->t0) * susp->x_snd->sr - - (susp->x_snd->current - susp->x_snd_cnt)); + n = ROUNDBIG((final_time - susp->x_snd->t0) * susp->x_snd->sr - + (susp->x_snd->current - susp->x_snd_cnt)); susp->x_snd_ptr += n; susp_took(x_snd_cnt, n); susp->susp.fetch = susp->susp.keep_fetch; - (*(susp->susp.fetch))((snd_susp_type)susp, snd_list); + (*(susp->susp.fetch))(a_susp, snd_list); } -void convolve_mark(convolve_susp_type susp) +void convolve_mark(snd_susp_type a_susp) { + convolve_susp_type susp = (convolve_susp_type) a_susp; sound_xlmark(susp->x_snd); } -void convolve_free(convolve_susp_type susp) +void convolve_free(snd_susp_type a_susp) { - table_unref(susp->table); - free(susp->x_buffer_pointer); sound_unref(susp->x_snd); + convolve_susp_type susp = (convolve_susp_type) a_susp; + free(susp->R); + free(susp->X); + free(susp->Y); + free(susp->H); + sound_unref(susp->x_snd); ffree_generic(susp, sizeof(convolve_susp_node), "convolve_free"); } -void convolve_print_tree(convolve_susp_type susp, int n) +void convolve_print_tree(snd_susp_type a_susp, int n) { + convolve_susp_type susp = (convolve_susp_type) a_susp; indent(n); stdputstr("x_snd:"); sound_print_tree_1(susp->x_snd, n); } +void fill_with_samples(sample_type *x, sound_type s, long n) +{ +/* this is based on snd_fetch in samples.c */ +#define CNT extra[1] +#define INDEX extra[2] +#define FIELDS 3 +#define SAMPLES list->block->samples + int i; + for (i = 0; i < n; i++) { + if (!s->extra) { /* this is the first call, so fix up s */ + s->extra = (long *) malloc(sizeof(long) * FIELDS); + s->extra[0] = sizeof(long) * FIELDS; + s->CNT = s->INDEX = 0; + } + if (s->CNT == s->INDEX) { + sound_get_next(s, &(s->CNT)); + s->INDEX = 0; + } + x[i] = s->SAMPLES[s->INDEX++] * s->scale; + } +} + sound_type snd_make_convolve(sound_type x_snd, sound_type h_snd) { @@ -255,17 +353,80 @@ sound_type snd_make_convolve(sound_type x_snd, sound_type h_snd) time_type t0 = x_snd->t0; sample_type scale_factor = 1.0F; time_type t0_min = t0; + long h_len; + int i; + // assume fft_size is maximal. We fix this later if it is wrong + long fft_size = 1 << MAX_LOG_FFT_SIZE; + if (sr != h_snd->sr) { + xlfail("convolve requires both inputs to have the same sample rates"); + } falloc_generic(susp, convolve_susp_node, "snd_make_convolve"); - susp->table = sound_to_table(h_snd); - susp->h_buf = susp->table->samples; - susp->length_of_h = susp->table->length; - susp->h_len = (long) susp->length_of_h; - h_reverse(susp->h_buf, susp->h_len); - susp->x_buf_len = 2 * susp->h_len; - susp->x_buffer_pointer = calloc((2 * (susp->h_len)), sizeof(float)); - susp->x_buffer_current = susp->x_buffer_pointer; - susp->susp.fetch = (snd_fetch_fn)convolve_s_fetch; + /* compute the length of h_snd in samples */ + h_len = snd_length(h_snd, MAX_IR_LEN + 1); + if (h_len > MAX_IR_LEN) { + char emsg[100]; + sprintf(emsg, "convolve maximum impulse length is %d", MAX_IR_LEN); + xlfail(emsg); + } + /* len is the impulse response length; + * the FFT size is at least double that */ + if (h_len <= fft_size / 4) { + /* compute log-base-2(h_len): */; + double log_len = log(h_len) / M_LN2; + int log_len_int = log_len; + if (log_len_int != log_len) log_len_int++; /* round up to power of 2 */ + susp->M = log_len_int + 1; + } else { + susp->M = MAX_LOG_FFT_SIZE; + } + fft_size = (1 << susp->M); + D printf("fft_size %ld\n", fft_size); + susp->N = fft_size / 2; + // round h_len up to multiple of susp->N and multiply by 2 + susp->h_snd_len = h_len; + h_len = ((h_len + susp->N - 1) / susp->N) * susp->N * 2; + susp->L = h_len / fft_size; + // allocate memory + susp->H = (sample_type *) calloc(h_len, sizeof(susp->H[0])); + if (!susp->H) { + xlfail("memory allocation failure in convolve"); + } + for (i = 0; i < susp->L; i++) { + /* copy fft_size/2 samples into each H[i] */ + fill_with_samples(susp->H + i * susp->N * 2, h_snd, susp->N); + } + for (i = 0; i < susp->L; i++) { + int j; + float *H = susp->H + i * susp->N * 2; + D printf("H_%d at %td: ", i, H - susp->H); + D for (j = 0; j < susp->N * 2; j++) printf("%g ", H[j]); + D printf("\n"); + } + sound_unref(h_snd); + h_snd = NULL; + /* remaining N samples are already zero-filled */ + if (fftInit(susp->M)) { + free(susp->H); + xlfail("fft initialization error in convolve"); + } + /* take the FFT of each block of the impulse response */ + for (i = 0; i < susp->L; i++) { + rffts(susp->H + i * susp->N * 2, susp->M, 1); + } + susp->X = (sample_type *) calloc(h_len, sizeof(susp->X[0])); + susp->R = (sample_type *) calloc(fft_size, sizeof(susp->R[0])); + susp->Y = (sample_type *) calloc(fft_size, sizeof(susp->Y[0])); + if (!susp->X || !susp->R || !susp->Y) { + free(susp->H); + if (susp->X) free(susp->X); + if (susp->R) free(susp->R); + if (susp->Y) free(susp->Y); + xlfail("memory allocation failed in convolve"); + } + susp->R_current = susp->R + susp->N; + susp->susp.fetch = &convolve_s_fetch; susp->terminate_cnt = UNKNOWN; + susp->know_end_of_x = FALSE; /* handle unequal start times, if any */ if (t0 < x_snd->t0) sound_prepend_zeros(x_snd, t0); /* minimum start time over all inputs: */ @@ -273,22 +434,23 @@ sound_type snd_make_convolve(sound_type x_snd, sound_type h_snd) /* how many samples to toss before t0: */ susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5); if (susp->susp.toss_cnt > 0) { - susp->susp.keep_fetch = (snd_fetch_fn)susp->susp.fetch; + susp->susp.keep_fetch = susp->susp.fetch; susp->susp.fetch = convolve_toss_fetch; } /* initialize susp state */ - susp->susp.free = (snd_free_fn)convolve_free; + susp->susp.free = convolve_free; susp->susp.sr = sr; susp->susp.t0 = t0; - susp->susp.mark = (snd_mark_fn)convolve_mark; - susp->susp.print_tree = (snd_print_tree_fn)convolve_print_tree; + susp->susp.mark = convolve_mark; + susp->susp.print_tree = convolve_print_tree; susp->susp.name = "convolve"; susp->logically_stopped = false; susp->susp.log_stop_cnt = logical_stop_cnt_cvt(x_snd); susp->susp.current = 0; susp->x_snd = x_snd; susp->x_snd_cnt = 0; + susp->j = 0; return sound_create((snd_susp_type)susp, t0, sr, scale_factor); } @@ -296,5 +458,6 @@ sound_type snd_make_convolve(sound_type x_snd, sound_type h_snd) sound_type snd_convolve(sound_type x_snd, sound_type h_snd) { sound_type x_snd_copy = sound_copy(x_snd); - return snd_make_convolve(x_snd_copy, h_snd); + sound_type h_snd_copy = sound_copy(h_snd); + return snd_make_convolve(x_snd_copy, h_snd_copy); } diff --git a/lib-src/libnyquist/nyquist/nyqsrc/downsample.c b/lib-src/libnyquist/nyquist/nyqsrc/downsample.c index 261332983..ca1e9c786 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/downsample.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/downsample.c @@ -40,178 +40,6 @@ typedef struct down_susp_struct { } down_susp_node, *down_susp_type; -void down_n_fetch(snd_susp_type a_susp, snd_list_type snd_list) -{ - down_susp_type susp = (down_susp_type) a_susp; - int cnt = 0; /* how many samples computed */ - int togo; - int n; - sample_block_type out; - register sample_block_values_type out_ptr; - - register sample_block_values_type out_ptr_reg; - - register sample_block_values_type s_ptr_reg; - falloc_sample_block(out, "down_n_fetch"); - out_ptr = out->samples; - snd_list->block = out; - - while (cnt < max_sample_block_len) { /* outer loop */ - /* first compute how many samples to generate in inner loop: */ - /* don't overflow the output sample block: */ - togo = max_sample_block_len - cnt; - - /* don't run past the s input sample block: */ - susp_check_term_log_samples(s, s_ptr, s_cnt); - togo = MIN(togo, susp->s_cnt); - - /* don't run past terminate time */ - if (susp->terminate_cnt != UNKNOWN && - susp->terminate_cnt <= susp->susp.current + cnt + togo) { - togo = susp->terminate_cnt - (susp->susp.current + cnt); - if (togo == 0) break; - } - - /* don't run past logical stop time */ - if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) { - int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt); - /* break if to_stop == 0 (we're at the logical stop) - * AND cnt > 0 (we're not at the beginning of the - * output block). - */ - if (to_stop < togo) { - if (to_stop == 0) { - if (cnt) { - togo = 0; - break; - } else /* keep togo as is: since cnt == 0, we - * can set the logical stop flag on this - * output block - */ - susp->logically_stopped = true; - } else /* limit togo so we can start a new - * block at the LST - */ - togo = to_stop; - } - } - - n = togo; - s_ptr_reg = susp->s_ptr; - out_ptr_reg = out_ptr; - if (n) do { /* the inner sample computation loop */ - *out_ptr_reg++ = *s_ptr_reg++; - } while (--n); /* inner loop */ - - /* using s_ptr_reg is a bad idea on RS/6000: */ - susp->s_ptr += togo; - out_ptr += togo; - susp_took(s_cnt, togo); - cnt += togo; - } /* outer loop */ - - /* test for termination */ - if (togo == 0 && cnt == 0) { - snd_list_terminate(snd_list); - } else { - snd_list->block_len = cnt; - susp->susp.current += cnt; - } - /* test for logical stop */ - if (susp->logically_stopped) { - snd_list->logically_stopped = true; - } else if (susp->susp.log_stop_cnt == susp->susp.current) { - susp->logically_stopped = true; - } -} /* down_n_fetch */ - - -void down_s_fetch(snd_susp_type a_susp, snd_list_type snd_list) -{ - down_susp_type susp = (down_susp_type) a_susp; - int cnt = 0; /* how many samples computed */ - int togo; - int n; - sample_block_type out; - register sample_block_values_type out_ptr; - - register sample_block_values_type out_ptr_reg; - - register sample_type s_scale_reg = susp->s->scale; - register sample_block_values_type s_ptr_reg; - falloc_sample_block(out, "down_s_fetch"); - out_ptr = out->samples; - snd_list->block = out; - - while (cnt < max_sample_block_len) { /* outer loop */ - /* first compute how many samples to generate in inner loop: */ - /* don't overflow the output sample block: */ - togo = max_sample_block_len - cnt; - - /* don't run past the s input sample block: */ - susp_check_term_log_samples(s, s_ptr, s_cnt); - togo = min(togo, susp->s_cnt); - - /* don't run past terminate time */ - if (susp->terminate_cnt != UNKNOWN && - susp->terminate_cnt <= susp->susp.current + cnt + togo) { - togo = susp->terminate_cnt - (susp->susp.current + cnt); - if (togo == 0) break; - } - - /* don't run past logical stop time */ - if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) { - int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt); - /* break if to_stop == 0 (we're at the logical stop) - * AND cnt > 0 (we're not at the beginning of the - * output block). - */ - if (to_stop < togo) { - if (to_stop == 0) { - if (cnt) { - togo = 0; - break; - } else /* keep togo as is: since cnt == 0, we - * can set the logical stop flag on this - * output block - */ - susp->logically_stopped = true; - } else /* limit togo so we can start a new - * block at the LST - */ - togo = to_stop; - } - } - - n = togo; - s_ptr_reg = susp->s_ptr; - out_ptr_reg = out_ptr; - if (n) do { /* the inner sample computation loop */ - *out_ptr_reg++ = (s_scale_reg * *s_ptr_reg++); - } while (--n); /* inner loop */ - - /* using s_ptr_reg is a bad idea on RS/6000: */ - susp->s_ptr += togo; - out_ptr += togo; - cnt += togo; - } /* outer loop */ - - /* test for termination */ - if (togo == 0 && cnt == 0) { - snd_list_terminate(snd_list); - } else { - snd_list->block_len = cnt; - susp->susp.current += cnt; - } - /* test for logical stop */ - if (susp->logically_stopped) { - snd_list->logically_stopped = true; - } else if (susp->susp.log_stop_cnt == susp->susp.current) { - susp->logically_stopped = true; - } -} /* down_s_fetch */ - - void down_i_fetch(snd_susp_type a_susp, snd_list_type snd_list) { down_susp_type susp = (down_susp_type) a_susp; @@ -240,12 +68,13 @@ void down_i_fetch(snd_susp_type a_susp, snd_list_type snd_list) susp_check_term_log_samples(s, s_ptr, s_cnt); s_x2_sample = susp_current_sample(s, s_ptr); - + /* initially, s_x1_sample and s_x2_samples will be the first 2 samples + * and phase will be zero, so interpolation between these two will yield + * s_x1_sample. */ while (cnt < max_sample_block_len) { /* outer loop */ /* first compute how many samples to generate in inner loop: */ /* don't overflow the output sample block: */ togo = max_sample_block_len - cnt; - /* don't run past terminate time */ if (susp->terminate_cnt != UNKNOWN && susp->terminate_cnt <= susp->susp.current + cnt + togo) { @@ -259,38 +88,48 @@ void down_i_fetch(snd_susp_type a_susp, snd_list_type snd_list) /* don't run past logical stop time */ if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) { int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt); - /* break if to_stop == 0 (we're at the logical stop) - * AND cnt > 0 (we're not at the beginning of the - * output block). - */ - if (to_stop < togo) { - if (to_stop == 0) { - if (cnt) { - togo = 0; - break; - } else /* keep togo as is: since cnt == 0, we - * can set the logical stop flag on this - * output block - */ - susp->logically_stopped = true; - } else /* limit togo so we can start a new - * block at the LST - */ - togo = to_stop; - } - } + /* break if to_stop == 0 (we're at the logical stop) + * AND cnt > 0 (we're not at the beginning of the + * output block). + */ + if (to_stop < togo) { + if (to_stop == 0) { + if (cnt) { + togo = 0; + break; + } else /* keep togo as is: since cnt == 0, we + * can set the logical stop flag on this + * output block + */ + susp->logically_stopped = true; + } else /* limit togo so we can start a new + * block at the LST + */ + togo = to_stop; + } + } n = togo; s_pHaSe_ReG = susp->s_pHaSe; s_x1_sample_reg = susp->s_x1_sample; out_ptr_reg = out_ptr; - if (n) do { /* the inner sample computation loop */ + if (n) do { while (s_pHaSe_ReG >= 1.0) { - s_x1_sample_reg = s_x2_sample; - /* pick up next sample as s_x2_sample: */ - susp->s_ptr++; - susp_took(s_cnt, 1); - s_pHaSe_ReG -= 1.0; + if (s_pHaSe_ReG < 2) { /* quick, just take one sample */ + s_x1_sample_reg = s_x2_sample; + /* pick up next sample as s_x2_sample: */ + susp->s_ptr++; + susp_took(s_cnt, 1); + s_pHaSe_ReG -= 1.0; + } else { /* jump over as much input as possible */ + int take = (int) s_pHaSe_ReG; /* rounds down */ + take--; /* leave s_pHaSe_ReG > 1 so we stay in loop */ + /* next iteration will set s_x1_sample_reg */ + if (take > susp->s_cnt) take = susp->s_cnt; + susp->s_ptr += take; + susp_took(s_cnt, take); + s_pHaSe_ReG -= take; + } /* derived from susp_check_term_log_samples_break, but with a goto instead of a break */ if (susp->s_cnt == 0) { @@ -305,6 +144,22 @@ void down_i_fetch(snd_susp_type a_susp, snd_list_type snd_list) susp->susp.log_stop_cnt != UNKNOWN && susp->susp.log_stop_cnt < susp->susp.current + cnt + togo)) { + /* Because we are down sampling, we could have just + computed an output at sample N and be working on + sample N+1, but then the next input sample is + logically stopped. Bad because we cannot back up + and undo sample N to put it in the next block with + a logical stop flag set. Our only choice is to "fix" + the logical stop time to be on the next sample. */ + if (susp->terminate_cnt != UNKNOWN && + susp->terminate_cnt < susp->susp.current + togo - n) { + susp->terminate_cnt = susp->susp.current + togo - n; + } + if (susp->susp.log_stop_cnt != UNKNOWN && + susp->susp.log_stop_cnt < + susp->susp.current + togo - n) { + susp->susp.log_stop_cnt = susp->susp.current + togo - n; + } goto breakout; } } @@ -354,7 +209,7 @@ void down_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ if (final_count == susp->susp.toss_cnt) { - n = ROUND((final_time - susp->s->t0) * susp->s->sr - + n = ROUNDBIG((final_time - susp->s->t0) * susp->s->sr - (susp->s->current - susp->s_cnt)); susp->s_ptr += n; susp_took(s_cnt, n); @@ -405,13 +260,7 @@ sound_type snd_make_down(rate_type sr, sound_type s) } falloc_generic(susp, down_susp_node, "snd_make_down"); - /* select a susp fn based on sample rates */ - if (s->sr == sr) { - susp->susp.fetch = ((s->scale == 1.0) ? - down_n_fetch : down_s_fetch); - } else { - susp->susp.fetch = down_i_fetch; - } + susp->susp.fetch = down_i_fetch; susp->terminate_cnt = UNKNOWN; /* handle unequal start times, if any */ diff --git a/lib-src/libnyquist/nyquist/nyqsrc/f0.cpp b/lib-src/libnyquist/nyquist/nyqsrc/f0.cpp index 99ca5dad2..b157f3dd1 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/f0.cpp +++ b/lib-src/libnyquist/nyquist/nyqsrc/f0.cpp @@ -30,7 +30,7 @@ float parabolic_interp(float x1, float x2, float x3, float y1, float y2, float y // dy/dx = 2a*x + b = 0 - pos= -b/2.0/a; + pos= -b/2.0F/a; return pos; @@ -134,6 +134,6 @@ float best_f0(float *samples, int n, int m, float threshold, int Tmax) best_f0=f0; } } - delete[] results; + delete(results); return best_f0; } diff --git a/lib-src/libnyquist/nyquist/nyqsrc/falloc.c b/lib-src/libnyquist/nyquist/nyqsrc/falloc.c index 30b51fbde..7656f4cc1 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/falloc.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/falloc.c @@ -73,7 +73,7 @@ void new_pool(void) poolend = poolp + MAXPOOLSIZE; npools++; /* stick to double word boundaries */ - poolp = (char *) round_size(((long) poolp)); + poolp = (char *) round_size(((intptr_t) poolp)); } /* new_spool -- allocate a new spool from which sample blocks are allocated */ @@ -99,7 +99,7 @@ void new_spool(void) spoolend = spoolp + MAXSPOOLSIZE; npools++; /* stick to double word boundaries */ - spoolp = (char *) round_size(((long) spoolp)); + spoolp = (char *) round_size(((intptr_t) spoolp)); } @@ -113,39 +113,45 @@ void new_spool(void) 4) try pool again 5) allocate new pool and use it */ -sample_block_type find_sample_block(void) -{ - sample_block_type sp; - if (sample_block_total < sample_block_low_water + BLOCKS_PER_GC && - check_spool(round_size(sizeof(sample_block_node)))) { +void find_sample_block(sample_block_type *sp) +{ + if (!Qempty(sample_block_free)) { + Qget(sample_block_free, sample_block_type, *sp); + } else if (sample_block_total < sample_block_low_water + BLOCKS_PER_GC && + sample_block_total < max_sample_blocks && + check_spool(round_size(sizeof(sample_block_node)))) { if (DEBUG_MEM) spoolp += DEBUG_MEM_INFO_SIZE; - sp = (sample_block_type) spoolp; + *sp = (sample_block_type) spoolp; spoolp += round_size(sizeof(sample_block_node)); sample_block_total++; -/* printf("fp%d ", sample_block_total - sample_block_low_water); */ } else { -/* printf("falloc calling gc\n"); */ gc(); sample_block_low_water = sample_block_used; if (!Qempty(sample_block_free)) { - Qget(sample_block_free, sample_block_type, sp); -/* printf("gc, then from freelist\n"); */ + Qget(sample_block_free, sample_block_type, *sp); + } else if (sample_block_used >= max_sample_blocks) { + /* we are not allowed to allocate more */ + stdputstr("The maximum number of sample blocks has been\n"); + stdputstr("reached, so audio computation must be terminated.\n"); + stdputstr("Probably, your program should not be retaining\n"); + stdputstr("so many samples in memory. You can get and set\n"); + stdputstr("the maximum using SND-SET-MAX-AUDIO-MEM.\n"); + xlfail("audio memory exhausted"); } else if (check_spool(round_size(sizeof(sample_block_node)))) { if (DEBUG_MEM) spoolp += DEBUG_MEM_INFO_SIZE; - sp = (sample_block_type) spoolp; + *sp = (sample_block_type) spoolp; spoolp += round_size(sizeof(sample_block_node)); sample_block_total++; -/* printf("gc, then from spool\n"); */ - } else { + } else if (sample_block_used < max_sample_blocks) { new_spool(); if (DEBUG_MEM) spoolp += DEBUG_MEM_INFO_SIZE; - sp = (sample_block_type) spoolp; + *sp = (sample_block_type) spoolp; spoolp += round_size(sizeof(sample_block_node)); sample_block_total++; -/* printf("gc, then new spool\n"); */ } } - return sp; + (*sp)->refcnt = 1; \ + sample_block_used++; \ } @@ -183,7 +189,7 @@ void falloc_gc() for (cp = pools; cp; lp = cp, cp = np) { char *str = ((char *)cp) + POOL_HEAD_SIZE; char *end = str + MAXSPOOLSIZE; - long tsiz = end - str; + intptr_t tsiz = end - str; long csiz = 0; CQUE *tsave = NULL; CQUE *ln = NULL; diff --git a/lib-src/libnyquist/nyquist/nyqsrc/falloc.h b/lib-src/libnyquist/nyquist/nyqsrc/falloc.h index 1219bfd2c..a863a5423 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/falloc.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/falloc.h @@ -98,7 +98,7 @@ void falloc_gc(); void falloc_init(void); void new_pool(void); void new_spool(void); -sample_block_type find_sample_block(void); +void find_sample_block(sample_block_type *sp); char *get_from_pool(size_t siz); @@ -121,16 +121,13 @@ char *get_from_pool(size_t siz); #define BLOCKS_PER_GC 100 -#define falloc_sample_block(sp, who) { \ - if (!Qempty(sample_block_free)) \ - Qget(sample_block_free, sample_block_type, sp) \ - else sp = find_sample_block(); \ - /* sample_block_test(sp, "falloc_sample_block"); */ \ - /* printf("[%x] ", sp); */ \ - DBG_MEM_ALLOCATED(sp, who); \ - sp->refcnt = 1; \ - sample_block_used++; \ -} +/* There used to be a lot of code in this macro. I moved it to + * find_sample_block, but kept the macro mainly in order to pass sp + * by reference. + */ +#define falloc_sample_block(sp, who) { \ + find_sample_block(&sp); \ + DBG_MEM_ALLOCATED(sp, who); } #define ffree_sample_block(sp, who) { \ diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fft.c b/lib-src/libnyquist/nyquist/nyqsrc/fft.c index 6f8b8fb42..8b190c467 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/fft.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/fft.c @@ -15,6 +15,7 @@ /* CHANGE LOG * -------------------------------------------------------------------- * 28Apr03 dm change for portability: min->MIN + * 28May15 rd swap time domain signal before FFT to get correct phase */ @@ -67,6 +68,18 @@ } */ +void fft_shift(float *x, int len) +{ + int j = len / 2; + int i; + for (i = 0; i < len / 2; i++) { + float temp = x[i]; + x[i] = x[j]; + x[j++] = temp; + } +} + + void n_samples_from_sound(sound_type s, long n, float *table) { long blocklen; @@ -183,10 +196,13 @@ LVAL snd_fft(sound_type s, long len, long step, LVAL winval) temp_fft[i] = samples[i] * *window++; } /* perform the fft: */ - m = round(log(len) / M_LN2); /* compute log-base-2(len) */ + m = ROUND32(log(len) / M_LN2); /* compute log-base-2(len) */ if (1 << m != len) { xlfail("FFT len is not a power of two"); } + /* to get correct phase, you need to swap the left and right halves + of the time domain signal before the FFT */ + fft_shift(temp_fft, len); if (!fftInit(m)) rffts(temp_fft, m, 1); else xlfail("FFT initialization error"); diff --git a/lib-src/libnyquist/nyquist/nyqsrc/fft.h b/lib-src/libnyquist/nyquist/nyqsrc/fft.h index 74b2b24dd..0278be8dc 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/fft.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/fft.h @@ -1,4 +1,6 @@ /* fft.h -- fft returned through a lisp array */ +void fft_shift(float *x, int len); + LVAL snd_fft(sound_type s, long len, long step, LVAL w); /* LISP: (SND-FFT SOUND FIXNUM FIXNUM ANY) */ diff --git a/lib-src/libnyquist/nyquist/nyqsrc/inverse.c b/lib-src/libnyquist/nyquist/nyqsrc/inverse.c index a1a3a7213..572bb1707 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/inverse.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/inverse.c @@ -144,7 +144,7 @@ void inverse_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ if (final_count == susp->susp.toss_cnt) { - n = ROUND((final_time - susp->s->t0) * susp->s->sr - + n = ROUNDBIG((final_time - susp->s->t0) * susp->s->sr - (susp->s->current - susp->s_cnt)); susp->s_ptr += n; susp_took(s_cnt, n); diff --git a/lib-src/libnyquist/nyquist/nyqsrc/local.c b/lib-src/libnyquist/nyquist/nyqsrc/local.c index 1cd3eedae..601bd47dd 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/local.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/local.c @@ -47,9 +47,9 @@ void print_local_gc_info(void) { char buf[50]; /* print sample blocks */ - sprintf(buf, "; samples %dKB, %dKB free", - (sample_block_total * max_sample_block_len) / 1024, + sprintf(buf, "; samples %zdKB, %zdKB free", + (sample_block_total * max_sample_block_len * sizeof(sample_type)) / 1024, ((sample_block_total - sample_block_used) * - max_sample_block_len) / 1024); + max_sample_block_len * sizeof(sample_type)) / 1024); stdputstr(buf); } diff --git a/lib-src/libnyquist/nyquist/nyqsrc/lpanal.c b/lib-src/libnyquist/nyquist/nyqsrc/lpanal.c index d6baf9890..92e6c1a17 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/lpanal.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/lpanal.c @@ -65,7 +65,8 @@ void xcorr(double *s, double *rxx, long N) // PITCH DETECTION ALGORITHM: Implemented separately - +char *lpanal_expected_flonum_vector = "expected flonum vector"; +char *lpanal_insufficient_space = "insufficient space"; LVAL snd_lpanal(LVAL w, long P) { @@ -79,34 +80,34 @@ LVAL snd_lpanal(LVAL w, long P) double unv; double suma, alphatemp; // help variables - long i,j; LVAL result; xlsave1(result); - - - //// end vars ///////////// - - //// allocate memory /////// + if (!vectorp(w)) xlfail(lpanal_expected_flonum_vector); N = getsize(w); - s = calloc(sizeof(double),N); //signal - rxx = calloc(sizeof(double),N); //autocorrelation + s = calloc(sizeof(double), N); //signal + if (!s) xlfail(lpanal_insufficient_space); + rxx = calloc(sizeof(double), N); //autocorrelation + if (!rxx) xlfail(lpanal_insufficient_space); alpha = calloc(sizeof(double), P); // filter coefs + if (!alpha) xlfail(lpanal_insufficient_space); //k = calloc(sizeof(double), P); // reflection coefs //E = calloc(sizeof(double), P); // residual energy - ////// copy Lisp array sound data to array of double /////// - for(i=0; is2 = snd_make_normalize(susp->s2); } - sother_start = ROUND((susp->s2->t0 - susp->susp.t0) * susp->s2->sr); + sother_start = ROUNDBIG((susp->s2->t0 - susp->susp.t0) * susp->s2->sr); D nyquist_printf("sother_start computed for %p: %d\n", susp, (int)sother_start); if (sother_start > susp->susp.current) { diff --git a/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.h b/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.h index ce1ae5ff3..b7343e584 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/nfilterkit.h @@ -11,10 +11,10 @@ typedef unsigned int UWORD; #ifdef DEBUG #define INLINE -#else /* DEBUG */ +#else DEBUG /* #define INLINE inline */ #define INLINE -#endif /* DEBUG */ +#endif DEBUG /* * FilterUp() - Applies a filter to a given sample when up-converting. diff --git a/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.c b/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.c index f3b949f10..d14f2220a 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/nyq-osc-server.c @@ -20,7 +20,9 @@ #include #include #include +#ifndef __APPLE__ // OS X does not have strings.h #include +#endif #include #include #endif @@ -29,6 +31,7 @@ #include "lo/lo.h" #include "nyq-osc-server.h" #include "sndsliders.h" +#include "sliderdata.h" static lo_server the_server = NULL; static int lo_fd; @@ -36,7 +39,7 @@ static int lo_fd; static void error(int num, const char *msg, const char *path) { char s[256]; - sprintf(s, "liblo server error %d in path %s: %s\n", num, path, msg); + snprintf(s, 255, "liblo server error %d in path %s: %s\n", num, path, msg); stdputstr(s); } @@ -56,8 +59,8 @@ static int wii_orientation_handler(const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { - set_slider(0, min(1.0F, max(0.0F, (argv[0]->f / 180) + 0.5))); - set_slider(1, min(1.0F, max(0.0F, (argv[1]->f / 180) + 0.5))); + set_slider(0, min(1.0F, max(0.0F, (argv[0]->f / 180.0F) + 0.5F))); + set_slider(1, min(1.0F, max(0.0F, (argv[1]->f / 180.0F) + 0.5F))); return 0; } diff --git a/lib-src/libnyquist/nyquist/nyqsrc/phasevocoder.c b/lib-src/libnyquist/nyquist/nyqsrc/phasevocoder.c index d4460952b..0627d998a 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/phasevocoder.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/phasevocoder.c @@ -1,6 +1,158 @@ -/* phasevocoder.c -- this is a stub showing how you might hook a - phase vocoder into Nyquist using pvshell - */ +/* phasevocoder.c -- this is a time-stretching phase vocoder. + +Design notes: we will use the "absolute" interface of the cmupv library. +"Absolute" means that rather than giving the phase vocoder a hop size +with which to move through the input (thus input position is +"relative"), a callback gives an exact input location. Thus, the input +parameters to the phase vocoder will be the input sound and a mapping +from output time to input time. For each frame of output, we'll get a +callback asking for input. In the callback, we'll evaluate the mapping +up to the frame's center time, using interpolation if necessary, and +then evaluate the input sound as needed to find an input frame at the +mapped time. + +Because Nyquist sounds are computed incrementally, the phase vocoder +input position must be non-decreasing. This will result in an +interface similar to the sound-warp function. The documentation for +sound-warp has a detailed explanation of the warp-fn parameter that +maps between "score" time and real time. + +It should be possible to build on the phase vocoder to provide pitch +manipulation as well as time stretching, including using high quality +resampling provided in sound-warp. Extending the sound-warp interface, +suppose we have two control functions. One, called warp-fn maps from +"score" time to real time (as in sound-warp). Another, called pitch-fn +provides a frequency scale factor (>0) as a function of "score" time. + +For example, supposed the input is 10s long. To transpose continuously +from 0 to 12 semitones, the pitch-fn can be pwev(1, 10, 2), generating +an exponential sweep from 1 to 2 over the course of the sound. To +simultaneously slow the tempo gradually by a factor of 2, let's use +the same function, pwev(1, 10, 2). If we integrate, we get a function +from score time to real time (warp-fn), so taking the inverse, we get +a function from real time to score time, which can be used to find the +location of each input frame for processing. + +This is not really the solution because we want to incorporate +additional stretching to allow for resampling to change the pitch. +Consider the construction of time stretching and pitch shifting +functions that simultaneously produce the right time mappings and +pitch shifting. We will first apply the phase vocoder, then apply +resampling. +Let V(u) be the mapping from phase vocoder output time to input time, +and let Vinv(t) be the inverse ov V(u). +Let W(u) be the mapping from phase vocoder output time to final output +time, i.e. this is the sound-warp mapping. +Let S(t) be the stretch factor to be applied at time t (of the input). +Let P(t) be the pitch transposition to be applied at time t (of the input). +We can compute Vinv(t) by considering the following: At time t, the +signal must be stretched by the product S(t)*P(t) because S(t) is the +stretch factor, and because we need to stretch by an additional factor +of P(t) so that when we resample to achieve pitch transposition, +effectively stretching by 1/P(t), the net stretch due to transposition +will be 1. +Thus, Vinv(t) = Integral[S(t)*P(t)]. V(u) is derived by taking the +inverse of Vinv(t), a primitive operation in Nyquist. +Now we need W(u). The input to the sound-warp (resampling) function +will have the pitch of the original signal because the phase vocoder +preserves pitch. At each point u, the pitch change applied to the +signal will be the inverse of the derivative of W(u): + Pitch change at u = 1/W'(u) +The "pitch change at u" is P(V(u)) and we know V, so we can write +W'(u) = 1/P(V(u)) +thus, W(u) = Integral[1/P(V(u))] + + +INTERFACE WTIH CMUPV +-------------------- + +f is the input sound +g is the map from output to input + +Samples are computed by pv_fetch which has a state[] field +available as well as an interface to get samples from input +signals. The state[] is only accessible to pv_fetch because +it is inside a pvshell_susp_node, which is local within +pvshell.c. (This may not be the best design.) Therefore, to +create the phase vocoder object and save a pointer in the +state, we test for the first call to pv_fetch and do some +initialization there instead of in snd_vocoder where the +suspension is created. + +Output is taken from OUTPUT as needed until REMAINING is zero. +Then, pv_get_output2() is called to generate more samples. +pv_get_output2() calls the callback, which does most of the complex work. +(1) The callback must figure out the "time" of the next frame it will + generate. This will be based on out_count provided to the callback. +(2) Map this time via g to an input time for f and convert to samples. +(3) Subtract framesize / 2 to get the first_sample we need from f. +(4) f_count is the total sample count for the end of input so the beginning + of input is at f_count - fftsize. first_sample is the place we want + to start the next frame, so we need to skip over + first_sample - (f_count - fftsize) samples. +(5) fill the rest of input from f. + +Logical Stop and Terminate Logic +-------------------------------- +The logical stop time should be the logical stop time of the input (f) +mapped to the output. Since g is a map from output time to input time, we want + g(output.lst) = f.lst, or output.lst = g-inverse(f.lst) + In practice, we're not given g-inverse and would like not to compute +it. We iterate through g to find g(t) for each fft frame center time. When +we reach the logical stop time of the input, detected by PVSHELL_TEST_F +returning PVSHELL_FLAG_LOGICAL_STOP, we can set the logical stop time of +the output by linearly interpolation. We save previous time points in g as +t0,g0 and t1,g1, where g0 = g(t0) and g1 = g(t1). We have the logical stop +time of f that we'll call g2 and we want the corresponding t2: + (t1 - t0)/(t2 - t0) = (g1 - g0)/(g2 - g0), so + (t1 - t0) = (t2 - t0) * (g1 - g0)/(g2 - g0), so + t1 = t0 + (t2 - t0) * (g1 - g0)/(g2 - g0), where + t1 is the logical stop time. + The logical stop time can also be the terminate time of g -- if g +terminates, we must terminate the output (otherwise we'll be reading from +time 0 of the input, but we're not allowed to go backward.) + +The terminate time is when the remaining output will be zero. Since the +phase vocoder output continues for half a window beyond the last point +mapped from input to output, we really don't want to try to do any mapping. +Instead, we just wait until the input is all zeros and figure out when the +output will be all zeros. + +Input becomes all zero when either we get a frame past the terminate time +of the input f, or we reach beyond the terminate time of g. Either way, we +should set a flag saying input has terminated and will be all zero. + +Output becomes all zero fftsize / 2 - hopsize beyond the time point of the +first all-zero frame: Let's say we see the flag saying the input is all +zero because we've terminated on the input side. The *previous* frame was +therefore the last non-zero signal, and it extends for fftsize/2, but it was +one hopsize ago, so the non-zero signal extends fftsize/2 - hopsize from the +time of the all-zero frame. + +Access to PV state +------------------ + +Things start with a call to snd_phasevocoder(f, g, fftsize, hopsize). The +info is put into pv_state_node, which is passed to pvshell and copied into +susp->pvshell.state. The fetch function is pvshell_fetch, which calls +pv_fetch through the pointer susp->pvshell.h. h (which is pv_fetch) returns +flags to indicate logical stop and terminate, and it returns n, the number +of samples computed. If the terminate flag is set, the output is assumed to +be zero and the zero block is used. + +The susp info and the pv_state_node info can be accessed in pv_fetch, but +the phase vocoder computation is in a callback. However, the parameter to +the callback is the susp pointer, so in the callback we can access the +pvshell_type and the pvstate_type data. + +To return the flags, we have to stuff data into the +pvstate_type struct and read it back out in pv_fetch after calling +pv_get_output2(), which is the phase vocoder calculation that calls the +callback. + +TODO: if g0 and t0 are not initialized because of early logical stop, +what do we do? +*/ #include "stdio.h" #ifndef mips @@ -14,68 +166,304 @@ #include "pvshell.h" #include "phasevocoder.h" +#include "cmupv.h" -/* use the state[] info for sample interpolation */ -#define X_VALUE state[0] /* a parameter value */ -#define F_COUNT state[1] /* counts samples of f */ -#define G_COUNT state[2] /* counts samples of g */ -#define G_PREV state[3] /* previous value from g */ -#define G_NEXT state[4] /* next (current?) value from g */ -/* invariant: G_NEXT is the G_COUNT'th sample of g */ +typedef struct pvstate_struct { + long f_count; /* how many samples have we taken from f? */ + long g_count; /* how many samples have we taken from g? */ + double g_prev; /* the previous value of g (at g_count - 2) */ + double g_next; /* the current value of g (at g_count - 1) */ + long sample_count; /* how many total samples computed, specifically + * the number of samples copied into Nyquist + * sample blocks via *out++ = pvs->output[index++]; + */ + Phase_vocoder *pv; /* the phase vocoder object */ + sample_type *input; /* a frame of samples to go into fft */ + long input_count; /* sample number of first sample in input */ + sample_type *output; /* output from phase vocoder */ + long output_count; /* since we deliver samples on demand, + output_count keeps track of how much is left in output. + ouput[OUTPUT_SIZE - output_count] is the next sample to deliver */ + int fftsize; /* the length of an fft frame */ + int hopsize; /* the hopsize -- not used */ + int mode; /* the mode -- see cmupv.h */ + /* data to compute logical stop time */ + long t0; /* output sample count of previous frame */ + double g0; /* input time of previous frame center */ + /* data to detect termination */ + long f_terminated; /* set when f terminates */ + long f_terminate_count; /* sample count of f when it terminates */ + long g_terminated; /* set when g terminates */ + long g_terminate_count; /* sample count of g when it terminates */ + /* return values from pv_callback */ + long flags; /* logical stop and terminate flags */ + long logical_stop_count; /* sample count of output logical stop */ + long terminate_count; /* sample count of output terminate time */ +} pvstate_node, *pvstate_type; -/* pv_fetch -- this is an example, but it doesn't really do - * phase vocoding. Instead, it will just multiply f, g, and x - * - * To make things a bit more interesting, we will assume g has - * an arbitrary sample rate with respect to f, and will interpolate. - * - */ -long pv_fetch(pvshell_type susp, - sample_block_values_type out, long *n) +#define OUTPUT_SIZE 256 + +int pv_callback(long out_count, float *samples, int len, void *rock) { + pvshell_type susp = (pvshell_type) rock; + pvstate_type pvs = (pvstate_type) susp->state; + + /* (1) figure out the "time" of the start of next frame */ + double out_time = out_count / susp->f->sr; + /* (2) Map this time via g to an input time for f. */ + /* compute g count that is past the time; at 0th sample, + * pvs->g_count is 1, so we add 1 to g_count to make the loop and + * interpolation math work right */ + double g_count = out_time * susp->g->sr + 1.0; + double g; /* the value of g at g_count which is at the time of out_count */ + long f_start; /* the start sample of input f for the next frame */ + int hop; /* the hopsize from the previous frame to this frame, thus the + offset into input buffer of the data we want to keep */ + int got_from_f; /* samples already in input */ + int needed_from_f; /* samples to get from f this time */ + sample_type *input = pvs->input; int i; - for (i = 0; i < *n; i++) { - long new_flags; - sample_type f; - double g; - /* NOTE: in DSP terms, this is poor code because of the - * division operations -- it could be made faster - */ - /* To get a value from g, first compute the time */ - double f_time = susp->F_COUNT / susp->f->sr; - /* Now compute g count that is past the time */ - double g_count = f_time * susp->g->sr; - while (susp->G_COUNT < g_count) { - PVSHELL_TEST_G(susp); /* prepare to get a sample */ - /* ignore flags from g -- we could, if we wanted, - * terminate when either f or g terminated, etc. - */ - susp->G_PREV = susp->G_NEXT; - susp->G_NEXT = PVSHELL_FETCH_G(susp); - susp->G_COUNT++; - } - /* now interpolate to get the value of g at f_time */ - g = susp->G_PREV + (susp->G_NEXT - susp->G_PREV) * - (g_count - (susp->G_COUNT - 1)); - new_flags = PVSHELL_TEST_F(susp); - susp->flags |= new_flags; - if (new_flags) break; - f = PVSHELL_FETCH_F(susp); - susp->F_COUNT++; /* count how many samples we have taken */ - - /* now we have f, g, x */ - *out++ = f * g * susp->X_VALUE; - } - /* i is the number of samples we acutally computed */ - *n = i; - /* if we computed samples, we want to return them before - * returning flags that say we're done or stopped + int f_logically_stopped = FALSE; + long f_logical_stop_count; + pvs->flags = 0; + /* before loop: + * pvs->g_count <= g_count, + * loop invariant: + * pvs->g_prev == g(pvs->g_count - 2), + * pvs->g_prev == g(pvs->g_count - 1) + * after loop: + * pvs->g_count > g_count + * pvs->g_count <= g_count + 1 */ - return (i ? 0 : susp->flags); + while (pvs->g_count <= g_count) { + long flags = PVSHELL_TEST_G(susp); /* prepare to get a sample */ + if (!pvs->g_terminated && (flags & PVSHELL_FLAG_TERMINATE)) { + pvs->g_terminated = TRUE; + pvs->g_terminate_count = susp->g->current - susp->g_cnt; + } + pvs->g_prev = pvs->g_next; + pvs->g_next = PVSHELL_FETCH_G(susp); + pvs->g_count++; + } + /* fetch frame by mapping with g unless we've gone beyond g's + termination time */ + if (!pvs->g_terminated) { + /* now interpolate to get the value of g at g_count */ + g = pvs->g_prev + (pvs->g_next - pvs->g_prev) * + (g_count - (pvs->g_count - 1)); + /* (3) get the first sample we need from f. */ + /* g is now the sample time we want for center of f window */ + f_start = ROUNDBIG(g * susp->f->sr) - pvs->fftsize / 2; + + /* f_start is now the first sample position of the window */ + /* (4) shift INPUT */ + hop = f_start - pvs->input_count; + if (hop < 0) { + hop = 0; + } + + /* printf("pv_callback f_start %ld hop %d\n", f_start, hop); */ + + got_from_f = pvs->fftsize - hop; + needed_from_f = pvs->fftsize; /* unless we can resuse samples */ + if (hop == 0) { + ; /* nothing to do, the samples are already in input */ + } else if (hop < pvs->fftsize) { + memmove(input, input + hop, + got_from_f * sizeof(sample_type)); + needed_from_f = hop; + } else { /* skip over some samples of f */ + int skip = hop - pvs->fftsize; + int i; + got_from_f = 0; + for (i = 0; i < skip; i++) { + long flags = PVSHELL_TEST_F(susp); + if (flags) { /* normal case is all flags zero, so I think it + is faster to test for either and only if we + know one is set do we test individual flags */ + if (flags | PVSHELL_FLAG_LOGICAL_STOP) { + f_logically_stopped = TRUE; + f_logical_stop_count = susp->f->current - susp->f_cnt; + } + if (flags | PVSHELL_FLAG_TERMINATE && !pvs->f_terminated) { + pvs->f_terminated = TRUE; + pvs->f_terminate_count = susp->f->current - susp->f_cnt; + } + } + PVSHELL_FETCH_F(susp); + } + } + pvs->input_count = f_start; + /* (5) fill the rest of input from f */ + for (i = 0; i < needed_from_f; i++) { + long flags = PVSHELL_TEST_F(susp); + if (!f_logically_stopped && (flags | PVSHELL_FLAG_LOGICAL_STOP)) { + f_logically_stopped = TRUE; + pvs->logical_stop_count = susp->f->current - susp->f_cnt; + } + input[got_from_f++] = PVSHELL_FETCH_F(susp); + } + memmove(samples, input, pvs->fftsize * sizeof(float)); + /* did we terminate? If window is all zeros, we can compute + terminate time */ + if ((!(pvs->flags & PVSHELL_FLAG_TERMINATE)) && pvs->f_terminated && + pvs->f_terminate_count <= f_start) { + /* new window is all zero, so output terminates soon ... */ + pvs->flags |= PVSHELL_FLAG_TERMINATE; + pvs->terminate_count = out_count - hop + pvs->fftsize / 2; + printf("pv_callback terminated by f at %ld\n", pvs->terminate_count); + } + pvs->t0 = out_count; + pvs->g0 = g; + } else { /* g has terminated, so we just fill input with zeros */ + /* hopsize does not matter, so we'll set it to fftsize/8 */ + memset(samples, 0, pvs->fftsize * sizeof(*samples)); + hop = pvs->fftsize / 8; + /* printf("filled samples with 0, hop %d\n", hop); */ + } + /* there are two sources of logical stop: f and g. If f, then + f_logically_stopped is TRUE, and we need to map using g-inverse. + We'll do that first to get a candidate logical stop time. (This + is skipped if g has terminated, because the variable g would not + be defined in that case.) + Then, test if g is terminated. If so, g_terminate_time is the other + candidate logical stop time. If not g_terminated, we do nothing + (letting the mapped f logical stop time stand if applicable). + Otherwise, if g_terminated then { + if f_logically_stopped, take the minimum of the two candidates, + else take the terminate time of g } + (See comments at top of file for more about the computation here.) + */ + if (f_logically_stopped && !pvs->g_terminated) { + pvs->logical_stop_count = pvs->t0 + (out_count - pvs->t0) * + ((f_logical_stop_count / susp->f->sr - pvs->g0) / (g - pvs->g0)); + } + if (pvs->g_terminated) { + long term_cnt_from_g = ROUNDBIG((pvs->g_terminate_count / susp->g->sr) * + susp->f->sr); + if (f_logically_stopped) { /* take min of g and f log. stop cnt */ + pvs->logical_stop_count = MIN(pvs->logical_stop_count, + term_cnt_from_g); + } else { + f_logically_stopped = TRUE; + pvs->logical_stop_count = term_cnt_from_g; + } + /* maybe output has terminated */ + if (pvs->g_terminate_count < out_count + pvs->fftsize / 2) { + if (pvs->flags & PVSHELL_FLAG_TERMINATE) { + pvs->terminate_count = MIN(pvs->terminate_count, + term_cnt_from_g); + } else { + pvs->flags |= PVSHELL_FLAG_TERMINATE; + pvs->terminate_count = term_cnt_from_g; + } + /* printf("pv_callback terminated by g at %ld\n", term_cnt_from_g); */ + } + } + if (f_logically_stopped) { + pvs->flags |= PVSHELL_FLAG_LOGICAL_STOP; + } + + return hop; } -sound_type snd_phasevocoder(sound_type f, sound_type g, double x) +/* pv_fetch -- f is the signal. g is the map from output to input + * + * g has an arbitrary sample rate with respect to f, and will interpolate. + * out is where to put samples, + * n is how many samples to compute (maximum) + * sample_count is how many output samples we have computed + */ +long pv_fetch(pvshell_type susp, + sample_block_values_type out, long *n, + long sample_count) +{ + pvstate_type pvs = (pvstate_type) susp->state; + int i; + int flags = 0; + int count = 0; /* how many samples computed? */ + /* initialize phase vocoder if this is the first call */ + if (pvs->sample_count == 0) { + Phase_vocoder pv = pv_create2(malloc, free, pv_callback, susp); + pv_set_blocksize(pv, OUTPUT_SIZE); + pv_set_fftsize(pv, pvs->fftsize); + pv_set_syn_hopsize(pv, pvs->hopsize); + pv_set_mode(pv, pvs->mode); + pv_initialize(pv); + pvs->pv = pv; + pvs->input = (float *) malloc(pvs->fftsize * sizeof(float)); + pvs->input_count = -pvs->fftsize; /* no valid samples in input yet */ + } + while (count < *n) { + int take = *n - count; /* how many to take from (pv) output */ + int remaining; + int index; + if (pvs->output_count <= 0) { + pvs->output = pv_get_output2(pvs->pv); + pvs->output_count = OUTPUT_SIZE; + } + remaining = pvs->output_count; + /* printf("pv_fetch take %ld remaining %ld\n", take, remaining); */ + if (take > remaining) take = remaining; + if (pvs->flags) { + if (pvs->flags & PVSHELL_FLAG_TERMINATE) { + int to_term = pvs->terminate_count - sample_count; + if (to_term < take) take = to_term; + if (take == 0) { + /* we want to set the terminate flag at the beginning + of the sample block, i.e. only if count == 0; if + there are samples in the block already, we just + return them and we'll set the terminate flag next time + */ + if (count == 0) { + flags |= PVSHELL_FLAG_TERMINATE; + } + } + } + if (pvs->flags & PVSHELL_FLAG_LOGICAL_STOP) { + int to_stop = pvs->logical_stop_count - sample_count; + /* if we're exactly at the logical stop block, then + set the logical stop flag and compute the block as + normal. Otherwise, if we have not reached the logical + stop sample yet (to_stop > 0) and we have room to go + past it (to_stop < take), then take only up to logical + stop sample. + */ + if (to_stop == 0 && count == 0) { + flags |= PVSHELL_FLAG_LOGICAL_STOP; + } else if (to_stop > 0 && to_stop < take) { + take = to_stop; + } + } + } + if (take == 0) break; /* no more samples; we now terminate */ + + index = OUTPUT_SIZE - pvs->output_count; + for (i = 0; i < take; i++) { + *out++ = pvs->output[index++]; + } + count += take; + sample_count += take; + pvs->output_count -= take; + pvs->sample_count += take; + } + *n = count; + /* printf("pv_fetch output_count %ld flags %ld\n", + pvs->sample_count, susp->flags); */ + return flags; +} + + +void pv_free(struct pvshell_struct *susp) +{ + pvstate_type pvs = (pvstate_type) susp->state; + if (pvs->pv) pv_end(pvs->pv); + if (pvs->input) free(pvs->input); +} + + +sound_type snd_phasevocoder(sound_type f, sound_type g, long fftsize, long hopsize, long mode) { /* we're using 5 doubles of state. The first is a parameter, * and the rest are initialized to zero except for state[2], @@ -86,8 +474,26 @@ sound_type snd_phasevocoder(sound_type f, sound_type g, double x) * into the pvshell structure, so we don't need to allocate * a vector on the heap. */ - double state[5] = {0, 0, -1, 0, 0}; - state[0] = x; + long temp; + if (fftsize == -1) + fftsize = 2048; + if (hopsize == -1) + hopsize = fftsize / 8; + pvstate_node state = { + 0 /* f_count */, + 0 /* g_count */, + 0 /* g_prev */, + 0 /* g_next */, + 0 /* sample_count */, + NULL, /* pv */ + NULL, /* input */ + 0, /* input_count */ + NULL, /* output */ + 0, /* output_count */ + fftsize, /* fftsize */ + hopsize, /* hopsize */ + mode }; + /* If f and g do not start at the same time, we should really * should do something about it, but we'll just throw an error. * Be careful to allow small differences (within one sample). @@ -95,8 +501,30 @@ sound_type snd_phasevocoder(sound_type f, sound_type g, double x) if (fabs(f->t0 - g->t0) * f->sr > 0.5) { xlfail("phasevocoder inputs must start at the same time"); } + /* fftsize should be a power of 2, hopsize should be a power of + * 2 smaller than fftsize. + */ + if (fftsize <= 0) { + xlfail("phasevocoder fftsize must be > 0"); + } + /* Test for power of 2. Subtract 1 and a power of 2 will change + * from 0...010...0 to 0...001...1, and the "and" will be zero. + * But a non-power of 2 will go from 0...01?...? to 0...01?...?" + * and the "and" will be non-zero. + */ + temp = fftsize - 1; + if ((temp & fftsize) != 0) { + xlfail("phasevocoder fftsize must be a power of 2"); + } + /* Test that hopsize is a power of 2 smaller than fftsize: */ + temp = fftsize / 2; + while (temp && temp != hopsize) temp >>= 1; + if (!temp) { + xlfail("phasevocoder hopsize must be a power of 2 smaller than fftsize"); + } /* output the same sample rate and start time as f */ - return snd_make_pvshell("snd_phasevocoder", f->sr, f->t0, - &pv_fetch, f, g, - state, sizeof(state) / sizeof(state[0])); + sound_type pv = snd_make_pvshell("snd_phasevocoder", f->sr, f->t0, + &pv_fetch, &pv_free, f, g, + (void *) &state, sizeof(state)); + return pv; } diff --git a/lib-src/libnyquist/nyquist/nyqsrc/phasevocoder.h b/lib-src/libnyquist/nyquist/nyqsrc/phasevocoder.h index 8d941b305..6e564ded9 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/phasevocoder.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/phasevocoder.h @@ -2,5 +2,5 @@ phase vocoder into Nyquist using pvshell */ -sound_type snd_phasevocoder(sound_type f, sound_type g, double x); - /* LISP: (snd-phasevocoder SOUND SOUND ANYNUM) */ +sound_type snd_phasevocoder(sound_type f, sound_type g, long fftsize, long hopsize, long mode); + /* LISP: (snd-phasevocoder SOUND SOUND FIXNUM FIXNUM FIXNUM) */ diff --git a/lib-src/libnyquist/nyquist/nyqsrc/pvshell.c b/lib-src/libnyquist/nyquist/nyqsrc/pvshell.c index 608f10e44..38435c47f 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/pvshell.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/pvshell.c @@ -8,7 +8,7 @@ // from input sounds. // This code is designed for a time-stretching phase vocoder, // but could be used for other purposes. It is derived from -// compose.c, which might have been implmented with this +// compose.c, which might have been implemented with this // skeleton had we started out with this abstraction. #include "stdio.h" @@ -33,7 +33,6 @@ void pvshell_free(); typedef struct pvshell_susp_struct { snd_susp_node susp; - long terminate_cnt; boolean logically_stopped; boolean started; @@ -93,34 +92,15 @@ void pvshell_fetch(snd_susp_type a_susp, snd_list_type snd_list) out_ptr = out->samples; snd_list->block = out; - /* don't run past the f input sample block: */ - /* most fetch routines call susp_check_term_log_samples() here - * but we can't becasue susp_check_term_log_samples() assumes - * that output time progresses at the same rate as input time. - * Here, some time warping might be going on, so this doesn't work. - * It is up to the user to tell us when it is the logical stop - * time and the terminate time. - */ - /* don't run past terminate time */ - // if (susp->terminate_cnt != UNKNOWN && - // susp->terminate_cnt <= susp->susp.current + cnt + togo) { - // togo = susp->terminate_cnt - (susp->susp.current + cnt); - // if (togo == 0) break; - // } - /* don't run past logical stop time */ - // if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) { - // int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt); - // if (to_stop < togo && ((togo = to_stop) == 0)) break; - // } n = max_sample_block_len; // ideally, compute a whole block of samples - flags = (susp->pvshell.h)(&(susp->pvshell), out_ptr, &n); + flags = (susp->pvshell.h)(&(susp->pvshell), out_ptr, &n, susp->susp.current); /* test for termination */ if (flags & PVSHELL_FLAG_TERMINATE) { snd_list_terminate(snd_list); } else { - snd_list->block_len = n; + snd_list->block_len = (short) n; susp->susp.current += n; } /* test for logical stop */ @@ -163,15 +143,14 @@ void pvshell_print_tree(snd_susp_type a_susp, int n) sound_type snd_make_pvshell(char *name, rate_type sr, time_type t0, - h_fn_type h, sound_type f, sound_type g, - double *state, long n) + h_fn_type h, pvs_free_fn_type free_fn, + sound_type f, sound_type g, + void *state, long n) { register pvshell_susp_type susp; - int i; falloc_generic(susp, pvshell_susp_node, "snd_make_pvshell"); susp->susp.fetch = pvshell_fetch; - susp->terminate_cnt = UNKNOWN; /* initialize susp state */ susp->susp.free = pvshell_free; @@ -192,14 +171,12 @@ sound_type snd_make_pvshell(char *name, rate_type sr, time_type t0, susp->pvshell.g_cnt = 0; susp->pvshell.h = h; - + susp->pvshell.free_fn = free_fn; susp->pvshell.flags = 0; /* terminated and logically stopped flags -- these are for the client of pvshell to use */ assert(n <= PVSHELL_STATE_MAX); - for (i = 0; i < n; i++) { - susp->pvshell.state[i] = state[i]; - } + memcpy(susp->pvshell.state, state, n); susp->started = false; return sound_create((snd_susp_type)susp, t0, sr, 1.0); diff --git a/lib-src/libnyquist/nyquist/nyqsrc/pvshell.h b/lib-src/libnyquist/nyquist/nyqsrc/pvshell.h index 95ad05173..5ecd16e7c 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/pvshell.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/pvshell.h @@ -1,7 +1,7 @@ /* pvshell.h -- a generic Nyquist primitive, esp. for phase vocoder */ -/* how many doubles to provide for miscellaneous state info */ -#define PVSHELL_STATE_MAX 8 +/* how many bytes to provide for miscellaneous state info */ +#define PVSHELL_STATE_MAX 256 /* define some bits to return conditions */ #define PVSHELL_FLAG_TERMINATE 4 @@ -27,7 +27,9 @@ struct pvshell_struct; typedef long (*h_fn_type)(struct pvshell_struct *susp, - sample_block_values_type out, long *n); + sample_block_values_type out, long *n, + long sample_count); +typedef void (*pvs_free_fn_type)(struct pvshell_struct *susp); typedef struct pvshell_struct { sound_type f; @@ -41,10 +43,11 @@ typedef struct pvshell_struct { long flags; /* for terminated and logically stopped flags */ // state is extra storage for whatever you like - double state[PVSHELL_STATE_MAX]; + char state[PVSHELL_STATE_MAX]; // h is a function that computes sound from f, g, x, y, state h_fn_type h; + pvs_free_fn_type free_fn; } pvshell_node, *pvshell_type; @@ -70,10 +73,12 @@ typedef struct pvshell_struct { long pvshell_test_f(pvshell_type susp); long pvshell_test_g(pvshell_type susp); #define PVSHELL_TEST_F(susp) ((susp)->f_cnt == 0 ? pvshell_test_f(susp) : 0) -#define PVSHELL_FETCH_F(susp) ((susp)->f_cnt--, (*(susp)->f_ptr++)) +#define PVSHELL_FETCH_F(susp) \ + ((susp)->f->scale * ((susp)->f_cnt--, *((susp)->f_ptr++))) #define PVSHELL_TEST_G(susp) ((susp)->g_cnt == 0 ? pvshell_test_g(susp) : 0) -#define PVSHELL_FETCH_G(susp) ((susp)->g_cnt--, (*(susp)->g_ptr++)) +#define PVSHELL_FETCH_G(susp) \ + ((susp)->g->scale * ((susp)->g_cnt--, *((susp)->g_ptr++))) /* snd_make_pvshell -- create an instance of pvshell. name -- string name of the operation, for debugging & printing @@ -83,10 +88,13 @@ long pvshell_test_g(pvshell_type susp); h -- function that computes samples of output f -- first input sound, e.g. sound to be time-stretched g -- second input sound, e.g. sound to control varying stretch factor - state -- initial state information needed by h - n -- number of doubles in state (< PVSHELL_STATE_MAX) + state -- initial state information needed by h. Declared as void * so + that any struct can be passed in (provided the size is less than + PVSHELL_STATE_MAX bytes) + n -- number of bytes in state (<= PVSHELL_STATE_MAX) */ sound_type snd_make_pvshell(char *name, rate_type sr, time_type t0, - h_fn_type h, sound_type f, sound_type g, - double *state, long n); + h_fn_type h, pvs_free_fn_type free_fn, + sound_type f, sound_type g, + void *state, long n); diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqext.c b/lib-src/libnyquist/nyquist/nyqsrc/seqext.c index 804641a4f..f8165c80e 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/seqext.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/seqext.c @@ -45,39 +45,33 @@ boolean seqp(s) /* xlseq_free gets called by xlisp when the GC frees a seq object. * seq_free is a macro, so here we make it into a function pointer. */ -static void xlseq_free(sequence) -seq_type sequence; +static void xlseq_free(void *sequence) { - seq_free(sequence); + seq_free((seq_type)sequence); } -static void xlseq_print(fptr, sequence) - LVAL fptr; - seq_type sequence; +static void xlseq_print(LVAL fptr, void *sequence) { char s[32]; sprintf(s, "#", sequence); xlputstr(fptr, s); } -static void xlseq_save(fp, sequence) - FILE *fp; - seq_type sequence; +static void xlseq_save(FILE *fp, void *sequence) { errputstr("xlseq_save called\n"); } -static unsigned char *xlseq_restore(fp) - FILE *fp; +static unsigned char *xlseq_restore(FILE *fp) { errputstr("xlseq_restore called\n"); return 0; } -void seqext_init() +void seqext_init(void) { /* printf("localinit called\n"); */ seq_desc = create_desc("SEQ", xlseq_free, xlseq_print, xlseq_save, @@ -86,7 +80,7 @@ void seqext_init() } -void seqext_symbols() +void seqext_symbols(void) { s_seq = xlenter("SEQ"); } diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.c b/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.c index 942409704..5d2cc9345 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfnint.c @@ -1,7 +1,7 @@ /* nyqsrc/seqfnint.c -- interface to cmt/seqdecls.h, * nyqsrc/seqext.h, cmt/seq.h, nyqsrc/seqinterf.h, - * cmt/seqread.h, cmt/seqmread.h, cmt/seqwrite.h, - * cmt/seqmwrite.h */ + * cmt/seqmread.h, cmt/seqmwrite.h, cmt/seqread.h, + * cmt/seqwrite.h */ #ifndef mips #include "stdlib.h" @@ -186,17 +186,15 @@ LVAL xlc_seq_get(void) } -#include "seqread.h" - -/* xlc_seq_read -- interface to C routine seq_read */ +/* xlc_seq_write_smf -- interface to C routine seq_xlwrite_smf */ /**/ -LVAL xlc_seq_read(void) +LVAL xlc_seq_write_smf(void) { seq_type arg1 = getseq(xlgaseq()); - FILE * arg2 = getfile(xlgastream()); + LVAL arg2 = xlgetarg(); xllastarg(); - seq_read(arg1, arg2); + seq_xlwrite_smf(arg1, arg2); return NIL; } @@ -216,6 +214,23 @@ LVAL xlc_seq_read_smf(void) } +#include "seqmwrite.h" + +#include "seqread.h" + +/* xlc_seq_read -- interface to C routine seq_read */ +/**/ +LVAL xlc_seq_read(void) +{ + seq_type arg1 = getseq(xlgaseq()); + FILE * arg2 = getfile(xlgastream()); + + xllastarg(); + seq_read(arg1, arg2); + return NIL; +} + + #include "seqwrite.h" /* xlc_seq_write -- interface to C routine seq_write */ @@ -232,18 +247,3 @@ LVAL xlc_seq_write(void) } -#include "seqmwrite.h" - -/* xlc_seq_write_smf -- interface to C routine seq_write_smf */ -/**/ -LVAL xlc_seq_write_smf(void) -{ - seq_type arg1 = getseq(xlgaseq()); - FILE * arg2 = getfile(xlgastream()); - - xllastarg(); - seq_write_smf(arg1, arg2); - return NIL; -} - - diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfnintdefs.h b/lib-src/libnyquist/nyquist/nyqsrc/seqfnintdefs.h index ba099564a..7114a85b6 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/seqfnintdefs.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfnintdefs.h @@ -7,7 +7,7 @@ extern LVAL xlc_seq_copy(void); extern LVAL xlc_seq_create(void); extern LVAL xlc_seq_next(void); extern LVAL xlc_seq_get(void); -extern LVAL xlc_seq_read(void); -extern LVAL xlc_seq_read_smf(void); -extern LVAL xlc_seq_write(void); extern LVAL xlc_seq_write_smf(void); +extern LVAL xlc_seq_read_smf(void); +extern LVAL xlc_seq_read(void); +extern LVAL xlc_seq_write(void); diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqfnintptrs.h b/lib-src/libnyquist/nyquist/nyqsrc/seqfnintptrs.h index 9defce5e4..ad3072f50 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/seqfnintptrs.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/seqfnintptrs.h @@ -7,7 +7,7 @@ { "SEQ-CREATE", S, xlc_seq_create}, { "SEQ-NEXT", S, xlc_seq_next}, { "SEQ-GET", S, xlc_seq_get}, - { "SEQ-READ", S, xlc_seq_read}, - { "SEQ-READ-SMF", S, xlc_seq_read_smf}, - { "SEQ-WRITE", S, xlc_seq_write}, { "SEQ-WRITE-SMF", S, xlc_seq_write_smf}, + { "SEQ-READ-SMF", S, xlc_seq_read_smf}, + { "SEQ-READ", S, xlc_seq_read}, + { "SEQ-WRITE", S, xlc_seq_write}, diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.c b/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.c index dc886a0b0..5bb617536 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.c @@ -96,3 +96,16 @@ void seq_get(seq_type seq, long *eventtype, long *ntime, long *line, long *chan, } } +/* seq_xlwrite_smf -- invoke seq_write_smf and mark file as closed */ +void seq_xlwrite_smf(seq_type seq, LVAL outfile) +{ + if (streamp(outfile)) { + if (getfile(outfile) == NULL) { + xlfail("file for seq_write_smf not open"); + } + seq_write_smf(seq, getfile(outfile)); + setfile(outfile, NULL); /* mark file as closed */ + } else { + xlerror("seq_write_smf 2nd arg must be a STREAM", outfile); + } +} diff --git a/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.h b/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.h index 590ed84ad..5db091f44 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/seqinterf.h @@ -35,3 +35,6 @@ void seq_get(seq_type seq, long *eventtype, long *time, long *line, long *chan, #define SEQ_BEND 6 /* LISP-SRC: (setf seq-bend-tag 6) */ +void seq_xlwrite_smf(seq_type seq, LVAL outfile); +/* LISP: (SEQ-WRITE-SMF SEQ ANY) */ + diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.c b/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.c index 8abcb63c9..285e3632c 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.c @@ -1,41 +1,42 @@ -/* nyqsrc/sndfnint.c -- interface to nyqsrc/sndfmt.h, - * nylsf/sndfile.h, nyqsrc/sound.h, nyqsrc/add.h, - * nyqsrc/avg.h, nyqsrc/compose.h, nyqsrc/convolve.h, +/* nyqsrc/sndfnint.c -- interface to nylsf/sndfile.h, + * nyqsrc/sound.h, nyqsrc/add.h, nyqsrc/avg.h, + * nyqsrc/compose.h, nyqsrc/convolve.h, * nyqsrc/downsample.h, nyqsrc/fft.h, nyqsrc/inverse.h, - * nyqsrc/multiseq.h, nyqsrc/resamp.h, nyqsrc/resampv.h, - * nyqsrc/samples.h, nyqsrc/sndmax.h, nyqsrc/sndread.h, + * nyqsrc/lpanal.h, nyqsrc/multiseq.h, + * nyqsrc/nyq-osc-server.h, nyqsrc/phasevocoder.h, + * nyqsrc/resamp.h, nyqsrc/resampv.h, nyqsrc/samples.h, + * nyqsrc/sliderdata.h, nyqsrc/sndmax.h, nyqsrc/sndread.h, * nyqsrc/sndseq.h, nyqsrc/sndsliders.h, - * nyqsrc/sliderdata.h, nyqsrc/sndwritepa.h, nyqsrc/yin.h, - * nyqsrc/nyq-osc-server.h, nyqsrc/trigger.h, - * nyqsrc/lpanal.h, nyqsrc/phasevocoder.h, - * nyqsrc/pvshell.h, tran/abs.h, tran/allpoles.h, - * tran/alpass.h, tran/alpasscv.h, tran/alpassvv.h, - * tran/amosc.h, tran/areson.h, tran/aresonvc.h, - * tran/aresoncv.h, tran/aresonvv.h, tran/atone.h, + * nyqsrc/stoponzero.h, nyqsrc/trigger.h, nyqsrc/yin.h, + * tran/abs.h, tran/allpoles.h, tran/alpass.h, + * tran/alpasscv.h, tran/alpassvc.h, tran/alpassvv.h, + * tran/amosc.h, tran/areson.h, tran/aresoncv.h, + * tran/aresonvc.h, tran/aresonvv.h, tran/atone.h, * tran/atonev.h, tran/biquadfilt.h, tran/buzz.h, * tran/chase.h, tran/clip.h, tran/congen.h, * tran/const.h, tran/coterm.h, tran/delaycc.h, * tran/delaycv.h, tran/eqbandvvv.h, tran/exp.h, - * tran/follow.h, tran/fmosc.h, tran/fromobject.h, - * tran/fromarraystream.h, tran/gate.h, tran/ifft.h, - * tran/instrclar.h, tran/instrclarall.h, - * tran/instrclarfreq.h, tran/instrsax.h, + * tran/fmfb.h, tran/fmfbv.h, tran/fmosc.h, + * tran/follow.h, tran/fromarraystream.h, + * tran/fromobject.h, tran/gate.h, tran/ifft.h, + * tran/instrbanded.h, tran/instrbow.h, + * tran/instrbowedfreq.h, tran/instrclar.h, + * tran/instrclarall.h, tran/instrclarfreq.h, + * tran/instrflute.h, tran/instrfluteall.h, + * tran/instrflutefreq.h, tran/instrmandolin.h, + * tran/instrmodalbar.h, tran/instrsax.h, * tran/instrsaxall.h, tran/instrsaxfreq.h, - * tran/integrate.h, tran/log.h, tran/lpreson.h, - * tran/maxv.h, tran/offset.h, tran/oneshot.h, - * tran/osc.h, tran/partial.h, tran/pluck.h, tran/prod.h, - * tran/pwl.h, tran/quantize.h, tran/recip.h, - * tran/reson.h, tran/resonvc.h, tran/resoncv.h, - * tran/resonvv.h, tran/sampler.h, tran/scale.h, - * tran/shape.h, tran/sine.h, tran/siosc.h, tran/slope.h, - * tran/sqrt.h, tran/tapf.h, tran/tapv.h, tran/tone.h, - * tran/tonev.h, tran/upsample.h, tran/white.h, - * tran/stkrev.h, tran/stkpitshift.h, tran/stkchorus.h, - * tran/instrbow.h, tran/instrbowedfreq.h, - * tran/instrbanded.h, tran/instrmandolin.h, - * tran/instrsitar.h, tran/instrmodalbar.h, - * tran/instrflute.h, tran/instrflutefreq.h, - * tran/instrfluteall.h, tran/fmfb.h, tran/fmfbv.h, + * tran/instrsitar.h, tran/integrate.h, tran/log.h, + * tran/lpreson.h, tran/maxv.h, tran/offset.h, + * tran/oneshot.h, tran/osc.h, tran/partial.h, + * tran/pluck.h, tran/prod.h, tran/pwl.h, + * tran/quantize.h, tran/recip.h, tran/reson.h, + * tran/resoncv.h, tran/resonvc.h, tran/resonvv.h, + * tran/sampler.h, tran/scale.h, tran/shape.h, + * tran/sine.h, tran/siosc.h, tran/slope.h, tran/sqrt.h, + * tran/tapf.h, tran/tapv.h, tran/tone.h, tran/tonev.h, + * tran/upsample.h, tran/white.h, tran/stkpitshift.h, + * tran/stkrev.h, tran/stkchorus.h, nyqsrc/sndfmt.h, * nyqsrc/sndwrite.h */ #ifndef mips @@ -54,12 +55,23 @@ extern LVAL s_true; extern LVAL RSLT_sym; -#include "sndfmt.h" - #include "sndfile.h" #include "sound.h" +/* xlc_snd_set_max_audio_mem -- interface to C routine snd_set_max_audio_mem */ +/**/ +LVAL xlc_snd_set_max_audio_mem(void) +{ + long arg1 = getfixnum(xlgafixnum()); + long result; + + xllastarg(); + result = snd_set_max_audio_mem(arg1); + return cvfixnum(result); +} + + /* xlc_snd_set_latency -- interface to C routine snd_set_latency */ /**/ LVAL xlc_snd_set_latency(void) @@ -468,6 +480,22 @@ LVAL xlc_snd_inverse(void) } +#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 "multiseq.h" /* xlc_snd_multiseq -- interface to C routine snd_make_multiseq */ @@ -484,6 +512,27 @@ LVAL xlc_snd_multiseq(void) } +#include "nyq-osc-server.h" + +#include "phasevocoder.h" + +/* xlc_snd_phasevocoder -- interface to C routine snd_phasevocoder */ +/**/ +LVAL xlc_snd_phasevocoder(void) +{ + sound_type arg1 = getsound(xlgasound()); + sound_type arg2 = getsound(xlgasound()); + long arg3 = getfixnum(xlgafixnum()); + long arg4 = getfixnum(xlgafixnum()); + long arg5 = getfixnum(xlgafixnum()); + sound_type result; + + xllastarg(); + result = snd_phasevocoder(arg1, arg2, arg3, arg4, arg5); + return cvsound(result); +} + + #include "resamp.h" /* xlc_snd_resample -- interface to C routine snd_resample */ @@ -603,6 +652,8 @@ LVAL xlc_snd_fetch_array(void) } +#include "sliderdata.h" + #include "sndmax.h" /* xlc_snd_max -- interface to C routine sound_max */ @@ -701,9 +752,36 @@ LVAL xlc_snd_slider(void) } -#include "sliderdata.h" +#include "stoponzero.h" + +/* xlc_snd_stoponzero -- interface to C routine snd_stoponzero */ +/**/ +LVAL xlc_snd_stoponzero(void) +{ + sound_type arg1 = getsound(xlgasound()); + sound_type result; + + xllastarg(); + result = snd_stoponzero(arg1); + return cvsound(result); +} + + +#include "trigger.h" + +/* xlc_snd_trigger -- interface to C routine snd_trigger */ +/**/ +LVAL xlc_snd_trigger(void) +{ + sound_type arg1 = getsound(xlgasound()); + LVAL arg2 = xlgetarg(); + sound_type result; + + xllastarg(); + result = snd_trigger(arg1, arg2); + return cvsound(result); +} -#include "sndwritepa.h" #include "yin.h" @@ -723,59 +801,6 @@ LVAL xlc_snd_yin(void) } -#include "nyq-osc-server.h" - -#include "trigger.h" - -/* xlc_snd_trigger -- interface to C routine snd_trigger */ -/**/ -LVAL xlc_snd_trigger(void) -{ - sound_type arg1 = getsound(xlgasound()); - LVAL arg2 = xlgetarg(); - sound_type result; - - xllastarg(); - result = snd_trigger(arg1, arg2); - return cvsound(result); -} - - -#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 "phasevocoder.h" - -/* xlc_snd_phasevocoder -- interface to C routine snd_phasevocoder */ -/**/ -LVAL xlc_snd_phasevocoder(void) -{ - sound_type arg1 = getsound(xlgasound()); - sound_type arg2 = getsound(xlgasound()); - double arg3 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_phasevocoder(arg1, arg2, arg3); - return cvsound(result); -} - - -#include "pvshell.h" - #include "abs.h" /* xlc_snd_abs -- interface to C routine snd_abs */ @@ -842,6 +867,24 @@ LVAL xlc_snd_alpasscv(void) } +#include "alpassvc.h" + +/* xlc_snd_alpassvc -- interface to C routine snd_alpassvc */ +/**/ +LVAL xlc_snd_alpassvc(void) +{ + sound_type arg1 = getsound(xlgasound()); + sound_type arg2 = getsound(xlgasound()); + double arg3 = testarg2(xlgaanynum()); + double arg4 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_alpassvc(arg1, arg2, arg3, arg4); + return cvsound(result); +} + + #include "alpassvv.h" /* xlc_snd_alpassvv -- interface to C routine snd_alpassvv */ @@ -899,24 +942,6 @@ LVAL xlc_snd_areson(void) } -#include "aresonvc.h" - -/* xlc_snd_aresonvc -- interface to C routine snd_aresonvc */ -/**/ -LVAL xlc_snd_aresonvc(void) -{ - sound_type arg1 = getsound(xlgasound()); - sound_type arg2 = getsound(xlgasound()); - double arg3 = testarg2(xlgaanynum()); - long arg4 = getfixnum(xlgafixnum()); - sound_type result; - - xllastarg(); - result = snd_aresonvc(arg1, arg2, arg3, arg4); - return cvsound(result); -} - - #include "aresoncv.h" /* xlc_snd_aresoncv -- interface to C routine snd_aresoncv */ @@ -935,6 +960,24 @@ LVAL xlc_snd_aresoncv(void) } +#include "aresonvc.h" + +/* xlc_snd_aresonvc -- interface to C routine snd_aresonvc */ +/**/ +LVAL xlc_snd_aresonvc(void) +{ + sound_type arg1 = getsound(xlgasound()); + sound_type arg2 = getsound(xlgasound()); + double arg3 = testarg2(xlgaanynum()); + long arg4 = getfixnum(xlgafixnum()); + sound_type result; + + xllastarg(); + result = snd_aresonvc(arg1, arg2, arg3, arg4); + return cvsound(result); +} + + #include "aresonvv.h" /* xlc_snd_aresonvv -- interface to C routine snd_aresonvv */ @@ -1177,21 +1220,39 @@ LVAL xlc_snd_exp(void) } -#include "follow.h" +#include "fmfb.h" -/* xlc_snd_follow -- interface to C routine snd_follow */ +/* xlc_snd_fmfb -- interface to C routine snd_fmfb */ /**/ -LVAL xlc_snd_follow(void) +LVAL xlc_snd_fmfb(void) { - sound_type arg1 = getsound(xlgasound()); + double arg1 = testarg2(xlgaanynum()); double arg2 = testarg2(xlgaanynum()); double arg3 = testarg2(xlgaanynum()); double arg4 = testarg2(xlgaanynum()); - long arg5 = getfixnum(xlgafixnum()); + double arg5 = testarg2(xlgaanynum()); sound_type result; xllastarg(); - result = snd_follow(arg1, arg2, arg3, arg4, arg5); + result = snd_fmfb(arg1, arg2, arg3, arg4, arg5); + return cvsound(result); +} + + +#include "fmfbv.h" + +/* xlc_snd_fmfbv -- interface to C routine snd_fmfbv */ +/**/ +LVAL xlc_snd_fmfbv(void) +{ + double arg1 = testarg2(xlgaanynum()); + double arg2 = testarg2(xlgaanynum()); + double arg3 = testarg2(xlgaanynum()); + sound_type arg4 = getsound(xlgasound()); + sound_type result; + + xllastarg(); + result = snd_fmfbv(arg1, arg2, arg3, arg4); return cvsound(result); } @@ -1217,19 +1278,21 @@ LVAL xlc_snd_fmosc(void) } -#include "fromobject.h" +#include "follow.h" -/* xlc_snd_fromobject -- interface to C routine snd_fromobject */ +/* xlc_snd_follow -- interface to C routine snd_follow */ /**/ -LVAL xlc_snd_fromobject(void) +LVAL xlc_snd_follow(void) { - double arg1 = testarg2(xlgaanynum()); + sound_type arg1 = getsound(xlgasound()); double arg2 = testarg2(xlgaanynum()); - LVAL arg3 = xlgetarg(); + double arg3 = testarg2(xlgaanynum()); + double arg4 = testarg2(xlgaanynum()); + long arg5 = getfixnum(xlgafixnum()); sound_type result; xllastarg(); - result = snd_fromobject(arg1, arg2, arg3); + result = snd_follow(arg1, arg2, arg3, arg4, arg5); return cvsound(result); } @@ -1251,6 +1314,23 @@ LVAL xlc_snd_fromarraystream(void) } +#include "fromobject.h" + +/* xlc_snd_fromobject -- interface to C routine snd_fromobject */ +/**/ +LVAL xlc_snd_fromobject(void) +{ + double arg1 = testarg2(xlgaanynum()); + double arg2 = testarg2(xlgaanynum()); + LVAL arg3 = xlgetarg(); + sound_type result; + + xllastarg(); + result = snd_fromobject(arg1, arg2, arg3); + return cvsound(result); +} + + #include "gate.h" /* xlc_snd_gate -- interface to C routine snd_gate */ @@ -1290,6 +1370,59 @@ LVAL xlc_snd_ifft(void) } +#include "instrbanded.h" + +/* xlc_snd_bandedwg -- interface to C routine snd_bandedwg */ +/**/ +LVAL xlc_snd_bandedwg(void) +{ + double arg1 = testarg2(xlgaanynum()); + sound_type arg2 = getsound(xlgasound()); + long arg3 = getfixnum(xlgafixnum()); + double arg4 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_bandedwg(arg1, arg2, arg3, arg4); + return cvsound(result); +} + + +#include "instrbow.h" + +/* xlc_snd_bowed -- interface to C routine snd_bowed */ +/**/ +LVAL xlc_snd_bowed(void) +{ + double arg1 = testarg2(xlgaanynum()); + sound_type arg2 = getsound(xlgasound()); + double arg3 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_bowed(arg1, arg2, arg3); + return cvsound(result); +} + + +#include "instrbowedfreq.h" + +/* xlc_snd_bowed_freq -- interface to C routine snd_bowed_freq */ +/**/ +LVAL xlc_snd_bowed_freq(void) +{ + double arg1 = testarg2(xlgaanynum()); + sound_type arg2 = getsound(xlgasound()); + sound_type arg3 = getsound(xlgasound()); + double arg4 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_bowed_freq(arg1, arg2, arg3, arg4); + return cvsound(result); +} + + #include "instrclar.h" /* xlc_snd_clarinet -- interface to C routine snd_clarinet */ @@ -1347,6 +1480,102 @@ LVAL xlc_snd_clarinet_freq(void) } +#include "instrflute.h" + +/* xlc_snd_flute -- interface to C routine snd_flute */ +/**/ +LVAL xlc_snd_flute(void) +{ + double arg1 = testarg2(xlgaanynum()); + sound_type arg2 = getsound(xlgasound()); + double arg3 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_flute(arg1, arg2, arg3); + return cvsound(result); +} + + +#include "instrfluteall.h" + +/* xlc_snd_flute_all -- interface to C routine snd_flute_all */ +/**/ +LVAL xlc_snd_flute_all(void) +{ + double arg1 = testarg2(xlgaanynum()); + sound_type arg2 = getsound(xlgasound()); + sound_type arg3 = getsound(xlgasound()); + double arg4 = testarg2(xlgaanynum()); + double arg5 = testarg2(xlgaanynum()); + sound_type arg6 = getsound(xlgasound()); + sound_type arg7 = getsound(xlgasound()); + double arg8 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_flute_all(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + return cvsound(result); +} + + +#include "instrflutefreq.h" + +/* xlc_snd_flute_freq -- interface to C routine snd_flute_freq */ +/**/ +LVAL xlc_snd_flute_freq(void) +{ + double arg1 = testarg2(xlgaanynum()); + sound_type arg2 = getsound(xlgasound()); + sound_type arg3 = getsound(xlgasound()); + double arg4 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_flute_freq(arg1, arg2, arg3, arg4); + return cvsound(result); +} + + +#include "instrmandolin.h" + +/* xlc_snd_mandolin -- interface to C routine snd_mandolin */ +/**/ +LVAL xlc_snd_mandolin(void) +{ + double arg1 = testarg2(xlgaanynum()); + double arg2 = testarg2(xlgaanynum()); + double arg3 = testarg2(xlgaanynum()); + double arg4 = testarg2(xlgaanynum()); + double arg5 = testarg2(xlgaanynum()); + double arg6 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_mandolin(arg1, arg2, arg3, arg4, arg5, arg6); + return cvsound(result); +} + + +#include "instrmodalbar.h" + +/* xlc_snd_modalbar -- interface to C routine snd_modalbar */ +/**/ +LVAL xlc_snd_modalbar(void) +{ + double arg1 = testarg2(xlgaanynum()); + double arg2 = testarg2(xlgaanynum()); + long arg3 = getfixnum(xlgafixnum()); + double arg4 = testarg2(xlgaanynum()); + double arg5 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_modalbar(arg1, arg2, arg3, arg4, arg5); + return cvsound(result); +} + + #include "instrsax.h" /* xlc_snd_sax -- interface to C routine snd_sax */ @@ -1406,6 +1635,24 @@ LVAL xlc_snd_sax_freq(void) } +#include "instrsitar.h" + +/* xlc_snd_sitar -- interface to C routine snd_sitar */ +/**/ +LVAL xlc_snd_sitar(void) +{ + double arg1 = testarg2(xlgaanynum()); + double arg2 = testarg2(xlgaanynum()); + double arg3 = testarg2(xlgaanynum()); + double arg4 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_sitar(arg1, arg2, arg3, arg4); + return cvsound(result); +} + + #include "integrate.h" /* xlc_snd_integrate -- interface to C routine snd_integrate */ @@ -1641,24 +1888,6 @@ LVAL xlc_snd_reson(void) } -#include "resonvc.h" - -/* xlc_snd_resonvc -- interface to C routine snd_resonvc */ -/**/ -LVAL xlc_snd_resonvc(void) -{ - sound_type arg1 = getsound(xlgasound()); - sound_type arg2 = getsound(xlgasound()); - double arg3 = testarg2(xlgaanynum()); - long arg4 = getfixnum(xlgafixnum()); - sound_type result; - - xllastarg(); - result = snd_resonvc(arg1, arg2, arg3, arg4); - return cvsound(result); -} - - #include "resoncv.h" /* xlc_snd_resoncv -- interface to C routine snd_resoncv */ @@ -1677,6 +1906,24 @@ LVAL xlc_snd_resoncv(void) } +#include "resonvc.h" + +/* xlc_snd_resonvc -- interface to C routine snd_resonvc */ +/**/ +LVAL xlc_snd_resonvc(void) +{ + sound_type arg1 = getsound(xlgasound()); + sound_type arg2 = getsound(xlgasound()); + double arg3 = testarg2(xlgaanynum()); + long arg4 = getfixnum(xlgafixnum()); + sound_type result; + + xllastarg(); + result = snd_resonvc(arg1, arg2, arg3, arg4); + return cvsound(result); +} + + #include "resonvv.h" /* xlc_snd_resonvv -- interface to C routine snd_resonvv */ @@ -1917,6 +2164,23 @@ LVAL xlc_snd_white(void) } +#include "stkpitshift.h" + +/* xlc_snd_stkpitshift -- interface to C routine snd_stkpitshift */ +/**/ +LVAL xlc_snd_stkpitshift(void) +{ + sound_type arg1 = getsound(xlgasound()); + double arg2 = testarg2(xlgaanynum()); + double arg3 = testarg2(xlgaanynum()); + sound_type result; + + xllastarg(); + result = snd_stkpitshift(arg1, arg2, arg3); + return cvsound(result); +} + + #include "stkrev.h" /* xlc_snd_stkrev -- interface to C routine snd_stkrev */ @@ -1935,23 +2199,6 @@ LVAL xlc_snd_stkrev(void) } -#include "stkpitshift.h" - -/* xlc_snd_stkpitshift -- interface to C routine snd_stkpitshift */ -/**/ -LVAL xlc_snd_stkpitshift(void) -{ - sound_type arg1 = getsound(xlgasound()); - double arg2 = testarg2(xlgaanynum()); - double arg3 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_stkpitshift(arg1, arg2, arg3); - return cvsound(result); -} - - #include "stkchorus.h" /* xlc_snd_stkchorus -- interface to C routine snd_stkchorus */ @@ -1971,209 +2218,7 @@ LVAL xlc_snd_stkchorus(void) } -#include "instrbow.h" - -/* xlc_snd_bowed -- interface to C routine snd_bowed */ -/**/ -LVAL xlc_snd_bowed(void) -{ - double arg1 = testarg2(xlgaanynum()); - sound_type arg2 = getsound(xlgasound()); - double arg3 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_bowed(arg1, arg2, arg3); - return cvsound(result); -} - - -#include "instrbowedfreq.h" - -/* xlc_snd_bowed_freq -- interface to C routine snd_bowed_freq */ -/**/ -LVAL xlc_snd_bowed_freq(void) -{ - double arg1 = testarg2(xlgaanynum()); - sound_type arg2 = getsound(xlgasound()); - sound_type arg3 = getsound(xlgasound()); - double arg4 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_bowed_freq(arg1, arg2, arg3, arg4); - return cvsound(result); -} - - -#include "instrbanded.h" - -/* xlc_snd_bandedwg -- interface to C routine snd_bandedwg */ -/**/ -LVAL xlc_snd_bandedwg(void) -{ - double arg1 = testarg2(xlgaanynum()); - sound_type arg2 = getsound(xlgasound()); - long arg3 = getfixnum(xlgafixnum()); - double arg4 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_bandedwg(arg1, arg2, arg3, arg4); - return cvsound(result); -} - - -#include "instrmandolin.h" - -/* xlc_snd_mandolin -- interface to C routine snd_mandolin */ -/**/ -LVAL xlc_snd_mandolin(void) -{ - double arg1 = testarg2(xlgaanynum()); - double arg2 = testarg2(xlgaanynum()); - double arg3 = testarg2(xlgaanynum()); - double arg4 = testarg2(xlgaanynum()); - double arg5 = testarg2(xlgaanynum()); - double arg6 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_mandolin(arg1, arg2, arg3, arg4, arg5, arg6); - return cvsound(result); -} - - -#include "instrsitar.h" - -/* xlc_snd_sitar -- interface to C routine snd_sitar */ -/**/ -LVAL xlc_snd_sitar(void) -{ - double arg1 = testarg2(xlgaanynum()); - double arg2 = testarg2(xlgaanynum()); - double arg3 = testarg2(xlgaanynum()); - double arg4 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_sitar(arg1, arg2, arg3, arg4); - return cvsound(result); -} - - -#include "instrmodalbar.h" - -/* xlc_snd_modalbar -- interface to C routine snd_modalbar */ -/**/ -LVAL xlc_snd_modalbar(void) -{ - double arg1 = testarg2(xlgaanynum()); - double arg2 = testarg2(xlgaanynum()); - long arg3 = getfixnum(xlgafixnum()); - double arg4 = testarg2(xlgaanynum()); - double arg5 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_modalbar(arg1, arg2, arg3, arg4, arg5); - return cvsound(result); -} - - -#include "instrflute.h" - -/* xlc_snd_flute -- interface to C routine snd_flute */ -/**/ -LVAL xlc_snd_flute(void) -{ - double arg1 = testarg2(xlgaanynum()); - sound_type arg2 = getsound(xlgasound()); - double arg3 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_flute(arg1, arg2, arg3); - return cvsound(result); -} - - -#include "instrflutefreq.h" - -/* xlc_snd_flute_freq -- interface to C routine snd_flute_freq */ -/**/ -LVAL xlc_snd_flute_freq(void) -{ - double arg1 = testarg2(xlgaanynum()); - sound_type arg2 = getsound(xlgasound()); - sound_type arg3 = getsound(xlgasound()); - double arg4 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_flute_freq(arg1, arg2, arg3, arg4); - return cvsound(result); -} - - -#include "instrfluteall.h" - -/* xlc_snd_flute_all -- interface to C routine snd_flute_all */ -/**/ -LVAL xlc_snd_flute_all(void) -{ - double arg1 = testarg2(xlgaanynum()); - sound_type arg2 = getsound(xlgasound()); - sound_type arg3 = getsound(xlgasound()); - double arg4 = testarg2(xlgaanynum()); - double arg5 = testarg2(xlgaanynum()); - sound_type arg6 = getsound(xlgasound()); - sound_type arg7 = getsound(xlgasound()); - double arg8 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_flute_all(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); - return cvsound(result); -} - - -#include "fmfb.h" - -/* xlc_snd_fmfb -- interface to C routine snd_fmfb */ -/**/ -LVAL xlc_snd_fmfb(void) -{ - double arg1 = testarg2(xlgaanynum()); - double arg2 = testarg2(xlgaanynum()); - double arg3 = testarg2(xlgaanynum()); - double arg4 = testarg2(xlgaanynum()); - double arg5 = testarg2(xlgaanynum()); - sound_type result; - - xllastarg(); - result = snd_fmfb(arg1, arg2, arg3, arg4, arg5); - return cvsound(result); -} - - -#include "fmfbv.h" - -/* xlc_snd_fmfbv -- interface to C routine snd_fmfbv */ -/**/ -LVAL xlc_snd_fmfbv(void) -{ - double arg1 = testarg2(xlgaanynum()); - double arg2 = testarg2(xlgaanynum()); - double arg3 = testarg2(xlgaanynum()); - sound_type arg4 = getsound(xlgasound()); - sound_type result; - - xllastarg(); - result = snd_fmfbv(arg1, arg2, arg3, arg4); - return cvsound(result); -} - +#include "sndfmt.h" #include "sndwrite.h" diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.lsp b/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.lsp index 3194cedb9..c3354bf37 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.lsp +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfnint.lsp @@ -1,3 +1,9 @@ + (SETF MAX-STOP-TIME 10E20) + + (SETF MIN-START-TIME -10E20) + + (setf OP-AVERAGE 1) (setf OP-PEAK 2) + (setf snd-head-none 0) (setf snd-head-AIFF 1) @@ -82,9 +88,3 @@ (setf snd-mode-vorbis 11) - (SETF MAX-STOP-TIME 10E20) - - (SETF MIN-START-TIME -10E20) - - (setf OP-AVERAGE 1) (setf OP-PEAK 2) - diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfnintdefs.h b/lib-src/libnyquist/nyquist/nyqsrc/sndfnintdefs.h index 0119c12b1..be67d8824 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndfnintdefs.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfnintdefs.h @@ -1,3 +1,4 @@ +extern LVAL xlc_snd_set_max_audio_mem(void); extern LVAL xlc_snd_set_latency(void); extern LVAL xlc_soundp(void); extern LVAL xlc_hz_to_step(void); @@ -27,7 +28,9 @@ extern LVAL xlc_snd_convolve(void); extern LVAL xlc_snd_down(void); extern LVAL xlc_snd_fft(void); extern LVAL xlc_snd_inverse(void); +extern LVAL xlc_snd_lpanal(void); extern LVAL xlc_snd_multiseq(void); +extern LVAL xlc_snd_phasevocoder(void); extern LVAL xlc_snd_resample(void); extern LVAL xlc_snd_resamplev(void); extern LVAL xlc_snd_from_array(void); @@ -40,19 +43,19 @@ extern LVAL xlc_snd_max(void); extern LVAL xlc_snd_read(void); extern LVAL xlc_snd_seq(void); extern LVAL xlc_snd_slider(void); -extern LVAL xlc_snd_yin(void); +extern LVAL xlc_snd_stoponzero(void); extern LVAL xlc_snd_trigger(void); -extern LVAL xlc_snd_lpanal(void); -extern LVAL xlc_snd_phasevocoder(void); +extern LVAL xlc_snd_yin(void); extern LVAL xlc_snd_abs(void); extern LVAL xlc_snd_allpoles(void); extern LVAL xlc_snd_alpass(void); extern LVAL xlc_snd_alpasscv(void); +extern LVAL xlc_snd_alpassvc(void); extern LVAL xlc_snd_alpassvv(void); extern LVAL xlc_snd_amosc(void); extern LVAL xlc_snd_areson(void); -extern LVAL xlc_snd_aresonvc(void); extern LVAL xlc_snd_aresoncv(void); +extern LVAL xlc_snd_aresonvc(void); extern LVAL xlc_snd_aresonvv(void); extern LVAL xlc_snd_atone(void); extern LVAL xlc_snd_atonev(void); @@ -67,18 +70,29 @@ extern LVAL xlc_snd_delay(void); extern LVAL xlc_snd_delaycv(void); extern LVAL xlc_snd_eqbandvvv(void); extern LVAL xlc_snd_exp(void); -extern LVAL xlc_snd_follow(void); +extern LVAL xlc_snd_fmfb(void); +extern LVAL xlc_snd_fmfbv(void); extern LVAL xlc_snd_fmosc(void); -extern LVAL xlc_snd_fromobject(void); +extern LVAL xlc_snd_follow(void); extern LVAL xlc_snd_fromarraystream(void); +extern LVAL xlc_snd_fromobject(void); extern LVAL xlc_snd_gate(void); extern LVAL xlc_snd_ifft(void); +extern LVAL xlc_snd_bandedwg(void); +extern LVAL xlc_snd_bowed(void); +extern LVAL xlc_snd_bowed_freq(void); extern LVAL xlc_snd_clarinet(void); extern LVAL xlc_snd_clarinet_all(void); extern LVAL xlc_snd_clarinet_freq(void); +extern LVAL xlc_snd_flute(void); +extern LVAL xlc_snd_flute_all(void); +extern LVAL xlc_snd_flute_freq(void); +extern LVAL xlc_snd_mandolin(void); +extern LVAL xlc_snd_modalbar(void); extern LVAL xlc_snd_sax(void); extern LVAL xlc_snd_sax_all(void); extern LVAL xlc_snd_sax_freq(void); +extern LVAL xlc_snd_sitar(void); extern LVAL xlc_snd_integrate(void); extern LVAL xlc_snd_log(void); extern LVAL xlc_snd_lpreson(void); @@ -93,8 +107,8 @@ extern LVAL xlc_snd_pwl(void); extern LVAL xlc_snd_quantize(void); extern LVAL xlc_snd_recip(void); extern LVAL xlc_snd_reson(void); -extern LVAL xlc_snd_resonvc(void); extern LVAL xlc_snd_resoncv(void); +extern LVAL xlc_snd_resonvc(void); extern LVAL xlc_snd_resonvv(void); extern LVAL xlc_snd_sampler(void); extern LVAL xlc_snd_normalize(void); @@ -109,19 +123,8 @@ extern LVAL xlc_snd_tone(void); extern LVAL xlc_snd_tonev(void); extern LVAL xlc_snd_up(void); extern LVAL xlc_snd_white(void); -extern LVAL xlc_snd_stkrev(void); extern LVAL xlc_snd_stkpitshift(void); +extern LVAL xlc_snd_stkrev(void); extern LVAL xlc_snd_stkchorus(void); -extern LVAL xlc_snd_bowed(void); -extern LVAL xlc_snd_bowed_freq(void); -extern LVAL xlc_snd_bandedwg(void); -extern LVAL xlc_snd_mandolin(void); -extern LVAL xlc_snd_sitar(void); -extern LVAL xlc_snd_modalbar(void); -extern LVAL xlc_snd_flute(void); -extern LVAL xlc_snd_flute_freq(void); -extern LVAL xlc_snd_flute_all(void); -extern LVAL xlc_snd_fmfb(void); -extern LVAL xlc_snd_fmfbv(void); extern LVAL xlc_snd_save(void); extern LVAL xlc_snd_overwrite(void); diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndfnintptrs.h b/lib-src/libnyquist/nyquist/nyqsrc/sndfnintptrs.h index 76d5aaa16..c4b9fb2f9 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndfnintptrs.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndfnintptrs.h @@ -1,3 +1,4 @@ + { "SND-SET-MAX-AUDIO-MEM", S, xlc_snd_set_max_audio_mem}, { "SND-SET-LATENCY", S, xlc_snd_set_latency}, { "SOUNDP", S, xlc_soundp}, { "HZ-TO-STEP", S, xlc_hz_to_step}, @@ -27,7 +28,9 @@ { "SND-DOWN", S, xlc_snd_down}, { "SND-FFT", S, xlc_snd_fft}, { "SND-INVERSE", S, xlc_snd_inverse}, + { "SND-LPANAL", S, xlc_snd_lpanal}, { "SND-MULTISEQ", S, xlc_snd_multiseq}, + { "SND-PHASEVOCODER", S, xlc_snd_phasevocoder}, { "SND-RESAMPLE", S, xlc_snd_resample}, { "SND-RESAMPLEV", S, xlc_snd_resamplev}, { "SND-FROM-ARRAY", S, xlc_snd_from_array}, @@ -40,19 +43,19 @@ { "SND-READ", S, xlc_snd_read}, { "SND-SEQ", S, xlc_snd_seq}, { "SND-SLIDER", S, xlc_snd_slider}, - { "SND-YIN", S, xlc_snd_yin}, + { "SND-STOPONZERO", S, xlc_snd_stoponzero}, { "SND-TRIGGER", S, xlc_snd_trigger}, - { "SND-LPANAL", S, xlc_snd_lpanal}, - { "SND-PHASEVOCODER", S, xlc_snd_phasevocoder}, + { "SND-YIN", S, xlc_snd_yin}, { "SND-ABS", S, xlc_snd_abs}, { "SND-ALLPOLES", S, xlc_snd_allpoles}, { "SND-ALPASS", S, xlc_snd_alpass}, { "SND-ALPASSCV", S, xlc_snd_alpasscv}, + { "SND-ALPASSVC", S, xlc_snd_alpassvc}, { "SND-ALPASSVV", S, xlc_snd_alpassvv}, { "SND-AMOSC", S, xlc_snd_amosc}, { "SND-ARESON", S, xlc_snd_areson}, - { "SND-ARESONVC", S, xlc_snd_aresonvc}, { "SND-ARESONCV", S, xlc_snd_aresoncv}, + { "SND-ARESONVC", S, xlc_snd_aresonvc}, { "SND-ARESONVV", S, xlc_snd_aresonvv}, { "SND-ATONE", S, xlc_snd_atone}, { "SND-ATONEV", S, xlc_snd_atonev}, @@ -67,18 +70,29 @@ { "SND-DELAYCV", S, xlc_snd_delaycv}, { "SND-EQBANDVVV", S, xlc_snd_eqbandvvv}, { "SND-EXP", S, xlc_snd_exp}, - { "SND-FOLLOW", S, xlc_snd_follow}, + { "SND-FMFB", S, xlc_snd_fmfb}, + { "SND-FMFBV", S, xlc_snd_fmfbv}, { "SND-FMOSC", S, xlc_snd_fmosc}, - { "SND-FROMOBJECT", S, xlc_snd_fromobject}, + { "SND-FOLLOW", S, xlc_snd_follow}, { "SND-FROMARRAYSTREAM", S, xlc_snd_fromarraystream}, + { "SND-FROMOBJECT", S, xlc_snd_fromobject}, { "SND-GATE", S, xlc_snd_gate}, { "SND-IFFT", S, xlc_snd_ifft}, + { "SND-BANDEDWG", S, xlc_snd_bandedwg}, + { "SND-BOWED", S, xlc_snd_bowed}, + { "SND-BOWED_FREQ", S, xlc_snd_bowed_freq}, { "SND-CLARINET", S, xlc_snd_clarinet}, { "SND-CLARINET_ALL", S, xlc_snd_clarinet_all}, { "SND-CLARINET_FREQ", S, xlc_snd_clarinet_freq}, + { "SND-FLUTE", S, xlc_snd_flute}, + { "SND-FLUTE_ALL", S, xlc_snd_flute_all}, + { "SND-FLUTE_FREQ", S, xlc_snd_flute_freq}, + { "SND-MANDOLIN", S, xlc_snd_mandolin}, + { "SND-MODALBAR", S, xlc_snd_modalbar}, { "SND-SAX", S, xlc_snd_sax}, { "SND-SAX_ALL", S, xlc_snd_sax_all}, { "SND-SAX_FREQ", S, xlc_snd_sax_freq}, + { "SND-SITAR", S, xlc_snd_sitar}, { "SND-INTEGRATE", S, xlc_snd_integrate}, { "SND-LOG", S, xlc_snd_log}, { "SND-LPRESON", S, xlc_snd_lpreson}, @@ -93,8 +107,8 @@ { "SND-QUANTIZE", S, xlc_snd_quantize}, { "SND-RECIP", S, xlc_snd_recip}, { "SND-RESON", S, xlc_snd_reson}, - { "SND-RESONVC", S, xlc_snd_resonvc}, { "SND-RESONCV", S, xlc_snd_resoncv}, + { "SND-RESONVC", S, xlc_snd_resonvc}, { "SND-RESONVV", S, xlc_snd_resonvv}, { "SND-SAMPLER", S, xlc_snd_sampler}, { "SND-NORMALIZE", S, xlc_snd_normalize}, @@ -109,19 +123,8 @@ { "SND-TONEV", S, xlc_snd_tonev}, { "SND-UP", S, xlc_snd_up}, { "SND-WHITE", S, xlc_snd_white}, - { "SND-STKREV", S, xlc_snd_stkrev}, { "SND-STKPITSHIFT", S, xlc_snd_stkpitshift}, + { "SND-STKREV", S, xlc_snd_stkrev}, { "SND-STKCHORUS", S, xlc_snd_stkchorus}, - { "SND-BOWED", S, xlc_snd_bowed}, - { "SND-BOWED_FREQ", S, xlc_snd_bowed_freq}, - { "SND-BANDEDWG", S, xlc_snd_bandedwg}, - { "SND-MANDOLIN", S, xlc_snd_mandolin}, - { "SND-SITAR", S, xlc_snd_sitar}, - { "SND-MODALBAR", S, xlc_snd_modalbar}, - { "SND-FLUTE", S, xlc_snd_flute}, - { "SND-FLUTE_FREQ", S, xlc_snd_flute_freq}, - { "SND-FLUTE_ALL", S, xlc_snd_flute_all}, - { "SND-FMFB", S, xlc_snd_fmfb}, - { "SND-FMFBV", S, xlc_snd_fmfbv}, { "SND-SAVE", S, xlc_snd_save}, { "SND-OVERWRITE", S, xlc_snd_overwrite}, diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndread.c b/lib-src/libnyquist/nyquist/nyqsrc/sndread.c index d4986c532..a1c605f66 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndread.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndread.c @@ -42,10 +42,9 @@ static int sndread_file_open_count = 0; -void read__fetch(susp, snd_list) - register read_susp_type susp; - snd_list_type snd_list; +void read__fetch(snd_susp_type a_susp, snd_list_type snd_list) { + read_susp_type susp = (read_susp_type) a_susp; long n; /* jlh Changed type to long, trying to make move_samples_... work */ sample_block_type out; register sample_block_values_type out_ptr; @@ -70,7 +69,7 @@ void read__fetch(susp, snd_list) n = susp->cnt - susp->susp.current; } - snd_list->block_len = n; + snd_list->block_len = (short) n; susp->susp.current += n; if (n == 0) { @@ -123,7 +122,7 @@ LVAL snd_make_read( falloc_generic(susp, read_susp_node, "snd_make_read"); memset(&(susp->sf_info), 0, sizeof(SF_INFO)); - susp->sf_info.samplerate = ROUND(*srate); + susp->sf_info.samplerate = ROUND32(*srate); susp->sf_info.channels = *channels; switch (*mode) { @@ -177,7 +176,7 @@ LVAL snd_make_read( if (!susp->sndfile) { char error[240]; - sprintf(error, "SND-READ: Cannot open file '%s' because of %s", filename, + snprintf(error, 240, "SND-READ: Cannot open file '%s' because of %s", filename, sf_strerror(susp->sndfile)); xlfail(error); } @@ -219,7 +218,7 @@ LVAL snd_make_read( if (*dur * *srate + 0.5 > (unsigned long) 0xFFFFFFFF) { susp->cnt = 0x7FFFFFFF; } else { - susp->cnt = ROUND((*dur) * *srate); + susp->cnt = ROUNDBIG((*dur) * *srate); } switch (susp->sf_info.format & SF_FORMAT_TYPEMASK) { diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndseq.c b/lib-src/libnyquist/nyquist/nyqsrc/sndseq.c index 21fefb40b..d5ec7348e 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndseq.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndseq.c @@ -147,7 +147,7 @@ D nyquist_printf("in sndseq: logically stopped; " } /* figure out which add fetch routine to use */ - delay = ROUND((susp->s2->t0 - now) * susp->s1->sr); + delay = ROUNDBIG((susp->s2->t0 - now) * susp->s1->sr); if (susp->terminate_bits) { /* s1 is done, just get s2 now */ sound_unref(susp->s1); susp->s1 = NULL; diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndsliders.c b/lib-src/libnyquist/nyquist/nyqsrc/sndsliders.c index 7fd9ac662..24a4f16db 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndsliders.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndsliders.c @@ -130,13 +130,13 @@ sound_type snd_make_slider(int index, time_type t0, rate_type sr, time_type d) /* t0 specified as input parameter */ sample_type scale_factor = 1.0F; if (index < 0 || index >= SLIDERS_MAX) { - xlerror("slider index out of range", NIL); + xlfail("slider index out of range"); } falloc_generic(susp, slider_susp_node, "snd_make_slider"); susp->susp.fetch = slider__fetch; susp->index = index; - susp->terminate_cnt = round((d) * sr); + susp->terminate_cnt = ROUNDBIG((d) * sr); /* initialize susp state */ susp->susp.free = slider_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.c b/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.c index 653ce370b..07a69c77d 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndwrite.c @@ -459,7 +459,8 @@ sample_type sound_save_sound(LVAL s_as_lval, long n, snd_type snd, debug_count += debug_unit; } } - gprintf(TRANS, "\ntotal samples: %d\n", *ntotal); + gprintf(TRANS, "\ntotal samples: %d (%g seconds)\n", + *ntotal, *ntotal / snd->format.srate); xlpop(); return max_sample; } @@ -624,8 +625,8 @@ D nyquist_printf("save scale factor %d = %g\n", (int)i, state[i].scale); debug_count += debug_unit; } } - gprintf(TRANS, "total samples: %d x %d channels\n", - *ntotal, chans); + gprintf(TRANS, "total samples: %d x %d channels (%g seconds)\n", + *ntotal, chans, *ntotal / snd->format.srate); /* references to sounds are shared by sa_copy and state[]. * here, we dispose of state[], allowing GC to do the diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sndwritepa.c b/lib-src/libnyquist/nyquist/nyqsrc/sndwritepa.c index 821ed7ffc..470f0d178 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sndwritepa.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/sndwritepa.c @@ -1,4 +1,4 @@ - /* sndwrite.c -- write sounds to files */ +/* sndwrite.c -- write sounds to files */ #include "stdlib.h" #include "switches.h" @@ -64,7 +64,7 @@ threshold = min(1.0, s); \ } \ if (s > 1.0) { \ - s = fmod(s + 1.0, 2.0) - 1.0; \ + s = (sample_type) (fmod(s + 1.0, 2.0) - 1.0); \ (x) = s; \ } \ } else if (s < -threshold) { \ @@ -73,7 +73,7 @@ threshold = min(1.0, -s); \ } \ if (s < -1.0) { \ - s = -(fmod(-s + 1.0, 2.0) - 1.0); \ + s = (sample_type) -(fmod(-s + 1.0, 2.0) - 1.0); \ (x) = s; \ } \ } @@ -96,6 +96,8 @@ // should be looking for local portaudio #include "portaudio.h" +void finish_audio(); + long flush_count = 0; /* how many samples to write to finish */ #define D if (0) @@ -112,11 +114,11 @@ void portaudio_exit() } -sample_type sound_save_sound(LVAL s_as_lval, long n, SF_INFO *sf_info, SNDFILE *snd_file, - float *buf, long *ntotal, PaStream *audio_stream); +sample_type sound_save_sound(LVAL s_as_lval, long n, SF_INFO *sf_info, + SNDFILE *snd_file, float *buf, long *ntotal); -sample_type sound_save_array(LVAL sa, long n, SF_INFO *sf_info, SNDFILE *snd_file, - float *buf, long *ntotal, PaStream *audio_stream); +sample_type sound_save_array(LVAL sa, long n, SF_INFO *sf_info, + SNDFILE *snd_file, float *buf, long *ntotal); unsigned char st_linear_to_ulaw(int sample);/* jlh not used anywhere */ @@ -144,21 +146,29 @@ static int portaudio_error(PaError err, char *problem) } -LVAL prepare_audio(LVAL play, SF_INFO *sf_info, PaStream **audio_stream) +PaStream *audio_stream = NULL; + + +/* whenever we jump to toplevel, make sure audio is closed */ +void local_toplevel(void) +{ + if (audio_stream) { + finish_audio(); + } +} + + +LVAL prepare_audio(LVAL play, SF_INFO *sf_info) { PaStreamParameters output_parameters; int i, j = -1; int num_devices; - const PaDeviceInfo *device_info = NULL; const PaHostApiInfo *host_info; - // list tells us to list devices LVAL list = xlenter("*SND-LIST-DEVICES*"); - // pref tells us which device to open LVAL pref = xlenter("*SND-DEVICE*"); - int pref_num = -1; unsigned char *pref_string = NULL; list = getvalue(list); @@ -184,49 +194,53 @@ LVAL prepare_audio(LVAL play, SF_INFO *sf_info, PaStream **audio_stream) output_parameters.suggestedLatency = sound_latency; // Initialize the audio stream for output + // If this is Linux, prefer to open ALSA device num_devices = Pa_GetDeviceCount(); + // nyquist_printf("num_devices %d\n", num_devices); for (i = 0; i < num_devices; i++) { device_info = Pa_GetDeviceInfo(i); host_info = Pa_GetHostApiInfo(device_info->hostApi); - if (list) { - gprintf(TRANS, "PortAudio %d: %s -- %s\n", i, - device_info->name, host_info->name); + nyquist_printf("PortAudio %d: %s -- %s\n", i, + device_info->name, host_info->name); } if (j == -1) { if (pref_num >= 0 && pref_num == i) j = i; else if (pref_string && - strstr(device_info->name, (char *) pref_string)) j = i; + strstr(device_info->name, (char *) pref_string)) j = i; } + // giving preference to first ALSA device seems to be a bad idea + // if (j == -1 && host_info->type == paALSA) { + // j = i; + // } } - if (j != -1) { output_parameters.device = j; } if (list) { - gprintf(TRANS, "... Default device is %d\n", - Pa_GetDefaultOutputDevice()); - gprintf(TRANS, "... Selected device %d for output\n", - output_parameters.device); + nyquist_printf("... Default device is %d\n", + Pa_GetDefaultOutputDevice()); + nyquist_printf("... Selected device %d for output\n", + output_parameters.device); } if (device_info) { if (portaudio_error( - Pa_OpenStream(audio_stream, NULL /* input */, &output_parameters, - sf_info->samplerate, max_sample_block_len, - paClipOff, NULL /* callback */, NULL /* userdata */), + Pa_OpenStream(&audio_stream, NULL /* input */, &output_parameters, + sf_info->samplerate, max_sample_block_len, + paClipOff, NULL /* callback */, NULL /* userdata */), "could not open audio")) { + nyquist_printf("audio device name: %s\n", device_info->name); + audio_stream = NULL; return NIL; } } else { - gprintf(TRANS, "warning: no audio device found\n"); + nyquist_printf("warning: no audio device found\n"); return NIL; } flush_count = (long) (sf_info->samplerate * (sound_latency + 0.2)); - if (portaudio_error(Pa_StartStream(*audio_stream), + if (portaudio_error(Pa_StartStream(audio_stream), "could not start audio")) { - gprintf(TRANS, "Could not start audio with: %s\n", device_info->name); - audio_stream = NULL; return NIL; } @@ -236,7 +250,7 @@ LVAL prepare_audio(LVAL play, SF_INFO *sf_info, PaStream **audio_stream) /* finish_audio -- flush the remaining samples, then close */ /**/ -void finish_audio(PaStream *audio_stream) +void finish_audio() { /* portaudio_error(Pa_StopStream(audio_stream), "could not stop stream"); */ /* write Latency frames of audio to make sure all samples are played */ @@ -248,8 +262,10 @@ void finish_audio(PaStream *audio_stream) flush_count -= 16; } portaudio_error(Pa_CloseStream(audio_stream), "could not close audio"); + audio_stream = NULL; } + long lookup_format(long format, long mode, long bits, long swap) { long sf_mode; @@ -283,7 +299,7 @@ long lookup_format(long format, long mode, long bits, long swap) sf_format |= (swap ? SF_ENDIAN_LITTLE : SF_ENDIAN_BIG); #endif #ifdef XL_LITTLE_ENDIAN - sf_format |= (swap ? SF_ENDIAN_BIG : SF_ENDIAN_LITTLE); + sf_format |= (swap ? SF_ENDIAN_LITTLE : SF_ENDIAN_LITTLE); #endif break; default: @@ -360,12 +376,11 @@ double sound_save( LVAL play) { LVAL result; - float *buf; + float *buf = NULL; long ntotal; double max_sample; SNDFILE *sndfile = NULL; SF_INFO sf_info; - PaStream *audio_stream = NULL; if (SAFE_NYQUIST) play = FALSE; gc(); @@ -387,7 +402,7 @@ double sound_save( } } /* assume all are the same: */ - *sr = sf_info.samplerate = ROUND(getsound(getelement(result, 0))->sr); + *sr = sf_info.samplerate = ROUND32(getsound(getelement(result, 0))->sr); /* note: if filename is "", then don't write file; therefore, * write the file if (filename[0]) @@ -403,7 +418,7 @@ double sound_save( } if (play) - play = prepare_audio(play, &sf_info, &audio_stream); + play = prepare_audio(play, &sf_info); if ((buf = (float *) malloc(max_sample_block_len * sf_info.channels * sizeof(float))) == NULL) { @@ -411,13 +426,13 @@ double sound_save( } max_sample = sound_save_array(result, n, &sf_info, sndfile, - buf, &ntotal, audio_stream); + buf, &ntotal); *duration = ntotal / *sr; if (sndfile) sf_close(sndfile); - if (play != NIL) finish_audio(audio_stream); + if (play != NIL) finish_audio(); } else if (exttypep(result, a_sound)) { *nchans = sf_info.channels = 1; - sf_info.samplerate = ROUND((getsound(result))->sr); + sf_info.samplerate = ROUND32((getsound(result))->sr); *sr = sf_info.samplerate; if (filename[0]) { sndfile = NULL; @@ -436,7 +451,7 @@ double sound_save( } } if (play) - play = prepare_audio(play, &sf_info, &audio_stream); + play = prepare_audio(play, &sf_info); if ((buf = (float *) malloc(max_sample_block_len * sizeof(float))) == NULL) { @@ -444,7 +459,7 @@ double sound_save( } max_sample = sound_save_sound(result, n, &sf_info, sndfile, - buf, &ntotal, audio_stream); + buf, &ntotal); *duration = ntotal / *sr; if (sndfile) sf_close(sndfile); if (play != NIL) finish_audio(audio_stream); @@ -453,7 +468,7 @@ double sound_save( result); max_sample = 0.0; } - free(buf); + if (buf) free(buf); return max_sample; } @@ -491,11 +506,12 @@ SNDFILE *open_for_write(unsigned char *filename, long direction, /* use proper scale factor: 8000 vs 7FFF */ sf_command(sndfile, SFC_SET_CLIPPING, NULL, SF_TRUE); - frames = round(offset * sf_info->samplerate); + frames = ROUNDBIG(offset * sf_info->samplerate); rslt = sf_seek(sndfile, frames, SEEK_SET); if (rslt < 0) { - snprintf(error, sizeof(error), "snd_overwrite: cannot seek to frame %lld of %s", - frames, filename); + snprintf(error, sizeof(error), + "snd_overwrite: cannot seek to frame %lld of %s", + (long long int) frames, filename); xlabort(error); } if (sf_info->channels != channels) { @@ -574,11 +590,11 @@ double sound_overwrite( } } sndfile = open_for_write(filename, SFM_RDWR, format, &sf_info, channels, - ROUND(getsound(getelement(result, 0))->sr), + ROUND32(getsound(getelement(result, 0))->sr), offset_secs, &buf); max_sample = sound_save_array(result, n, &sf_info, sndfile, - buf, &ntotal, NULL); + buf, &ntotal); *duration = ntotal / (double) sf_info.samplerate; free(buf); sf_close(sndfile); @@ -586,10 +602,10 @@ double sound_overwrite( SNDFILE *sndfile; // opened sound file float *buf; // buffer for samples read in from sound file sndfile = open_for_write(filename, SFM_RDWR, format, &sf_info, 1, - ROUND(getsound(result)->sr), + ROUND32(getsound(result)->sr), offset_secs, &buf); max_sample = sound_save_sound(result, n, &sf_info, sndfile, buf, - &ntotal, NULL); + &ntotal); *duration = ntotal / (double) sf_info.samplerate; free(buf); sf_close(sndfile); @@ -610,7 +626,7 @@ int is_pcm(SF_INFO *sf_info) sample_type sound_save_sound(LVAL s_as_lval, long n, SF_INFO *sf_info, - SNDFILE *sndfile, float *buf, long *ntotal, PaStream *audio_stream) + SNDFILE *sndfile, float *buf, long *ntotal) { long blocklen; sound_type s; @@ -620,7 +636,8 @@ sample_type sound_save_sound(LVAL s_as_lval, long n, SF_INFO *sf_info, long debug_count; /* next point at which to print a message */ sample_type max_sample = 0.0F; sample_type threshold = 0.0F; - /* jlh cvtfn_type cvtfn; */ + double sound_srate; + *ntotal = 0; /* if snd_expr was simply a symbol, then s now points to a shared sound_node. If we read samples from it, then @@ -688,7 +705,8 @@ sample_type sound_save_sound(LVAL s_as_lval, long n, SF_INFO *sf_info, sf_writef_float(sndfile, samps, togo); } if (audio_stream) { - Pa_WriteStream(audio_stream, samps, togo); + PaError err = Pa_WriteStream(audio_stream, samps, togo); + if (err != paNoError) gprintf(TRANS, "Pa_WriteStream %d\n", err); sound_frames += togo; } @@ -700,14 +718,15 @@ sample_type sound_save_sound(LVAL s_as_lval, long n, SF_INFO *sf_info, debug_count += debug_unit; } } - gprintf(TRANS, "\ntotal samples: %ld\n", *ntotal); + gprintf(TRANS, "\ntotal samples: %ld (%g seconds)\n", + *ntotal, *ntotal / sound_srate); xlpop(); return max_sample; } sample_type sound_save_array(LVAL sa, long n, SF_INFO *sf_info, - SNDFILE *sndfile, float *buf, long *ntotal, PaStream *audio_stream) + SNDFILE *sndfile, float *buf, long *ntotal) { long i, chans; float *float_bufp; @@ -718,7 +737,7 @@ sample_type sound_save_array(LVAL sa, long n, SF_INFO *sf_info, long debug_count; /* next point at which to print a message */ sample_type max_sample = 0.0F; sample_type threshold = 0.0F; - /* cvtfn_type cvtfn; jlh */ + double sound_srate; *ntotal = 0; @@ -798,8 +817,8 @@ D nyquist_printf("save scale factor %ld = %g\n", i, state[i].scale); for (i = 0; i < chans; i++) { if (state[i].cnt == 0) { if (sndwrite_trace) { - nyquist_printf("CALLING SOUND_GET_NEXT ON CHANNEL %ld (%lx)\n", - i, (unsigned long) state[i].sound); /* jlh 64 bit issue */ + nyquist_printf("CALLING SOUND_GET_NEXT ON CHANNEL %ld (%p)\n", + i, state[i].sound); /* jlh 64 bit issue */ sound_print_tree(state[i].sound); } state[i].ptr = sound_get_next(state[i].sound, @@ -857,8 +876,8 @@ D nyquist_printf("save scale factor %ld = %g\n", i, state[i].scale); debug_count += debug_unit; } } - gprintf(TRANS, "total samples: %ld x %ld channels\n", - *ntotal, chans); + gprintf(TRANS, "\ntotal samples: %ld x %ld channels (%g seconds)\n", + *ntotal, chans, *ntotal / sound_srate); /* references to sounds are shared by sa_copy and state[]. * here, we dispose of state[], allowing GC to do the diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sound.c b/lib-src/libnyquist/nyquist/nyqsrc/sound.c index 1dab5898b..3dfb74980 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sound.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/sound.c @@ -23,6 +23,10 @@ #include "cext.h" #include "userio.h" +/* default maximum sample blocks: + * 1GB / (sample_block_len samples/block * 4 bytes/sample) */ +long max_sample_blocks = 1000000000 / (max_sample_block_len * sizeof(float)); + /* #define GC_DEBUG */ #ifdef GC_DEBUG extern sound_type sound_to_watch; @@ -43,10 +47,10 @@ xtype_desc sound_desc; LVAL a_sound; LVAL s_audio_markers; -static void sound_xlfree(); -static void sound_xlprint(); -static void sound_xlsave(); -static unsigned char *sound_xlrestore(); +static void sound_xlfree(void *); +static void sound_xlprint(LVAL, void *); +static void sound_xlsave(FILE *fp, void *s); +static unsigned char *sound_xlrestore(FILE *); void sound_print_array(LVAL sa, long n); void sound_print_sound(sound_type s, long n); @@ -60,6 +64,15 @@ boolean sound_created_flag = false; int nosc_enabled = false; #endif +/* m is in bytes */ +long snd_set_max_audio_mem(long m) +{ + long r = max_sample_blocks; + max_sample_blocks = m / (max_sample_block_len * sizeof(float)); + return r * max_sample_block_len * sizeof(float); +} + + double sound_latency = 0.3; /* default value */ /* these are used so get times for *AUDIO-MARKERS* */ double sound_srate = 44100.0; @@ -68,8 +81,8 @@ long sound_frames = 0; double snd_set_latency(double latency) { double r = sound_latency; - sound_latency = latency; - return r; + sound_latency = latency; + return r; } @@ -268,7 +281,7 @@ sound_type sound_create( falloc_sound(sound, "sound_create"); if (((long) sound) & 3) errputstr("sound not word aligned\n"); last_sound = sound; /* debug */ - if (t0 < 0) xlerror("attempt to create a sound with negative starting time", s_unbound); + if (t0 < 0) xlfail("attempt to create a sound with negative starting time"); /* nyquist_printf("sound_create %p gets %g\n", sound, t0); */ sound->t0 = sound->true_t0 = sound->time = t0; sound->stop = MAX_STOP; @@ -408,7 +421,7 @@ table_type sound_to_table(sound_type s) if (len >= max_table_len) { char emsg[100]; - sprintf(emsg, "maximum table size (%d) exceeded", max_table_len - 1); + sprintf(emsg, "maximum table size (%d) exceeded", max_table_len); xlcerror("use truncated sound for table", emsg, NIL); } else if (len == 0) { xlabort("table size must be greater than 0"); @@ -515,38 +528,37 @@ void snd_list_terminate(snd_list) void snd_list_unref(snd_list_type list) { - if (list == NULL) { - nyquist_printf("why did snd_list_unref get %p?\n", list); - return; - } + if (list == NULL) { + nyquist_printf("why did snd_list_unref get %p?\n", list); + return; + } - while (list && (list != zero_snd_list)) { - snd_list_type next; + while (list && (list != zero_snd_list)) { + snd_list_type next = NULL; - list->refcnt--; - if (list->refcnt != 0) { - break; // the rest of the list is shared, nothing more to free - } + list->refcnt--; + if (list->refcnt != 0) { + break; // the rest of the list is shared, nothing more to free + } - next = NULL; - // list nodes either point to a block of samples or this is the - // last list node (list->block == NULL) which points to a suspension - // lists can also terminate at the zero_block, which is an infinite - // shared list (zero_block->block == zero_block) of zero samples - if (list->block && list->block != zero_block) { - /* there is a next snd_list */ - next = list->u.next; - sample_block_unref(list->block); - } else if (list->block == NULL) { /* the next thing is the susp */ - /* free suspension structure */ - /* nyquist_printf("freeing susp@%p\n", list->u.susp); */ - (*(list->u.susp->free))(list->u.susp); - } - /* if (list == list_watch) - printf("freeing watched snd_list %p\n", list); */ - ffree_snd_list(list, "snd_list_unref"); - list = next; - } + // list nodes either point to a block of samples or this is the + // last list node (list->block == NULL) which points to a suspension + // lists can also terminate at the zero_block, which is an infinite + // shared list (zero_block->block == zero_block) of zero samples + if (list->block && list->block != zero_block) { + /* there is a next snd_list */ + next = list->u.next; + sample_block_unref(list->block); + } else if (list->block == NULL) { /* the next thing is the susp */ + /* free suspension structure */ + /* nyquist_printf("freeing susp@%p\n", list->u.susp); */ + (*(list->u.susp->free))(list->u.susp); + } + /* if (list == list_watch) + printf("freeing watched snd_list %p\n", list); */ + ffree_snd_list(list, "snd_list_unref"); + list = next; + } } @@ -1444,6 +1456,7 @@ void sound_play(snd_expr) ntotal = 0; s = getsound(result); + xlpop(); /* if snd_expr was simply a symbol, then s now points to a shared sound_node. If we read samples from it, then the sound bound to the symbol will be destroyed, so @@ -1454,6 +1467,7 @@ void sound_play(snd_expr) it. */ s = sound_copy(s); + gc(); while (1) { #ifdef OSC if (nosc_enabled) nosc_poll(); @@ -1467,7 +1481,6 @@ void sound_play(snd_expr) } nyquist_printf("total samples: %d\n", ntotal); sound_unref(s); - xlpop(); } @@ -1590,30 +1603,18 @@ double step_to_hz(double steps) return exp(steps * p1 + p2); } -#ifdef WIN32 -#if _MSC_VER < 1800 -#define RECIP_LOG_2 1.44269504088895364453 - -double log2(double x) -{ - return log(x) * RECIP_LOG_2; -} -#endif -#endif /* * from old stuff... */ -static void sound_xlfree(s) -sound_type s; +static void sound_xlfree(void *s) { -/* nyquist_printf("sound_xlfree(%p)\n", s);*/ - sound_unref(s); + sound_unref((sound_type)s); } -static void sound_xlprint(LVAL fptr, sound_type s) +static void sound_xlprint(LVAL fptr, void *s) { /* the type cast from s to LVAL is OK because * putatm does not dereference the 3rd parameter */ @@ -1621,9 +1622,7 @@ static void sound_xlprint(LVAL fptr, sound_type s) } -static void sound_xlsave(fp, s) -FILE *fp; -sound_type s; +static void sound_xlsave(FILE *fp, void *s) { stdputstr("sound_save called\n"); } @@ -1654,17 +1653,20 @@ void sound_xlmark(void *a_sound) stdputstr(" terminates at zero_snd_list\n"); #endif return; + } else if (counter > max_sample_blocks) { + /* exceded maximum length of sound in memory */ } else if (counter > 1000000) { - stdputstr("You created a recursive sound! This is a Nyquist bug.\n"); - stdputstr("The only known way to do this is by a SETF on a\n"); - stdputstr("local variable or parameter that is being passed to SEQ\n"); - stdputstr("or SEQREP. The garbage collector assumes that sounds are\n"); - stdputstr("not recursive or circular, and follows sounds to their\n"); - stdputstr("end. After following a million nodes, I'm pretty sure\n"); - stdputstr("that there is a cycle here, but since this is a bug,\n"); - stdputstr("I cannot promise to recover. Prepare to crash. If you\n"); - stdputstr("cannot locate the cause of this, contact the author -RBD.\n"); - } + stdputstr("You created a recursive sound! This is a Nyquist bug.\n"); + stdputstr("The only known way to do this is by a SETF on a\n"); + stdputstr("local variable or parameter that is being passed to\n"); + stdputstr("SEQ or SEQREP. The garbage collector assumes that\n"); + stdputstr("sounds are not recursive or circular, and follows\n"); + stdputstr("sounds to their end. After following a more nodes,\n"); + stdputstr("than can exist, I'm pretty sure that there is a\n"); + stdputstr("cycle here, but since this is a bug, I cannot promise\n"); + stdputstr("to recover. Prepare to crash. If you cannot locate\n"); + stdputstr("the cause of this, contact the author -RBD.\n"); + } snd_list = snd_list->u.next; counter++; } diff --git a/lib-src/libnyquist/nyquist/nyqsrc/sound.h b/lib-src/libnyquist/nyquist/nyqsrc/sound.h index 9e0fa6477..66ddbd7b8 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/sound.h +++ b/lib-src/libnyquist/nyquist/nyqsrc/sound.h @@ -12,6 +12,8 @@ extern long sound_frames; extern double sound_srate; +extern long max_sample_blocks; + #if OSC extern int nosc_enabled; /* enable polling for OSC messages */ #endif @@ -241,7 +243,7 @@ typedef double promoted_sample_type; */ #define MAX_SND_CHANNELS 24 -#define max_table_len 1000001 +#define max_table_len 100000000 /* Set to 4 for debugging block allocation stuff, 1012? for production */ @@ -272,19 +274,12 @@ typedef struct { /* forward declaration for circular type dependencies */ typedef struct snd_list_struct *snd_list_type; -struct snd_susp_struct; - -typedef void (*snd_fetch_fn)(struct snd_susp_struct *, snd_list_type snd_list); -typedef void (*snd_free_fn)(struct snd_susp_struct *); -typedef void (*snd_mark_fn)(struct snd_susp_struct *); /* marks LVAL nodes for GC */ -typedef void (*snd_print_tree_fn)(struct snd_susp_struct *, int); - typedef struct snd_susp_struct { - snd_fetch_fn fetch; + void (*fetch)(struct snd_susp_struct *, snd_list_type snd_list); void (*keep_fetch)(struct snd_susp_struct *, snd_list_type snd_list); - snd_free_fn free; - snd_mark_fn mark; - snd_print_tree_fn print_tree; /* debugging */ + void (*free)(struct snd_susp_struct *); + void (*mark)(struct snd_susp_struct *); /* marks LVAL nodes for GC */ + void (*print_tree)(struct snd_susp_struct *, int); /* debugging */ char *name; /* string name for debugging */ long toss_cnt; /* return this many zeros, then compute */ long current; /* current sample number */ @@ -323,28 +318,27 @@ typedef struct table_struct { #define UNKNOWN (-10-max_sample_block_len) typedef struct sound_struct { - sample_block_type (*get_next)(struct sound_struct *snd, long *cnt); - time_type time; /* logical starting time */ - time_type t0; /* quantized time of first sample */ - long stop; /* stop (clipping) sample no. */ - time_type true_t0; /* exact time of first sample */ - rate_type sr; /* sample rate */ - long current; /* current sample number, - if negative, then the first - -current samples must be dropped - in order to find the first sample */ - long logical_stop_cnt; /* log stop sample no, -1=unknwn */ - snd_list_type list; /* sample block list, starting at curr. samp */ - sample_type scale; /* scale factor for the result */ - long prepend_cnt; /* how many zeros to prepend */ + sample_block_type (*get_next)(struct sound_struct *snd, long *cnt); + time_type time; /* logical starting time */ + time_type t0; /* quantized time of first sample */ + long stop; /* stop (clipping) sample no. */ + time_type true_t0; /* exact time of first sample */ + rate_type sr; /* sample rate */ + long current; /* current sample number, + if negative, then the first + -current samples must be dropped + in order to find the first sample */ + long logical_stop_cnt; /* log stop sample no, -1=unknwn */ + snd_list_type list; /* sample block list, starting at curr. samp */ + sample_type scale; /* scale factor for the result */ + long prepend_cnt; /* how many zeros to prepend */ /* function to use as get_next after prepended zeros are generated: */ - sample_block_type (*after_prepend) - (struct sound_struct * snd, long * cnt); - table_type table; /* pointer to table-ized version of this sound */ - long *extra; /* used for extra state information, first word of extra - state should be the length of the extra state - (see sound_unref()) - */ + sample_block_type (*after_prepend) + (struct sound_struct * snd, long * cnt); + table_type table; /* pointer to table-ized version of this sound */ + long *extra; /* used for extra state information, first word of extra + state should be the length of the extra state + (see sound_unref()) */ } sound_node, *sound_type; /* convert number of samples to memory size: */ @@ -358,6 +352,9 @@ extern snd_list_type zero_snd_list; extern sound_type printing_this_sound; /* debugging global */ +long snd_set_max_audio_mem(long m); +/* LISP: (SND-SET-MAX-AUDIO-MEM FIXNUM) */ + extern double sound_latency; /* controls output latency */ double snd_set_latency(double latency); /* LISP: (SND-SET-LATENCY FLONUM) */ @@ -580,7 +577,7 @@ double step_to_hz(double); */ #define logical_stop_cnt_cvt(sound) \ (sound->logical_stop_cnt == UNKNOWN ? UNKNOWN : \ - ROUND((sound->logical_stop_cnt / sound->sr) * susp->susp.sr)) + ROUND32((sound->logical_stop_cnt / sound->sr) * susp->susp.sr)) /* logical_stop_test tests to see if sound has logically stopped; if so, diff --git a/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.alg b/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.alg new file mode 100644 index 000000000..1d0ec29bc --- /dev/null +++ b/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.alg @@ -0,0 +1,11 @@ +(COTERM-ALG + (NAME "stoponzero") + (ARGUMENTS ("sound_type" "s1")) + (SAMPLE-RATE (MAX s1)) + (START (MAX s1)) + (INNER-LOOP "{ output = s1;}") + (LINEAR s1) + (TERMINATE (MIN s1)) + (LOGICAL-STOP (MIN s1)) +) + diff --git a/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.c b/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.c new file mode 100644 index 000000000..92b95c1ff --- /dev/null +++ b/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.c @@ -0,0 +1,216 @@ +#include "stdio.h" +#ifndef mips +#include "stdlib.h" +#endif +#include "xlisp.h" +#include "sound.h" + +#include "falloc.h" +#include "cext.h" +#include "stoponzero.h" + +void stoponzero_free(snd_susp_type a_susp); + + +typedef struct stoponzero_susp_struct { + snd_susp_node susp; + long terminate_cnt; + boolean logically_stopped; + sound_type s1; + long s1_cnt; + sample_block_values_type s1_ptr; +} stoponzero_susp_node, *stoponzero_susp_type; + + +void stoponzero_n_fetch(snd_susp_type a_susp, snd_list_type snd_list) +{ + stoponzero_susp_type susp = (stoponzero_susp_type) a_susp; + int cnt = 0; /* how many samples computed */ + int togo; + int n; + sample_block_type out; + register sample_block_values_type out_ptr; + + register sample_block_values_type out_ptr_reg; + + register sample_block_values_type s1_ptr_reg; + falloc_sample_block(out, "stoponzero_n_fetch"); + out_ptr = out->samples; + snd_list->block = out; + + while (cnt < max_sample_block_len) { /* outer loop */ + /* first compute how many samples to generate in inner loop: */ + /* don't overflow the output sample block: */ + togo = max_sample_block_len - cnt; + + /* don't run past the s1 input sample block: */ + susp_check_term_log_samples(s1, s1_ptr, s1_cnt); + togo = min(togo, susp->s1_cnt); + + /* don't run past terminate time */ + if (susp->terminate_cnt != UNKNOWN && + susp->terminate_cnt <= susp->susp.current + cnt + togo) { + togo = susp->terminate_cnt - (susp->susp.current + cnt); + if (togo < 0) togo = 0; /* avoids rounding errros */ + if (togo == 0) break; + } + + + /* don't run past logical stop time */ + if (!susp->logically_stopped && susp->susp.log_stop_cnt != UNKNOWN) { + int to_stop = susp->susp.log_stop_cnt - (susp->susp.current + cnt); + /* break if to_stop == 0 (we're at the logical stop) + * AND cnt > 0 (we're not at the beginning of the + * output block). + */ + if (to_stop < 0) to_stop = 0; /* avoids rounding errors */ + if (to_stop < togo) { + if (to_stop == 0) { + if (cnt) { + togo = 0; + break; + } else /* keep togo as is: since cnt == 0, we + * can set the logical stop flag on this + * output block + */ + susp->logically_stopped = true; + } else /* limit togo so we can start a new + * block at the LST + */ + togo = to_stop; + } + } + + n = togo; + s1_ptr_reg = susp->s1_ptr; + out_ptr_reg = out_ptr; + if (n) do { /* the inner sample computation loop */ + float samp = *s1_ptr_reg++; + *out_ptr_reg++ = samp; + if (samp <= 0.0F) { + togo -= (n - 1); + // after we update cnt below, terminate_cnt == current + cnt, + // so terminate_cnt - (current + cnt) will be zero, and we'll + // terminate + susp->terminate_cnt = susp->susp.current + cnt - togo; + n = 1; + } + } while (--n); /* inner loop */ + + /* using s1_ptr_reg is a bad idea on RS/6000: */ + susp->s1_ptr += togo; + out_ptr += togo; + susp_took(s1_cnt, togo); + cnt += togo; + } /* outer loop */ + + /* test for termination */ + if (togo == 0 && cnt == 0) { + snd_list_terminate(snd_list); + } else { + snd_list->block_len = cnt; + susp->susp.current += cnt; + } + /* test for logical stop */ + if (susp->logically_stopped) { + snd_list->logically_stopped = true; + } else if (susp->susp.log_stop_cnt == susp->susp.current) { + susp->logically_stopped = true; + } +} /* stoponzero_n_fetch */ + + +void stoponzero_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) + { + stoponzero_susp_type susp = (stoponzero_susp_type) a_susp; + time_type final_time = susp->susp.t0; + long n; + + /* fetch samples from s1 up to final_time for this block of zeros */ + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= + susp->s1->current) + susp_get_samples(s1, s1_ptr, s1_cnt); + /* convert to normal processing when we hit final_count */ + /* we want each signal positioned at final_time */ + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - + (susp->s1->current - susp->s1_cnt)); + susp->s1_ptr += n; + susp_took(s1_cnt, n); + susp->susp.fetch = susp->susp.keep_fetch; + (*(susp->susp.fetch))(a_susp, snd_list); +} + + +void stoponzero_mark(snd_susp_type a_susp) +{ + stoponzero_susp_type susp = (stoponzero_susp_type) a_susp; + sound_xlmark(susp->s1); +} + + +void stoponzero_free(snd_susp_type a_susp) +{ + stoponzero_susp_type susp = (stoponzero_susp_type) a_susp; + sound_unref(susp->s1); + ffree_generic(susp, sizeof(stoponzero_susp_node), "stoponzero_free"); +} + + +void stoponzero_print_tree(snd_susp_type a_susp, int n) +{ + stoponzero_susp_type susp = (stoponzero_susp_type) a_susp; + indent(n); + stdputstr("s1:"); + sound_print_tree_1(susp->s1, n); +} + + +sound_type snd_make_stoponzero(sound_type s1) +{ + register stoponzero_susp_type susp; + rate_type sr = s1->sr; + time_type t0 = s1->t0; + sample_type scale_factor = 1.0F; + time_type t0_min = t0; + /* combine scale factors of linear inputs (S1) */ + scale_factor *= s1->scale; + s1->scale = 1.0F; + + /* try to push scale_factor back to a low sr input */ + if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; } + + falloc_generic(susp, stoponzero_susp_node, "snd_make_stoponzero"); + susp->susp.fetch = stoponzero_n_fetch; + susp->terminate_cnt = UNKNOWN; + /* handle unequal start times, if any */ + if (t0 < s1->t0) sound_prepend_zeros(s1, t0); + /* minimum start time over all inputs: */ + t0_min = min(s1->t0, t0); + /* how many samples to toss before t0: */ + susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5); + if (susp->susp.toss_cnt > 0) { + susp->susp.keep_fetch = susp->susp.fetch; + susp->susp.fetch = stoponzero_toss_fetch; + } + + /* initialize susp state */ + susp->susp.free = stoponzero_free; + susp->susp.sr = sr; + susp->susp.t0 = t0; + susp->susp.mark = stoponzero_mark; + susp->susp.print_tree = stoponzero_print_tree; + susp->susp.name = "stoponzero"; + susp->logically_stopped = false; + susp->susp.log_stop_cnt = logical_stop_cnt_cvt(s1); + susp->susp.current = 0; + susp->s1 = s1; + susp->s1_cnt = 0; + return sound_create((snd_susp_type)susp, t0, sr, scale_factor); +} + + +sound_type snd_stoponzero(sound_type s1) +{ + sound_type s1_copy = sound_copy(s1); + return snd_make_stoponzero(s1_copy); +} diff --git a/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.h b/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.h new file mode 100644 index 000000000..b7f4afb04 --- /dev/null +++ b/lib-src/libnyquist/nyquist/nyqsrc/stoponzero.h @@ -0,0 +1,3 @@ +sound_type snd_make_stoponzero(sound_type s1); +sound_type snd_stoponzero(sound_type s1); + /* LISP: (snd-stoponzero SOUND) */ diff --git a/lib-src/libnyquist/nyquist/nyqsrc/trigger.c b/lib-src/libnyquist/nyquist/nyqsrc/trigger.c index 58a35b6a8..0f5daf1e3 100644 --- a/lib-src/libnyquist/nyquist/nyqsrc/trigger.c +++ b/lib-src/libnyquist/nyquist/nyqsrc/trigger.c @@ -48,7 +48,7 @@ the previous value so re-reading will not re-trigger.) #include "cext.h" #include "assert.h" -#define TRIGGERDBG 0 +#define TRIGGERDBG 1 #define D if (TRIGGERDBG) /* Note: this structure is identical to an add_susp structure up @@ -198,7 +198,7 @@ D nyquist_printf("in trigger: after evaluation; " } /* figure out which add fetch routine to use */ - delay = ROUND((susp->s2->t0 - now) * susp->s1->sr); + delay = ROUNDBIG((susp->s2->t0 - now) * susp->s1->sr); if (delay > 0) { /* fill hole between s1 and s2 */ D stdputstr("using add_s1_nn_fetch\n"); susp->susp.fetch = add_s1_nn_fetch; diff --git a/lib-src/libnyquist/nyquist/nyqstk/include/Stk.h b/lib-src/libnyquist/nyquist/nyqstk/include/Stk.h index e81a46c45..4d04f2603 100644 --- a/lib-src/libnyquist/nyquist/nyqstk/include/Stk.h +++ b/lib-src/libnyquist/nyquist/nyqstk/include/Stk.h @@ -14,11 +14,45 @@ #ifndef STK_STK_H #define STK_STK_H +#ifdef WIN32 +/* THESE NO LONGER SEEM NECESSARY, AT LEAST NOT ON VS15 +// this is a fix for Visual Studio 14; not sure if it will cause problems elsewhere +typedef signed __int8 int8_t; +typedef signed __int16 int16_t; +typedef signed __int32 int32_t; +typedef signed __int64 int64_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +*/ +#endif +#include #include #include #include +using namespace std; + namespace Nyq { @@ -274,7 +308,7 @@ public: unsigned int channels( void ) const { return nChannels_; }; //! Return the number of sample frames represented by the data. - unsigned int frames( void ) const { return nFrames_; }; + size_t frames( void ) const { return nFrames_; }; //! Set the sample rate associated with the StkFrames data. /*! @@ -321,6 +355,10 @@ typedef signed short SINT16; typedef signed int SINT32; typedef float FLOAT32; typedef double FLOAT64; +// added by RBD +#ifdef __linux__ +#define intptr_t long +#endif // The default sampling rate. const StkFloat SRATE = 44100.0; diff --git a/lib-src/libnyquist/nyquist/nyqstk/src/Delay.cpp b/lib-src/libnyquist/nyquist/nyqstk/src/Delay.cpp index 9ec5fc61d..1b5a0e097 100644 --- a/lib-src/libnyquist/nyquist/nyqstk/src/Delay.cpp +++ b/lib-src/libnyquist/nyquist/nyqstk/src/Delay.cpp @@ -72,15 +72,12 @@ void Delay :: setMaximumDelay(unsigned long delay) { if ( delay < inputs_.size() ) return; -/* if ( delay < 0 ) { errorString_ << "Delay::setMaximumDelay: argument (" << delay << ") less than zero!\n"; handleError( StkError::WARNING ); return; } - else -*/ - if (delay < delay_ ) { + else if (delay < delay_ ) { errorString_ << "Delay::setMaximumDelay: argument (" << delay << ") less than current delay setting (" << delay_ << ")!\n"; handleError( StkError::WARNING ); return; @@ -100,7 +97,6 @@ void Delay :: setDelay(unsigned long delay) if ( outPoint_ == inputs_.size() ) outPoint_ = 0; delay_ = inputs_.size() - 1; } - /* else if ( delay < 0 ) { errorString_ << "Delay::setDelay: argument (" << delay << ") less than zero ... setting to zero!\n"; handleError( StkError::WARNING ); @@ -108,7 +104,6 @@ void Delay :: setDelay(unsigned long delay) outPoint_ = inPoint_; delay_ = 0; } - */ else { // read chases write if ( inPoint_ >= delay ) outPoint_ = inPoint_ - delay; else outPoint_ = inputs_.size() + inPoint_ - delay; @@ -124,19 +119,19 @@ unsigned long Delay :: getDelay(void) const StkFloat Delay :: energy(void) const { unsigned long i; - StkFloat e = 0; + register StkFloat e = 0; if (inPoint_ >= outPoint_) { for (i=outPoint_; i.zip - cd nyquist - # In the following line, Debian linux users should - # type "nonalsa" in place of "alsa": - ln -s sys/unix/alsa/Makefile Makefile - setenv XLISPPATH `pwd`/runtime:`pwd`/lib +Note 4: Nyquist has recently switched from a +home-brew makefile system to CMake. You'll need to install cmake if +you do not have it. At present, the cmake files work for Windows and +OS X, but there are likely to be some problems with Linux that need +to be solved. + +Unzip sources (e..g use the Archive Manager), creating a nyquist +directory and some subdirectories, and use cd to change the current +directory: + + cd nyquist (or "cd ") + +Build Nyquist with cmake and make: + + ccmake . + change configuration to Release + type c to configure, g to generate and exit make + +Set the search path (in bash), which tells Nyquist where to search +for lisp files to be loaded when a file is not found in the current +directory. See SHELL STARTUP below for information about how to +automate this. -(For bash shell users, instead of the setenv command, use this: + export XLISPPATH=`pwd`/runtime:`pwd`/lib - export XLISPPATH=`pwd`/runtime:`pwd`/lib +(Alternatively, tcsh users can type + setenv XLISPPATH `pwd`/runtime:`pwd`/lib ) -The first line creates a nyquist directory and some -subdirectories. The second line (cd) changes directories to the new -nyquist directory. The third line (ln) makes a link from the top-level -directory to the Makefile for your system. In place of "alsa" in -sys/unix/alsa/Makefile, you should substitute your system -type. Current systems are alsa, nonalsa, next, pmax, rs6k, sgi, and -sparc, but since only the alsa and nonalsa versions have been tested -in recent years, do not expect anything else to work. The setenv (or -export) command tells Nyquist where to search for lisp files to be -loaded when a file is not found in the current directory. See -SHELL STARTUP below for information about how to automate this. - 64-BIT UBUNTU ============= if xlisp/extern.c fails to compile because of a missing bits/predefs.h, @@ -103,7 +108,7 @@ Then try running jNyqIDE by typing: If the NyquistIDE window does not appear, make sure you have Java installed (if not, you probably already encountered errors when you ran the make command.) You can also try recompiling the Java -files. Note that jnyqide/SpecialMacHandler.java will NOT compile +files. Note that jnyqide/SpecialMacHandler.java may NOT compile under non-OS X systems. The Makefile renames this file to "hide" it from the Java compiler, compiles all the remaining java files, and then restores jnyqide/SpecialMacHandler.java: @@ -118,11 +123,6 @@ the lib and runtime directories only. This does not apply to Windows because even though the environment is there, the Windows version of Nyquist reads the XLISPPATH from the Registry. -You can also specify the search path by creating the file -nyquist/xlisppath, which should have colon-separated paths on a single -(long) line of text. This file will override the environment variable -XLISPPATH. - MORE DETAILS ============ It is good to have USER in the environment with your user ID. This @@ -142,9 +142,9 @@ You can modify system.lsp to accomplish this. SHELL STARTUP ============= -The (runtime -directory should always be on your XLISPPATH when you run Nyquist, so -you may want to set XLISPPATH in your shell startup file, e.g. .cshrc. +The runtime directory should always be on your XLISPPATH when you +run Nyquist, so you may want to set XLISPPATH in your shell startup +file, e.g. .cshrc. Which shell are you using? echo $SHELL will tell you. If you use /bin/bash, your startup file is probably ~/.profile. (Remember that @@ -159,7 +159,7 @@ directory when .profile is loaded. If you use /bin/csh (the C Shell), your startup file is probably ~/.cshrc. (Remember that "~/" means your home directory, so the file -will be something like /home/rbd/.profile). In this file, you can add +will be something like /home/rbd/.cshrc). In this file, you can add a line such as: setenv XLISPPATH "/home/rbd/nyquist/runtime:/home/rbd/nyquist/lib" diff --git a/lib-src/libnyquist/nyquist/sys/unix/alsa/Makefile b/lib-src/libnyquist/nyquist/sys/unix/alsa/Makefile deleted file mode 100644 index 4dcbb7725..000000000 --- a/lib-src/libnyquist/nyquist/sys/unix/alsa/Makefile +++ /dev/null @@ -1,1140 +0,0 @@ -# -# Makefile for Nyquist, SYSTEM-TYPE is ALSA -# run make in the top-level Nyquist directory to compile Nyquist -# -# NOTE: this file is machine-generated. DO NOT EDIT! -# Instead, modify makefile.lsp and regenerate the makefile. -# Ports and bug fixes are welcome - please mail them to -# dannenberg@cs.cmu.edu. Thanks. -# - -# This is the resulting executable (normally "ny"): -NY = ny - -OPT = -O2 -m32 -# OPT = -g -m32 - -EVERYTHING = $(NY) runtime/system.lsp jnyqide/jNyqIDE.jar \ - bin/ser-to-osc bin/test-client - -CURRENT = $(EVERYTHING) - -current: $(CURRENT) - -onlyny: $(NY) runtime/system.lsp - -JAVASRC = jnyqide/browser.java jnyqide/NyquistThread.java \ - jnyqide/Pair.java jnyqide/BareBonesBrowserLaunch.java \ - jnyqide/EnvelopeFrame.java jnyqide/Piano_Roll.java \ - jnyqide/FindDialog.java jnyqide/PlotFrame.java \ - jnyqide/InstrumentCharacteristics.java jnyqide/PlotMouseAdapter.java \ - jnyqide/Jslide.java jnyqide/PopupListener.java \ - jnyqide/LispFileFilter.java jnyqide/PreferencesDialog.java \ - jnyqide/MainFrame_AboutBox.java jnyqide/ReplaceDialog.java \ - jnyqide/MainFrame.java jnyqide/SpringUtilities.java jnyqide/Main.java \ - jnyqide/NotFoundDialog.java jnyqide/TextColor.java jnyqide/NyqPlot.java \ - jnyqide/Trie.java jnyqide/NyquistFile.java jnyqide/WordList.java - -jnyqide/jNyqIDE.jar: $(JAVASRC) - if [ -r jnyqide/SpecialMacHandler.java ] ; then \ - mv jnyqide/SpecialMacHandler.java jnyqide/SpecialMacHandler.hidden ;\ - fi - cd jnyqide; javac *.java - mv jnyqide/SpecialMacHandler.hidden jnyqide/SpecialMacHandler.java - rm -rf jnyqide/jNyqIDE.jar - jar -cfm jnyqide/jNyqIDE.jar jnyqide/manifest.txt jnyqide/*.class - -# Standard list of includes (common to all unix versions) -# Keeping portaudio and libsndfile sources local to nyquist -INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Iffts/src \ - -Inyqstk/include -Inyqstk -Iportaudio/include -Iportaudio/src/common \ - -Iportaudio/src/os/unix \ - -Iliblo -Inylsf -IFLAC/include -Ilibogg/include -Ilibvorbis/include - -# system dependent stuff for alsa: - -AUDIOLIBS = -lasound - -CC = gcc - -LIBPA_PATH = portaudio/lib/.libs -LIBOGG_PATH = libogg/src/.libs -LIBVORBIS_PATH = libvorbis/lib/.libs -LIBLO_PATH = liblo/src/.libs -LIBFLAC_PATH = FLAC/obj/release/lib - -# to enable command line editing, use -DREADLINE. WARNING: THIS WILL -# DISABLE THE ABILITY TO INTERRUPT LISP AND USE SOME OTHER HANDY -# CONTROL CHARACTERS (You will also need the readline and curses libraries) -CFLAGS = -DOSC -DCMTSTUFF $(OPT) $(INCL) \ - -DHAVE_LIBPTHREAD=1 -D_FILE_OFFSET_BITS=64 \ - -DSTK_NYQUIST -DUSE_VSPRINTF \ - -DHAVE_CONFIG_H -LN = g++ -m32 -AR = ar -# to enable command line editing, insert -lreadline -lcurses -LFLAGS = -L/usr/lib32 $(LIBPA_PATH)/libportaudio.a \ - $(LIBLO_PATH)/liblo.a $(AUDIOLIBS) $(LIBFLAC_PATH)/libFLAC.a \ - $(LIBVORBIS_PATH)/libvorbis.a \ - $(LIBVORBIS_PATH)/libvorbisfile.a \ - $(LIBVORBIS_PATH)/libvorbisenc.a $(LIBOGG_PATH)/libogg.a \ - -lm -lpthread -lrt - -TAGS: - find . ( -name "*.c" -o -name "*.h" ) -print | etags - - -tags: TAGS - -# end of system dependencies - -INTGEN = misc/intgen - -# Object files for Nyquist: -OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ - xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ - xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ - xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ - xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o xlisp/xlstr.o \ - xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o xlisp/path.o tran/abs.o \ - tran/allpoles.o tran/alpass.o tran/alpasscv.o tran/alpassvv.o \ - tran/amosc.o tran/areson.o tran/aresonvc.o tran/aresoncv.o \ - tran/aresonvv.o tran/atone.o tran/atonev.o tran/biquadfilt.o \ - tran/buzz.o tran/chase.o tran/clip.o tran/congen.o tran/const.o \ - tran/coterm.o tran/delaycc.o tran/delaycv.o tran/eqbandvvv.o tran/exp.o \ - tran/follow.o tran/fmosc.o tran/fromobject.o tran/fromarraystream.o \ - tran/gate.o tran/ifft.o tran/instrclar.o tran/instrclarall.o \ - tran/instrclarfreq.o tran/instrsax.o tran/instrsaxall.o \ - tran/instrsaxfreq.o tran/integrate.o tran/log.o tran/lpreson.o \ - tran/maxv.o tran/offset.o tran/oneshot.o tran/osc.o tran/partial.o \ - tran/pluck.o tran/prod.o tran/pwl.o tran/quantize.o tran/recip.o \ - tran/reson.o tran/resonvc.o tran/resoncv.o tran/resonvv.o \ - tran/sampler.o tran/scale.o tran/shape.o tran/sine.o tran/siosc.o \ - tran/slope.o tran/sqrt.o tran/tapf.o tran/tapv.o tran/tone.o \ - tran/tonev.o tran/upsample.o tran/white.o tran/stkrev.o \ - tran/stkpitshift.o tran/stkchorus.o tran/instrbow.o \ - tran/instrbowedfreq.o tran/instrbanded.o tran/instrmandolin.o \ - tran/instrsitar.o tran/instrmodalbar.o tran/instrflute.o \ - tran/instrflutefreq.o tran/instrfluteall.o tran/fmfb.o tran/fmfbv.o \ - cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o cmt/moxc.o \ - cmt/mem.o cmt/midifile.o cmt/midifns.o cmt/record.o cmt/seq.o \ - cmt/seqmread.o cmt/seqmwrite.o cmt/seqread.o cmt/seqwrite.o \ - cmt/tempomap.o cmt/timebase.o cmt/userio.o nylsf/aiff.o nylsf/alaw.o \ - nylsf/au.o nylsf/audio_detect.o nylsf/avr.o nylsf/broadcast.o \ - nylsf/caf.o nylsf/chanmap.o nylsf/chunk.o nylsf/command.o \ - nylsf/common.o nylsf/dither.o nylsf/double64.o nylsf/dwd.o nylsf/dwvw.o \ - nylsf/file_io.o nylsf/flac.o nylsf/float32.o nylsf/gsm610.o nylsf/htk.o \ - nylsf/id3.o nylsf/ima_adpcm.o nylsf/ima_oki_adpcm.o nylsf/interleave.o \ - nylsf/ircam.o nylsf/macbinary3.o nylsf/macos.o nylsf/mat4.o \ - nylsf/mat5.o nylsf/mpc2k.o nylsf/ms_adpcm.o nylsf/nist.o nylsf/ogg.o \ - nylsf/ogg_vorbis.o nylsf/paf.o nylsf/pcm.o nylsf/pvf.o nylsf/raw.o \ - nylsf/rf64.o nylsf/rx2.o nylsf/sd2.o nylsf/sds.o nylsf/sndfile.o \ - nylsf/strings.o nylsf/svx.o nylsf/txw.o nylsf/ulaw.o nylsf/voc.o \ - nylsf/vox_adpcm.o nylsf/w64.o nylsf/wav.o nylsf/wav_w64.o nylsf/wve.o \ - nylsf/xi.o nylsf/g72x.o nylsf/GSM610/add.o nylsf/GSM610/code.o \ - nylsf/GSM610/decode.o nylsf/GSM610/gsm_create.o \ - nylsf/GSM610/gsm_decode.o nylsf/GSM610/gsm_destroy.o \ - nylsf/GSM610/gsm_encode.o nylsf/GSM610/gsm_option.o \ - nylsf/GSM610/long_term.o nylsf/GSM610/lpc.o nylsf/GSM610/preprocess.o \ - nylsf/GSM610/rpe.o nylsf/GSM610/short_term.o nylsf/GSM610/table.o \ - nylsf/G72x/g721.o nylsf/G72x/g723_16.o nylsf/G72x/g723_24.o \ - nylsf/G72x/g723_40.o nylsf/G72x/g72x.o nyqsrc/debug.o nyqsrc/falloc.o \ - nyqsrc/local.o nyqsrc/handlers.o nyqsrc/multiread.o nyqsrc/seqext.o \ - nyqsrc/seqinterf.o nyqsrc/stats.o nyqsrc/ffilterkit.o nyqsrc/sound.o \ - nyqsrc/add.o nyqsrc/avg.o nyqsrc/compose.o nyqsrc/convolve.o \ - nyqsrc/downsample.o nyqsrc/fft.o nyqsrc/inverse.o nyqsrc/multiseq.o \ - nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/samples.o nyqsrc/sndmax.o \ - nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndsliders.o \ - nyqsrc/sliderdata.o nyqsrc/sndwritepa.o nyqsrc/yin.o \ - nyqsrc/nyq-osc-server.o nyqsrc/trigger.o nyqsrc/lpanal.o \ - nyqsrc/phasevocoder.o nyqsrc/pvshell.o nyqstk/src/Generator.o \ - nyqstk/src/SineWave.o nyqstk/src/Function.o nyqstk/src/FileRead.o \ - nyqstk/src/FileWvIn.o nyqstk/src/Effect.o nyqstk/src/Clarinet.o \ - nyqstk/src/Delay.o nyqstk/src/DelayL.o nyqstk/src/Envelope.o \ - nyqstk/src/Filter.o nyqstk/src/Instrmnt.o nyqstk/src/Noise.o \ - nyqstk/src/OneZero.o nyqstk/src/ReedTable.o nyqstk/src/Saxofony.o \ - nyqstk/src/Stk.o nyqstk/src/WaveLoop.o nyqstk/src/WvIn.o \ - nyqstk/src/NRev.o nyqstk/src/JCRev.o nyqstk/src/PRCRev.o \ - nyqstk/src/PitShift.o nyqstk/src/Chorus.o nyqstk/src/Bowed.o \ - nyqstk/src/BowTable.o nyqstk/src/ADSR.o nyqstk/src/OnePole.o \ - nyqstk/src/BiQuad.o nyqstk/src/BandedWG.o nyqstk/src/DelayA.o \ - nyqstk/src/Mandolin.o nyqstk/src/PluckTwo.o nyqstk/src/Sitar.o \ - nyqstk/src/ModalBar.o nyqstk/src/Modal.o nyqstk/src/Flute.o \ - nyqstk/src/JetTable.o nyqstk/src/PoleZero.o nyqstk/stkinit.o \ - nyqstk/instr.o nyqstk/stkint.o ffts/src/fftext.o ffts/src/fftlib.o \ - ffts/src/matlib.o nyqsrc/sndfnint.o nyqsrc/seqfnint.o \ - sys/unix/osstuff.o sys/unix/term.o - -# Sound functions to add to xlisp -SNDFNINT_HDRS = nyqsrc/sndfmt.h nylsf/sndfile.h nyqsrc/sound.h \ - nyqsrc/add.h nyqsrc/avg.h nyqsrc/compose.h nyqsrc/convolve.h \ - nyqsrc/downsample.h nyqsrc/fft.h nyqsrc/inverse.h nyqsrc/multiseq.h \ - nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/samples.h nyqsrc/sndmax.h \ - nyqsrc/sndread.h nyqsrc/sndseq.h nyqsrc/sndsliders.h \ - nyqsrc/sliderdata.h nyqsrc/sndwritepa.h nyqsrc/yin.h \ - nyqsrc/nyq-osc-server.h nyqsrc/trigger.h nyqsrc/lpanal.h \ - nyqsrc/phasevocoder.h nyqsrc/pvshell.h tran/abs.h tran/allpoles.h \ - tran/alpass.h tran/alpasscv.h tran/alpassvv.h tran/amosc.h \ - tran/areson.h tran/aresonvc.h tran/aresoncv.h tran/aresonvv.h \ - tran/atone.h tran/atonev.h tran/biquadfilt.h tran/buzz.h tran/chase.h \ - tran/clip.h tran/congen.h tran/const.h tran/coterm.h tran/delaycc.h \ - tran/delaycv.h tran/eqbandvvv.h tran/exp.h tran/follow.h tran/fmosc.h \ - tran/fromobject.h tran/fromarraystream.h tran/gate.h tran/ifft.h \ - tran/instrclar.h tran/instrclarall.h tran/instrclarfreq.h \ - tran/instrsax.h tran/instrsaxall.h tran/instrsaxfreq.h tran/integrate.h \ - tran/log.h tran/lpreson.h tran/maxv.h tran/offset.h tran/oneshot.h \ - tran/osc.h tran/partial.h tran/pluck.h tran/prod.h tran/pwl.h \ - tran/quantize.h tran/recip.h tran/reson.h tran/resonvc.h tran/resoncv.h \ - tran/resonvv.h tran/sampler.h tran/scale.h tran/shape.h tran/sine.h \ - tran/siosc.h tran/slope.h tran/sqrt.h tran/tapf.h tran/tapv.h \ - tran/tone.h tran/tonev.h tran/upsample.h tran/white.h tran/stkrev.h \ - tran/stkpitshift.h tran/stkchorus.h tran/instrbow.h \ - tran/instrbowedfreq.h tran/instrbanded.h tran/instrmandolin.h \ - tran/instrsitar.h tran/instrmodalbar.h tran/instrflute.h \ - tran/instrflutefreq.h tran/instrfluteall.h tran/fmfb.h tran/fmfbv.h \ - nyqsrc/sndwrite.h - -SEQFNINT_HDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h \ - nyqsrc/seqinterf.h cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h \ - cmt/seqmwrite.h - - - -liblo/Makefile: - cd liblo; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared - # sometimes, residual files cause problems - cd liblo; make clean - -$(LIBLO_PATH)/liblo.a: liblo/Makefile - cd liblo; make - -bin/ser-to-osc: $(LIBLO_PATH)/liblo.a - mkdir -p bin - $(CC) -c $(CFLAGS) liblo/ser-to-osc/ser-to-osc.cpp \ - -o liblo/ser-to-osc/ser-to-osc.o - $(LN) liblo/ser-to-osc/ser-to-osc.o -o bin/ser-to-osc $(LFLAGS) - -bin/test-client: $(LIBLO_PATH)/liblo.a - mkdir -p bin - $(CC) -c $(CFLAGS) liblo/test-client/test-client.c \ - -o liblo/test-client/test-client.o - $(LN) liblo/test-client/test-client.o -o bin/test-client $(LFLAGS) - -portaudio/Makefile: - # note: without-jack avoids 32/64-bit link error on Debian - cd portaudio; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared --without-jack --with-alsa - # sometimes, residual files cause problems - cd portaudio; make clean - -$(LIBPA_PATH)/libportaudio.a: portaudio/Makefile - cd portaudio; make lib/libportaudio.la - -libogg/Makefile: - cd libogg; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared - -$(LIBOGG_PATH)/libogg.a: libogg/Makefile - cd libogg; make - -# NOTE: libvorbis/configure on a 64-bit machine will expect to find -# libogg installed (even though we are not going to use the installed -# libogg library, and even though the installed libogg library will -# be for 64-bit architecture. This represents a bug in configure -# because it checks for a 64-bit library when it is building for -# a 32-bit architecture (we pass in CFLAGS=-m32). In spite of the -# bug, configure will build a Makefile that will build a 32-bit -# libvorbis library that we need. We will link it with other -# 32-bit code including 32-bit libogg.a - -libvorbis/Makefile: - cd libvorbis; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared - -$(LIBVORBIS_PATH)/libvorbis.a: libvorbis/Makefile - cd libvorbis; make - -$(LIBVORBIS_PATH)/libvorbisfile.a: libvorbis/Makefile - cd libvorbis; make - -$(LIBVORBIS_PATH)/libvorbisenc.a: libvorbis/Makefile - cd libvorbis; make - - -$(LIBFLAC_PATH)/libFLAC.a: FLAC/src/libFLAC/Makefile.lite - cd FLAC/src/libFLAC; make -f Makefile.lite - -$(NY): $(OBJECTS) $(LIBPA_PATH)/libportaudio.a $(LIBLO_PATH)/liblo.a \ - FLAC/obj/release/lib/libFLAC.a \ - $(LIBVORBIS_PATH)/libvorbis.a $(LIBVORBIS_PATH)/libvorbisfile.a \ - $(LIBVORBIS_PATH)/libvorbisenc.a $(LIBOGG_PATH)/libogg.a - $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) - -# copy appropriate system.lsp and make it read-only; -# changes should be made to sys/unix//system.lsp -runtime/system.lsp: sys/unix/alsa/system.lsp -# make sure it's there before you make it writeable - touch runtime/system.lsp - chmod +w runtime/system.lsp - cp -p sys/unix/alsa/system.lsp runtime/system.lsp - chmod -w runtime/system.lsp - -NYQDEP = nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - -nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h $(NYQDEP) - $(CC) -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) - -nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h $(NYQDEP) - $(CC) -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) - -nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h $(NYQDEP) - $(CC) -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) - -nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h $(NYQDEP) - $(CC) -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) - -nyqsrc/convolve.o: nyqsrc/convolve.c nyqsrc/convolve.h $(NYQDEP) - $(CC) -c nyqsrc/convolve.c -o nyqsrc/convolve.o $(CFLAGS) - -nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h $(NYQDEP) - $(CC) -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) - -nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h $(NYQDEP) - $(CC) -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) - -nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h $(NYQDEP) - $(CC) -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) - -nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h $(NYQDEP) - $(CC) -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) - -nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h $(NYQDEP) - $(CC) -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) - -nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h $(NYQDEP) - $(CC) -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) - -nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h $(NYQDEP) - $(CC) -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) - -nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h $(NYQDEP) - $(CC) -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) - -nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h $(NYQDEP) - $(CC) -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) - -nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h $(NYQDEP) - $(CC) -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) - -nyqsrc/sndsliders.o: nyqsrc/sndsliders.c nyqsrc/sndsliders.h $(NYQDEP) - $(CC) -c nyqsrc/sndsliders.c -o nyqsrc/sndsliders.o $(CFLAGS) - -nyqsrc/sliderdata.o: nyqsrc/sliderdata.c nyqsrc/sliderdata.h $(NYQDEP) - $(CC) -c nyqsrc/sliderdata.c -o nyqsrc/sliderdata.o $(CFLAGS) - -nyqsrc/sndwritepa.o: nyqsrc/sndwritepa.c nyqsrc/sndwrite.h - $(CC) -c nyqsrc/sndwritepa.c -o nyqsrc/sndwritepa.o $(CFLAGS) - -nyqsrc/yin.o: nyqsrc/yin.c nyqsrc/yin.h $(NYQDEP) - $(CC) -c nyqsrc/yin.c -o nyqsrc/yin.o $(CFLAGS) - -nyqsrc/nyq-osc-server.o: nyqsrc/nyq-osc-server.c nyqsrc/nyq-osc-server.h $(NYQDEP) - $(CC) -c nyqsrc/nyq-osc-server.c -o nyqsrc/nyq-osc-server.o $(CFLAGS) - -nyqsrc/trigger.o: nyqsrc/trigger.c nyqsrc/trigger.h $(NYQDEP) - $(CC) -c nyqsrc/trigger.c -o nyqsrc/trigger.o $(CFLAGS) - -nyqsrc/lpanal.o: nyqsrc/lpanal.c nyqsrc/lpanal.h $(NYQDEP) - $(CC) -c nyqsrc/lpanal.c -o nyqsrc/lpanal.o $(CFLAGS) - -nyqsrc/phasevocoder.o: nyqsrc/phasevocoder.c nyqsrc/phasevocoder.h $(NYQDEP) - $(CC) -c nyqsrc/phasevocoder.c -o nyqsrc/phasevocoder.o $(CFLAGS) - -nyqsrc/pvshell.o: nyqsrc/pvshell.c nyqsrc/pvshell.h $(NYQDEP) - $(CC) -c nyqsrc/pvshell.c -o nyqsrc/pvshell.o $(CFLAGS) - -nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h $(NYQDEP) - $(CC) -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) - -nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h $(NYQDEP) - $(CC) -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) - -nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h - $(CC) -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) - -nyqsrc/handlers.o: nyqsrc/handlers.c - $(CC) -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) - -nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h $(NYQDEP) - $(CC) -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) - -nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h $(NYQDEP) - $(CC) -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) - -nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h $(NYQDEP) - $(CC) -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) - -nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - $(CC) -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) - -nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h $(NYQDEP) - $(CC) -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) - -ffts/src/fftext.o: ffts/src/fftext.c ffts/src/fftext.h $(NYQDEP) - $(CC) -c ffts/src/fftext.c -o ffts/src/fftext.o $(CFLAGS) - -ffts/src/fftlib.o: ffts/src/fftlib.c ffts/src/fftlib.h $(NYQDEP) - $(CC) -c ffts/src/fftlib.c -o ffts/src/fftlib.o $(CFLAGS) - -ffts/src/matlib.o: ffts/src/matlib.c ffts/src/matlib.h $(NYQDEP) - $(CC) -c ffts/src/matlib.c -o ffts/src/matlib.o $(CFLAGS) - -tran/abs.o: tran/abs.c tran/abs.h $(NYQDEP) - $(CC) -c tran/abs.c -o tran/abs.o $(CFLAGS) - -tran/allpoles.o: tran/allpoles.c tran/allpoles.h $(NYQDEP) - $(CC) -c tran/allpoles.c -o tran/allpoles.o $(CFLAGS) - -tran/alpass.o: tran/alpass.c tran/alpass.h $(NYQDEP) - $(CC) -c tran/alpass.c -o tran/alpass.o $(CFLAGS) - -tran/alpasscv.o: tran/alpasscv.c tran/alpasscv.h $(NYQDEP) - $(CC) -c tran/alpasscv.c -o tran/alpasscv.o $(CFLAGS) - -tran/alpassvv.o: tran/alpassvv.c tran/alpassvv.h $(NYQDEP) - $(CC) -c tran/alpassvv.c -o tran/alpassvv.o $(CFLAGS) - -tran/amosc.o: tran/amosc.c tran/amosc.h $(NYQDEP) - $(CC) -c tran/amosc.c -o tran/amosc.o $(CFLAGS) - -tran/areson.o: tran/areson.c tran/areson.h $(NYQDEP) - $(CC) -c tran/areson.c -o tran/areson.o $(CFLAGS) - -tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h $(NYQDEP) - $(CC) -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) - -tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h $(NYQDEP) - $(CC) -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) - -tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h $(NYQDEP) - $(CC) -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) - -tran/atone.o: tran/atone.c tran/atone.h $(NYQDEP) - $(CC) -c tran/atone.c -o tran/atone.o $(CFLAGS) - -tran/atonev.o: tran/atonev.c tran/atonev.h $(NYQDEP) - $(CC) -c tran/atonev.c -o tran/atonev.o $(CFLAGS) - -tran/biquadfilt.o: tran/biquadfilt.c tran/biquadfilt.h $(NYQDEP) - $(CC) -c tran/biquadfilt.c -o tran/biquadfilt.o $(CFLAGS) - -tran/buzz.o: tran/buzz.c tran/buzz.h $(NYQDEP) - $(CC) -c tran/buzz.c -o tran/buzz.o $(CFLAGS) - -tran/chase.o: tran/chase.c tran/chase.h $(NYQDEP) - $(CC) -c tran/chase.c -o tran/chase.o $(CFLAGS) - -tran/clip.o: tran/clip.c tran/clip.h $(NYQDEP) - $(CC) -c tran/clip.c -o tran/clip.o $(CFLAGS) - -tran/congen.o: tran/congen.c tran/congen.h $(NYQDEP) - $(CC) -c tran/congen.c -o tran/congen.o $(CFLAGS) - -tran/const.o: tran/const.c tran/const.h $(NYQDEP) - $(CC) -c tran/const.c -o tran/const.o $(CFLAGS) - -tran/coterm.o: tran/coterm.c tran/coterm.h $(NYQDEP) - $(CC) -c tran/coterm.c -o tran/coterm.o $(CFLAGS) - -tran/delaycc.o: tran/delaycc.c tran/delaycc.h $(NYQDEP) - $(CC) -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) - -tran/delaycv.o: tran/delaycv.c tran/delaycv.h $(NYQDEP) - $(CC) -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) - -tran/eqbandvvv.o: tran/eqbandvvv.c tran/eqbandvvv.h $(NYQDEP) - $(CC) -c tran/eqbandvvv.c -o tran/eqbandvvv.o $(CFLAGS) - -tran/exp.o: tran/exp.c tran/exp.h $(NYQDEP) - $(CC) -c tran/exp.c -o tran/exp.o $(CFLAGS) - -tran/follow.o: tran/follow.c tran/follow.h $(NYQDEP) - $(CC) -c tran/follow.c -o tran/follow.o $(CFLAGS) - -tran/fmosc.o: tran/fmosc.c tran/fmosc.h $(NYQDEP) - $(CC) -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) - -tran/fromobject.o: tran/fromobject.c tran/fromobject.h $(NYQDEP) - $(CC) -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) - -tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h $(NYQDEP) - $(CC) -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) - -tran/gate.o: tran/gate.c tran/gate.h $(NYQDEP) - $(CC) -c tran/gate.c -o tran/gate.o $(CFLAGS) - -tran/ifft.o: tran/ifft.c tran/ifft.h $(NYQDEP) - $(CC) -c tran/ifft.c -o tran/ifft.o $(CFLAGS) - -tran/instrclar.o: tran/instrclar.c tran/instrclar.h $(NYQDEP) - $(CC) -c tran/instrclar.c -o tran/instrclar.o $(CFLAGS) - -tran/instrclarall.o: tran/instrclarall.c tran/instrclarall.h $(NYQDEP) - $(CC) -c tran/instrclarall.c -o tran/instrclarall.o $(CFLAGS) - -tran/instrclarfreq.o: tran/instrclarfreq.c tran/instrclarfreq.h $(NYQDEP) - $(CC) -c tran/instrclarfreq.c -o tran/instrclarfreq.o $(CFLAGS) - -tran/instrsax.o: tran/instrsax.c tran/instrsax.h $(NYQDEP) - $(CC) -c tran/instrsax.c -o tran/instrsax.o $(CFLAGS) - -tran/instrsaxall.o: tran/instrsaxall.c tran/instrsaxall.h $(NYQDEP) - $(CC) -c tran/instrsaxall.c -o tran/instrsaxall.o $(CFLAGS) - -tran/instrsaxfreq.o: tran/instrsaxfreq.c tran/instrsaxfreq.h $(NYQDEP) - $(CC) -c tran/instrsaxfreq.c -o tran/instrsaxfreq.o $(CFLAGS) - -tran/integrate.o: tran/integrate.c tran/integrate.h $(NYQDEP) - $(CC) -c tran/integrate.c -o tran/integrate.o $(CFLAGS) - -tran/log.o: tran/log.c tran/log.h $(NYQDEP) - $(CC) -c tran/log.c -o tran/log.o $(CFLAGS) - -tran/lpreson.o: tran/lpreson.c tran/lpreson.h $(NYQDEP) - $(CC) -c tran/lpreson.c -o tran/lpreson.o $(CFLAGS) - -tran/maxv.o: tran/maxv.c tran/maxv.h $(NYQDEP) - $(CC) -c tran/maxv.c -o tran/maxv.o $(CFLAGS) - -tran/offset.o: tran/offset.c tran/offset.h $(NYQDEP) - $(CC) -c tran/offset.c -o tran/offset.o $(CFLAGS) - -tran/oneshot.o: tran/oneshot.c tran/oneshot.h $(NYQDEP) - $(CC) -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) - -tran/osc.o: tran/osc.c tran/osc.h $(NYQDEP) - $(CC) -c tran/osc.c -o tran/osc.o $(CFLAGS) - -tran/partial.o: tran/partial.c tran/partial.h $(NYQDEP) - $(CC) -c tran/partial.c -o tran/partial.o $(CFLAGS) - -tran/pluck.o: tran/pluck.c tran/pluck.h $(NYQDEP) - $(CC) -c tran/pluck.c -o tran/pluck.o $(CFLAGS) - -tran/prod.o: tran/prod.c tran/prod.h $(NYQDEP) - $(CC) -c tran/prod.c -o tran/prod.o $(CFLAGS) - -tran/pwl.o: tran/pwl.c tran/pwl.h $(NYQDEP) - $(CC) -c tran/pwl.c -o tran/pwl.o $(CFLAGS) - -tran/quantize.o: tran/quantize.c tran/quantize.h $(NYQDEP) - $(CC) -c tran/quantize.c -o tran/quantize.o $(CFLAGS) - -tran/recip.o: tran/recip.c tran/recip.h $(NYQDEP) - $(CC) -c tran/recip.c -o tran/recip.o $(CFLAGS) - -tran/reson.o: tran/reson.c tran/reson.h $(NYQDEP) - $(CC) -c tran/reson.c -o tran/reson.o $(CFLAGS) - -tran/resonvc.o: tran/resonvc.c tran/resonvc.h $(NYQDEP) - $(CC) -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) - -tran/resoncv.o: tran/resoncv.c tran/resoncv.h $(NYQDEP) - $(CC) -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) - -tran/resonvv.o: tran/resonvv.c tran/resonvv.h $(NYQDEP) - $(CC) -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) - -tran/sampler.o: tran/sampler.c tran/sampler.h $(NYQDEP) - $(CC) -c tran/sampler.c -o tran/sampler.o $(CFLAGS) - -tran/scale.o: tran/scale.c tran/scale.h $(NYQDEP) - $(CC) -c tran/scale.c -o tran/scale.o $(CFLAGS) - -tran/shape.o: tran/shape.c tran/shape.h $(NYQDEP) - $(CC) -c tran/shape.c -o tran/shape.o $(CFLAGS) - -tran/sine.o: tran/sine.c tran/sine.h $(NYQDEP) - $(CC) -c tran/sine.c -o tran/sine.o $(CFLAGS) - -tran/siosc.o: tran/siosc.c tran/siosc.h $(NYQDEP) - $(CC) -c tran/siosc.c -o tran/siosc.o $(CFLAGS) - -tran/slope.o: tran/slope.c tran/slope.h $(NYQDEP) - $(CC) -c tran/slope.c -o tran/slope.o $(CFLAGS) - -tran/sqrt.o: tran/sqrt.c tran/sqrt.h $(NYQDEP) - $(CC) -c tran/sqrt.c -o tran/sqrt.o $(CFLAGS) - -tran/tapf.o: tran/tapf.c tran/tapf.h $(NYQDEP) - $(CC) -c tran/tapf.c -o tran/tapf.o $(CFLAGS) - -tran/tapv.o: tran/tapv.c tran/tapv.h $(NYQDEP) - $(CC) -c tran/tapv.c -o tran/tapv.o $(CFLAGS) - -tran/tone.o: tran/tone.c tran/tone.h $(NYQDEP) - $(CC) -c tran/tone.c -o tran/tone.o $(CFLAGS) - -tran/tonev.o: tran/tonev.c tran/tonev.h $(NYQDEP) - $(CC) -c tran/tonev.c -o tran/tonev.o $(CFLAGS) - -tran/upsample.o: tran/upsample.c tran/upsample.h $(NYQDEP) - $(CC) -c tran/upsample.c -o tran/upsample.o $(CFLAGS) - -tran/white.o: tran/white.c tran/white.h $(NYQDEP) - $(CC) -c tran/white.c -o tran/white.o $(CFLAGS) - -tran/stkrev.o: tran/stkrev.c tran/stkrev.h $(NYQDEP) - $(CC) -c tran/stkrev.c -o tran/stkrev.o $(CFLAGS) - -tran/stkpitshift.o: tran/stkpitshift.c tran/stkpitshift.h $(NYQDEP) - $(CC) -c tran/stkpitshift.c -o tran/stkpitshift.o $(CFLAGS) - -tran/stkchorus.o: tran/stkchorus.c tran/stkchorus.h $(NYQDEP) - $(CC) -c tran/stkchorus.c -o tran/stkchorus.o $(CFLAGS) - -tran/instrbow.o: tran/instrbow.c tran/instrbow.h $(NYQDEP) - $(CC) -c tran/instrbow.c -o tran/instrbow.o $(CFLAGS) - -tran/instrbowedfreq.o: tran/instrbowedfreq.c tran/instrbowedfreq.h $(NYQDEP) - $(CC) -c tran/instrbowedfreq.c -o tran/instrbowedfreq.o $(CFLAGS) - -tran/instrbanded.o: tran/instrbanded.c tran/instrbanded.h $(NYQDEP) - $(CC) -c tran/instrbanded.c -o tran/instrbanded.o $(CFLAGS) - -tran/instrmandolin.o: tran/instrmandolin.c tran/instrmandolin.h $(NYQDEP) - $(CC) -c tran/instrmandolin.c -o tran/instrmandolin.o $(CFLAGS) - -tran/instrsitar.o: tran/instrsitar.c tran/instrsitar.h $(NYQDEP) - $(CC) -c tran/instrsitar.c -o tran/instrsitar.o $(CFLAGS) - -tran/instrmodalbar.o: tran/instrmodalbar.c tran/instrmodalbar.h $(NYQDEP) - $(CC) -c tran/instrmodalbar.c -o tran/instrmodalbar.o $(CFLAGS) - -tran/instrflute.o: tran/instrflute.c tran/instrflute.h $(NYQDEP) - $(CC) -c tran/instrflute.c -o tran/instrflute.o $(CFLAGS) - -tran/instrflutefreq.o: tran/instrflutefreq.c tran/instrflutefreq.h $(NYQDEP) - $(CC) -c tran/instrflutefreq.c -o tran/instrflutefreq.o $(CFLAGS) - -tran/instrfluteall.o: tran/instrfluteall.c tran/instrfluteall.h $(NYQDEP) - $(CC) -c tran/instrfluteall.c -o tran/instrfluteall.o $(CFLAGS) - -tran/fmfb.o: tran/fmfb.c tran/fmfb.h $(NYQDEP) - $(CC) -c tran/fmfb.c -o tran/fmfb.o $(CFLAGS) - -tran/fmfbv.o: tran/fmfbv.c tran/fmfbv.h $(NYQDEP) - $(CC) -c tran/fmfbv.c -o tran/fmfbv.o $(CFLAGS) - -nyqsrc/sndfnint.o: nyqsrc/sndfnint.c - $(CC) -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) - -nyqsrc/seqfnint.o: nyqsrc/seqfnint.c - $(CC) -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) - -nyqstk/stkinit.o: nyqstk/stkinit.cpp nyqstk/stkinit.h - g++ -c nyqstk/stkinit.cpp -o nyqstk/stkinit.o $(CFLAGS) - -nyqstk/instr.o: nyqstk/instr.cpp nyqstk/instr.h - g++ -c nyqstk/instr.cpp -o nyqstk/instr.o $(CFLAGS) - -nyqstk/stkint.o: nyqstk/stkint.cpp nyqstk/stkint.h - g++ -c nyqstk/stkint.cpp -o nyqstk/stkint.o $(CFLAGS) - -nyqstk/src/Generator.o: nyqstk/src/Generator.cpp nyqstk/include/Generator.h - g++ -c nyqstk/src/Generator.cpp -o nyqstk/src/Generator.o $(CFLAGS) - -nyqstk/src/SineWave.o: nyqstk/src/SineWave.cpp nyqstk/include/SineWave.h - g++ -c nyqstk/src/SineWave.cpp -o nyqstk/src/SineWave.o $(CFLAGS) - -nyqstk/src/Function.o: nyqstk/src/Function.cpp nyqstk/include/Function.h - g++ -c nyqstk/src/Function.cpp -o nyqstk/src/Function.o $(CFLAGS) - -nyqstk/src/FileRead.o: nyqstk/src/FileRead.cpp nyqstk/include/FileRead.h - g++ -c nyqstk/src/FileRead.cpp -o nyqstk/src/FileRead.o $(CFLAGS) - -nyqstk/src/FileWvIn.o: nyqstk/src/FileWvIn.cpp nyqstk/include/FileWvIn.h - g++ -c nyqstk/src/FileWvIn.cpp -o nyqstk/src/FileWvIn.o $(CFLAGS) - -nyqstk/src/Effect.o: nyqstk/src/Effect.cpp nyqstk/include/Effect.h - g++ -c nyqstk/src/Effect.cpp -o nyqstk/src/Effect.o $(CFLAGS) - -nyqstk/src/Clarinet.o: nyqstk/src/Clarinet.cpp nyqstk/include/Clarinet.h - g++ -c nyqstk/src/Clarinet.cpp -o nyqstk/src/Clarinet.o $(CFLAGS) - -nyqstk/src/Delay.o: nyqstk/src/Delay.cpp nyqstk/include/Delay.h - g++ -c nyqstk/src/Delay.cpp -o nyqstk/src/Delay.o $(CFLAGS) - -nyqstk/src/DelayL.o: nyqstk/src/DelayL.cpp nyqstk/include/DelayL.h - g++ -c nyqstk/src/DelayL.cpp -o nyqstk/src/DelayL.o $(CFLAGS) - -nyqstk/src/Envelope.o: nyqstk/src/Envelope.cpp nyqstk/include/Envelope.h - g++ -c nyqstk/src/Envelope.cpp -o nyqstk/src/Envelope.o $(CFLAGS) - -nyqstk/src/Filter.o: nyqstk/src/Filter.cpp nyqstk/include/Filter.h - g++ -c nyqstk/src/Filter.cpp -o nyqstk/src/Filter.o $(CFLAGS) - -nyqstk/src/Instrmnt.o: nyqstk/src/Instrmnt.cpp nyqstk/include/Instrmnt.h - g++ -c nyqstk/src/Instrmnt.cpp -o nyqstk/src/Instrmnt.o $(CFLAGS) - -nyqstk/src/Noise.o: nyqstk/src/Noise.cpp nyqstk/include/Noise.h - g++ -c nyqstk/src/Noise.cpp -o nyqstk/src/Noise.o $(CFLAGS) - -nyqstk/src/OneZero.o: nyqstk/src/OneZero.cpp nyqstk/include/OneZero.h - g++ -c nyqstk/src/OneZero.cpp -o nyqstk/src/OneZero.o $(CFLAGS) - -nyqstk/src/ReedTable.o: nyqstk/src/ReedTable.cpp nyqstk/include/ReedTable.h - g++ -c nyqstk/src/ReedTable.cpp -o nyqstk/src/ReedTable.o $(CFLAGS) - -nyqstk/src/Saxofony.o: nyqstk/src/Saxofony.cpp nyqstk/include/Saxofony.h - g++ -c nyqstk/src/Saxofony.cpp -o nyqstk/src/Saxofony.o $(CFLAGS) - -nyqstk/src/Stk.o: nyqstk/src/Stk.cpp nyqstk/include/Stk.h - g++ -c nyqstk/src/Stk.cpp -o nyqstk/src/Stk.o $(CFLAGS) - -nyqstk/src/WaveLoop.o: nyqstk/src/WaveLoop.cpp nyqstk/include/WaveLoop.h - g++ -c nyqstk/src/WaveLoop.cpp -o nyqstk/src/WaveLoop.o $(CFLAGS) - -nyqstk/src/WvIn.o: nyqstk/src/WvIn.cpp nyqstk/include/WvIn.h - g++ -c nyqstk/src/WvIn.cpp -o nyqstk/src/WvIn.o $(CFLAGS) - -nyqstk/src/NRev.o: nyqstk/src/NRev.cpp nyqstk/include/NRev.h - g++ -c nyqstk/src/NRev.cpp -o nyqstk/src/NRev.o $(CFLAGS) - -nyqstk/src/JCRev.o: nyqstk/src/JCRev.cpp nyqstk/include/JCRev.h - g++ -c nyqstk/src/JCRev.cpp -o nyqstk/src/JCRev.o $(CFLAGS) - -nyqstk/src/PRCRev.o: nyqstk/src/PRCRev.cpp nyqstk/include/PRCRev.h - g++ -c nyqstk/src/PRCRev.cpp -o nyqstk/src/PRCRev.o $(CFLAGS) - -nyqstk/src/PitShift.o: nyqstk/src/PitShift.cpp nyqstk/include/PitShift.h - g++ -c nyqstk/src/PitShift.cpp -o nyqstk/src/PitShift.o $(CFLAGS) - -nyqstk/src/Chorus.o: nyqstk/src/Chorus.cpp nyqstk/include/Chorus.h - g++ -c nyqstk/src/Chorus.cpp -o nyqstk/src/Chorus.o $(CFLAGS) - -nyqstk/src/Bowed.o: nyqstk/src/Bowed.cpp nyqstk/include/Bowed.h - g++ -c nyqstk/src/Bowed.cpp -o nyqstk/src/Bowed.o $(CFLAGS) - -nyqstk/src/BowTable.o: nyqstk/src/BowTable.cpp nyqstk/include/BowTable.h - g++ -c nyqstk/src/BowTable.cpp -o nyqstk/src/BowTable.o $(CFLAGS) - -nyqstk/src/ADSR.o: nyqstk/src/ADSR.cpp nyqstk/include/ADSR.h - g++ -c nyqstk/src/ADSR.cpp -o nyqstk/src/ADSR.o $(CFLAGS) - -nyqstk/src/OnePole.o: nyqstk/src/OnePole.cpp nyqstk/include/OnePole.h - g++ -c nyqstk/src/OnePole.cpp -o nyqstk/src/OnePole.o $(CFLAGS) - -nyqstk/src/BiQuad.o: nyqstk/src/BiQuad.cpp nyqstk/include/BiQuad.h - g++ -c nyqstk/src/BiQuad.cpp -o nyqstk/src/BiQuad.o $(CFLAGS) - -nyqstk/src/BandedWG.o: nyqstk/src/BandedWG.cpp nyqstk/include/BandedWG.h - g++ -c nyqstk/src/BandedWG.cpp -o nyqstk/src/BandedWG.o $(CFLAGS) - -nyqstk/src/DelayA.o: nyqstk/src/DelayA.cpp nyqstk/include/DelayA.h - g++ -c nyqstk/src/DelayA.cpp -o nyqstk/src/DelayA.o $(CFLAGS) - -nyqstk/src/Mandolin.o: nyqstk/src/Mandolin.cpp nyqstk/include/Mandolin.h - g++ -c nyqstk/src/Mandolin.cpp -o nyqstk/src/Mandolin.o $(CFLAGS) - -nyqstk/src/PluckTwo.o: nyqstk/src/PluckTwo.cpp nyqstk/include/PluckTwo.h - g++ -c nyqstk/src/PluckTwo.cpp -o nyqstk/src/PluckTwo.o $(CFLAGS) - -nyqstk/src/Sitar.o: nyqstk/src/Sitar.cpp nyqstk/include/Sitar.h - g++ -c nyqstk/src/Sitar.cpp -o nyqstk/src/Sitar.o $(CFLAGS) - -nyqstk/src/ModalBar.o: nyqstk/src/ModalBar.cpp nyqstk/include/ModalBar.h - g++ -c nyqstk/src/ModalBar.cpp -o nyqstk/src/ModalBar.o $(CFLAGS) - -nyqstk/src/Modal.o: nyqstk/src/Modal.cpp nyqstk/include/Modal.h - g++ -c nyqstk/src/Modal.cpp -o nyqstk/src/Modal.o $(CFLAGS) - -nyqstk/src/Flute.o: nyqstk/src/Flute.cpp nyqstk/include/Flute.h - g++ -c nyqstk/src/Flute.cpp -o nyqstk/src/Flute.o $(CFLAGS) - -nyqstk/src/JetTable.o: nyqstk/src/JetTable.cpp nyqstk/include/JetTable.h - g++ -c nyqstk/src/JetTable.cpp -o nyqstk/src/JetTable.o $(CFLAGS) - -nyqstk/src/PoleZero.o: nyqstk/src/PoleZero.cpp nyqstk/include/PoleZero.h - g++ -c nyqstk/src/PoleZero.cpp -o nyqstk/src/PoleZero.o $(CFLAGS) - -xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h - $(CC) -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) - -xlisp/extern.o: xlisp/extern.c - $(CC) -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) - -xlisp/xldmem.o: xlisp/xldmem.c - $(CC) -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) - -xlisp/xlbfun.o: xlisp/xlbfun.c - $(CC) -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) - -xlisp/xlcont.o: xlisp/xlcont.c - $(CC) -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) - -xlisp/xldbug.o: xlisp/xldbug.c - $(CC) -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) - -xlisp/xleval.o: xlisp/xleval.c - $(CC) -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) - -xlisp/xlfio.o: xlisp/xlfio.c - $(CC) -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) - -xlisp/xlglob.o: xlisp/xlglob.c - $(CC) -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) - -xlisp/xlimage.o: xlisp/xlimage.c - $(CC) -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) - -xlisp/xlinit.o: xlisp/xlinit.c - $(CC) -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) - -xlisp/xlio.o: xlisp/xlio.c - $(CC) -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) - -xlisp/xlisp.o: xlisp/xlisp.c - $(CC) -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) - -xlisp/xljump.o: xlisp/xljump.c - $(CC) -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) - -xlisp/xllist.o: xlisp/xllist.c - $(CC) -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) - -xlisp/xlmath.o: xlisp/xlmath.c - $(CC) -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) - -xlisp/xlobj.o: xlisp/xlobj.c - $(CC) -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) - -xlisp/xlpp.o: xlisp/xlpp.c - $(CC) -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) - -xlisp/xlprin.o: xlisp/xlprin.c - $(CC) -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) - -xlisp/xlread.o: xlisp/xlread.c - $(CC) -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) - -xlisp/xlstr.o: xlisp/xlstr.c - $(CC) -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) - -xlisp/xlsubr.o: xlisp/xlsubr.c - $(CC) -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) - -xlisp/xlsym.o: xlisp/xlsym.c - $(CC) -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) - -xlisp/xlsys.o: xlisp/xlsys.c - $(CC) -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) - -xlisp/path.o: xlisp/path.c - $(CC) -c xlisp/path.c -o xlisp/path.o $(CFLAGS) - -cmt/cext.o: cmt/cext.c - $(CC) -c cmt/cext.c -o cmt/cext.o $(CFLAGS) - -cmt/cleanup.o: cmt/cleanup.c - $(CC) -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) - -cmt/cmdline.o: cmt/cmdline.c - $(CC) -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) - -cmt/cmtcmd.o: cmt/cmtcmd.c - $(CC) -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) - -cmt/moxc.o: cmt/moxc.c - $(CC) -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) - -cmt/mem.o: cmt/mem.c - $(CC) -c cmt/mem.c -o cmt/mem.o $(CFLAGS) - -cmt/midifile.o: cmt/midifile.c - $(CC) -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) - -cmt/midifns.o: cmt/midifns.c - $(CC) -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) - -cmt/record.o: cmt/record.c - $(CC) -c cmt/record.c -o cmt/record.o $(CFLAGS) - -cmt/seq.o: cmt/seq.c - $(CC) -c cmt/seq.c -o cmt/seq.o $(CFLAGS) - -cmt/seqmread.o: cmt/seqmread.c - $(CC) -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) - -cmt/seqmwrite.o: cmt/seqmwrite.c - $(CC) -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) - -cmt/seqread.o: cmt/seqread.c - $(CC) -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) - -cmt/seqwrite.o: cmt/seqwrite.c - $(CC) -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) - -cmt/tempomap.o: cmt/tempomap.c - $(CC) -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) - -cmt/timebase.o: cmt/timebase.c - $(CC) -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) - -cmt/userio.o: cmt/userio.c - $(CC) -c cmt/userio.c -o cmt/userio.o $(CFLAGS) - -nylsf/aiff.o: nylsf/aiff.c - $(CC) -c nylsf/aiff.c -o nylsf/aiff.o $(CFLAGS) - -nylsf/alaw.o: nylsf/alaw.c - $(CC) -c nylsf/alaw.c -o nylsf/alaw.o $(CFLAGS) - -nylsf/au.o: nylsf/au.c - $(CC) -c nylsf/au.c -o nylsf/au.o $(CFLAGS) - -nylsf/audio_detect.o: nylsf/audio_detect.c - $(CC) -c nylsf/audio_detect.c -o nylsf/audio_detect.o $(CFLAGS) - -nylsf/avr.o: nylsf/avr.c - $(CC) -c nylsf/avr.c -o nylsf/avr.o $(CFLAGS) - -nylsf/broadcast.o: nylsf/broadcast.c - $(CC) -c nylsf/broadcast.c -o nylsf/broadcast.o $(CFLAGS) - -nylsf/caf.o: nylsf/caf.c - $(CC) -c nylsf/caf.c -o nylsf/caf.o $(CFLAGS) - -nylsf/chanmap.o: nylsf/chanmap.c - $(CC) -c nylsf/chanmap.c -o nylsf/chanmap.o $(CFLAGS) - -nylsf/chunk.o: nylsf/chunk.c - $(CC) -c nylsf/chunk.c -o nylsf/chunk.o $(CFLAGS) - -nylsf/command.o: nylsf/command.c - $(CC) -c nylsf/command.c -o nylsf/command.o $(CFLAGS) - -nylsf/common.o: nylsf/common.c - $(CC) -c nylsf/common.c -o nylsf/common.o $(CFLAGS) - -nylsf/dither.o: nylsf/dither.c - $(CC) -c nylsf/dither.c -o nylsf/dither.o $(CFLAGS) - -nylsf/double64.o: nylsf/double64.c - $(CC) -c nylsf/double64.c -o nylsf/double64.o $(CFLAGS) - -nylsf/dwd.o: nylsf/dwd.c - $(CC) -c nylsf/dwd.c -o nylsf/dwd.o $(CFLAGS) - -nylsf/dwvw.o: nylsf/dwvw.c - $(CC) -c nylsf/dwvw.c -o nylsf/dwvw.o $(CFLAGS) - -nylsf/file_io.o: nylsf/file_io.c - $(CC) -c nylsf/file_io.c -o nylsf/file_io.o $(CFLAGS) - -nylsf/flac.o: nylsf/flac.c - $(CC) -c nylsf/flac.c -o nylsf/flac.o $(CFLAGS) - -nylsf/float32.o: nylsf/float32.c - $(CC) -c nylsf/float32.c -o nylsf/float32.o $(CFLAGS) - -nylsf/gsm610.o: nylsf/gsm610.c - $(CC) -c nylsf/gsm610.c -o nylsf/gsm610.o $(CFLAGS) - -nylsf/htk.o: nylsf/htk.c - $(CC) -c nylsf/htk.c -o nylsf/htk.o $(CFLAGS) - -nylsf/id3.o: nylsf/id3.c - $(CC) -c nylsf/id3.c -o nylsf/id3.o $(CFLAGS) - -nylsf/ima_adpcm.o: nylsf/ima_adpcm.c - $(CC) -c nylsf/ima_adpcm.c -o nylsf/ima_adpcm.o $(CFLAGS) - -nylsf/ima_oki_adpcm.o: nylsf/ima_oki_adpcm.c - $(CC) -c nylsf/ima_oki_adpcm.c -o nylsf/ima_oki_adpcm.o $(CFLAGS) - -nylsf/interleave.o: nylsf/interleave.c - $(CC) -c nylsf/interleave.c -o nylsf/interleave.o $(CFLAGS) - -nylsf/ircam.o: nylsf/ircam.c - $(CC) -c nylsf/ircam.c -o nylsf/ircam.o $(CFLAGS) - -nylsf/macbinary3.o: nylsf/macbinary3.c - $(CC) -c nylsf/macbinary3.c -o nylsf/macbinary3.o $(CFLAGS) - -nylsf/macos.o: nylsf/macos.c - $(CC) -c nylsf/macos.c -o nylsf/macos.o $(CFLAGS) - -nylsf/mat4.o: nylsf/mat4.c - $(CC) -c nylsf/mat4.c -o nylsf/mat4.o $(CFLAGS) - -nylsf/mat5.o: nylsf/mat5.c - $(CC) -c nylsf/mat5.c -o nylsf/mat5.o $(CFLAGS) - -nylsf/mpc2k.o: nylsf/mpc2k.c - $(CC) -c nylsf/mpc2k.c -o nylsf/mpc2k.o $(CFLAGS) - -nylsf/ms_adpcm.o: nylsf/ms_adpcm.c - $(CC) -c nylsf/ms_adpcm.c -o nylsf/ms_adpcm.o $(CFLAGS) - -nylsf/nist.o: nylsf/nist.c - $(CC) -c nylsf/nist.c -o nylsf/nist.o $(CFLAGS) - -nylsf/ogg.o: nylsf/ogg.c - $(CC) -c nylsf/ogg.c -o nylsf/ogg.o $(CFLAGS) - -nylsf/ogg_vorbis.o: nylsf/ogg_vorbis.c - $(CC) -c nylsf/ogg_vorbis.c -o nylsf/ogg_vorbis.o $(CFLAGS) - -nylsf/paf.o: nylsf/paf.c - $(CC) -c nylsf/paf.c -o nylsf/paf.o $(CFLAGS) - -nylsf/pcm.o: nylsf/pcm.c - $(CC) -c nylsf/pcm.c -o nylsf/pcm.o $(CFLAGS) - -nylsf/pvf.o: nylsf/pvf.c - $(CC) -c nylsf/pvf.c -o nylsf/pvf.o $(CFLAGS) - -nylsf/raw.o: nylsf/raw.c - $(CC) -c nylsf/raw.c -o nylsf/raw.o $(CFLAGS) - -nylsf/rf64.o: nylsf/rf64.c - $(CC) -c nylsf/rf64.c -o nylsf/rf64.o $(CFLAGS) - -nylsf/rx2.o: nylsf/rx2.c - $(CC) -c nylsf/rx2.c -o nylsf/rx2.o $(CFLAGS) - -nylsf/sd2.o: nylsf/sd2.c - $(CC) -c nylsf/sd2.c -o nylsf/sd2.o $(CFLAGS) - -nylsf/sds.o: nylsf/sds.c - $(CC) -c nylsf/sds.c -o nylsf/sds.o $(CFLAGS) - -nylsf/sndfile.o: nylsf/sndfile.c - $(CC) -c nylsf/sndfile.c -o nylsf/sndfile.o $(CFLAGS) - -nylsf/strings.o: nylsf/strings.c - $(CC) -c nylsf/strings.c -o nylsf/strings.o $(CFLAGS) - -nylsf/svx.o: nylsf/svx.c - $(CC) -c nylsf/svx.c -o nylsf/svx.o $(CFLAGS) - -nylsf/txw.o: nylsf/txw.c - $(CC) -c nylsf/txw.c -o nylsf/txw.o $(CFLAGS) - -nylsf/ulaw.o: nylsf/ulaw.c - $(CC) -c nylsf/ulaw.c -o nylsf/ulaw.o $(CFLAGS) - -nylsf/voc.o: nylsf/voc.c - $(CC) -c nylsf/voc.c -o nylsf/voc.o $(CFLAGS) - -nylsf/vox_adpcm.o: nylsf/vox_adpcm.c - $(CC) -c nylsf/vox_adpcm.c -o nylsf/vox_adpcm.o $(CFLAGS) - -nylsf/w64.o: nylsf/w64.c - $(CC) -c nylsf/w64.c -o nylsf/w64.o $(CFLAGS) - -nylsf/wav.o: nylsf/wav.c - $(CC) -c nylsf/wav.c -o nylsf/wav.o $(CFLAGS) - -nylsf/wav_w64.o: nylsf/wav_w64.c - $(CC) -c nylsf/wav_w64.c -o nylsf/wav_w64.o $(CFLAGS) - -nylsf/wve.o: nylsf/wve.c - $(CC) -c nylsf/wve.c -o nylsf/wve.o $(CFLAGS) - -nylsf/xi.o: nylsf/xi.c - $(CC) -c nylsf/xi.c -o nylsf/xi.o $(CFLAGS) - -nylsf/g72x.o: nylsf/g72x.c - $(CC) -c nylsf/g72x.c -o nylsf/g72x.o $(CFLAGS) - -nylsf/GSM610/add.o: nylsf/GSM610/add.c - $(CC) -c nylsf/GSM610/add.c -o nylsf/GSM610/add.o $(CFLAGS) - -nylsf/GSM610/code.o: nylsf/GSM610/code.c - $(CC) -c nylsf/GSM610/code.c -o nylsf/GSM610/code.o $(CFLAGS) - -nylsf/GSM610/decode.o: nylsf/GSM610/decode.c - $(CC) -c nylsf/GSM610/decode.c -o nylsf/GSM610/decode.o $(CFLAGS) - -nylsf/GSM610/gsm_create.o: nylsf/GSM610/gsm_create.c - $(CC) -c nylsf/GSM610/gsm_create.c -o nylsf/GSM610/gsm_create.o $(CFLAGS) - -nylsf/GSM610/gsm_decode.o: nylsf/GSM610/gsm_decode.c - $(CC) -c nylsf/GSM610/gsm_decode.c -o nylsf/GSM610/gsm_decode.o $(CFLAGS) - -nylsf/GSM610/gsm_destroy.o: nylsf/GSM610/gsm_destroy.c - $(CC) -c nylsf/GSM610/gsm_destroy.c -o nylsf/GSM610/gsm_destroy.o $(CFLAGS) - -nylsf/GSM610/gsm_encode.o: nylsf/GSM610/gsm_encode.c - $(CC) -c nylsf/GSM610/gsm_encode.c -o nylsf/GSM610/gsm_encode.o $(CFLAGS) - -nylsf/GSM610/gsm_option.o: nylsf/GSM610/gsm_option.c - $(CC) -c nylsf/GSM610/gsm_option.c -o nylsf/GSM610/gsm_option.o $(CFLAGS) - -nylsf/GSM610/long_term.o: nylsf/GSM610/long_term.c - $(CC) -c nylsf/GSM610/long_term.c -o nylsf/GSM610/long_term.o $(CFLAGS) - -nylsf/GSM610/lpc.o: nylsf/GSM610/lpc.c - $(CC) -c nylsf/GSM610/lpc.c -o nylsf/GSM610/lpc.o $(CFLAGS) - -nylsf/GSM610/preprocess.o: nylsf/GSM610/preprocess.c - $(CC) -c nylsf/GSM610/preprocess.c -o nylsf/GSM610/preprocess.o $(CFLAGS) - -nylsf/GSM610/rpe.o: nylsf/GSM610/rpe.c - $(CC) -c nylsf/GSM610/rpe.c -o nylsf/GSM610/rpe.o $(CFLAGS) - -nylsf/GSM610/short_term.o: nylsf/GSM610/short_term.c - $(CC) -c nylsf/GSM610/short_term.c -o nylsf/GSM610/short_term.o $(CFLAGS) - -nylsf/GSM610/table.o: nylsf/GSM610/table.c - $(CC) -c nylsf/GSM610/table.c -o nylsf/GSM610/table.o $(CFLAGS) - -nylsf/G72x/g721.o: nylsf/G72x/g721.c - $(CC) -c nylsf/G72x/g721.c -o nylsf/G72x/g721.o $(CFLAGS) - -nylsf/G72x/g723_16.o: nylsf/G72x/g723_16.c - $(CC) -c nylsf/G72x/g723_16.c -o nylsf/G72x/g723_16.o $(CFLAGS) - -nylsf/G72x/g723_24.o: nylsf/G72x/g723_24.c - $(CC) -c nylsf/G72x/g723_24.c -o nylsf/G72x/g723_24.o $(CFLAGS) - -nylsf/G72x/g723_40.o: nylsf/G72x/g723_40.c - $(CC) -c nylsf/G72x/g723_40.c -o nylsf/G72x/g723_40.o $(CFLAGS) - -nylsf/G72x/g72x.o: nylsf/G72x/g72x.c - $(CC) -c nylsf/G72x/g72x.c -o nylsf/G72x/g72x.o $(CFLAGS) - -sys/unix/osstuff.o: sys/unix/osstuff.c - $(CC) -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) - -misc/intgen: misc/intgen.c - cd misc; make intgen - -nyqsrc/sndfnintptrs.h: $(SNDFNINT_HDRS) misc/intgen Makefile - $(INTGEN) nyqsrc/sndfnint $(SNDFNINT_HDRS) - -nyqsrc/seqfnintptrs.h: $(SEQFNINT_HDRS) misc/intgen Makefile - $(INTGEN) nyqsrc/seqfnint $(SEQFNINT_HDRS) - -clean: - cd misc; make clean - cd liblo; test -f Makefile && make clean || true - cd portaudio; test -f Makefile && make clean || true - rm -f $(OBJECTS) -# These could be deleted, but they're part of the release, so we won't -# Note that these files are machine-generated: -# rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h -# rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h - -cleaner: clean - cd misc; make cleaner - rm -f *.backup */*.backup - rm -f *~ */*.*~ - rm -f #*# */#*# - rm -f *.save */*.save - rm -f *.CKP */*.CKP - rm -f *.BAK */*.BAK - rm -f *.old */*.old - rm -f *.gold */*.gold - rm -f playparms - rm -f points.dat - rm -f core.* core - rm -f $(NY) diff --git a/lib-src/libnyquist/nyquist/sys/unix/next/Makefile b/lib-src/libnyquist/nyquist/sys/unix/next/Makefile deleted file mode 100644 index 10817d1d7..000000000 --- a/lib-src/libnyquist/nyquist/sys/unix/next/Makefile +++ /dev/null @@ -1,521 +0,0 @@ -# -# Makefile for Nyquist, SYSTEM-TYPE is NEXT -# run make in the top-level Nyquist directory to compile Nyquist -# -# NOTE: this file is machine-generated. DO NOT EDIT! -# Instead, modify makefile.lsp and regenerate the makefile. -# Ports and bug fixes are welcome - please mail them to -# dannenberg@cs.cmu.edu. Thanks. -# - -# This is the resulting executable (normally "ny"): -NY = ny - -# Standard list of includes (common to all unix versions) -INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft - -# system dependent stuff for next: - -CC = cc -CFLAGS = -DCMTSTUFF -O $(INCL) -LN = cc -LFLAGS = -lm - - -INTGEN = misc/intgen - -# Object files for Nyquist: -OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ - xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ - xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ - xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ - xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ - xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ - tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ - tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ - tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ - tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ - tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ - tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ - tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ - tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ - tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ - tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ - tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ - tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ - tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ - cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ - cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ - cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ - cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ - cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ - nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ - nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ - nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ - nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ - nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ - nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ - nyqsrc/seqfnint.o snd/audionext.o snd/sndnext.o snd/ieeecvt.o \ - snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ - sys/unix/osstuff.o sys/unix/term.o - -# Sound functions to add to xlisp -NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ - nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ - nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ - nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ - tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ - tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ - tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ - tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ - tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ - tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ - tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ - tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ - tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ - tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ - tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ - tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ - tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h - -CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ - cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h - - -EVERYTHING = $(NY) runtime/system.lsp - -CURRENT = $(EVERYTHING) - -current: $(CURRENT) - -$(NY): $(OBJECTS) - $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) - -# copy appropriate system.lsp and make it read-only; -# changes should be made to sys/unix//system.lsp -runtime/system.lsp: sys/unix/next/system.lsp - chmod +w runtime/system.lsp - cp -p sys/unix/next/system.lsp runtime/system.lsp - chmod -w runtime/system.lsp - -nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) - -nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) - -nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) - -nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h - cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) - -nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) - -nyqsrc/handlers.o: nyqsrc/handlers.c - cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) - -nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) - -nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) - -nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) - -nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) - -nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) - -nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) - -nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) - -nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) - -nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) - -nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) - -nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) - -nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) - -nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) - -nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) - -nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) - -nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) - -nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) - -nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) - -nyqsrc/sndfail.o: nyqsrc/sndfail.c - cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) - -snd/audionext.o: snd/audionext.c snd/snd.h - cc -c snd/audionext.c -o snd/audionext.o $(CFLAGS) - -snd/sndnext.o: snd/sndnext.c snd/sndnext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndnext.c -o snd/sndnext.o $(CFLAGS) - -snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) - -snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/snd.c -o snd/snd.o $(CFLAGS) - -snd/sndcvt.o: snd/sndcvt.c snd/snd.h - cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) - -snd/sndio.o: snd/sndio.c snd/snd.h - cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) - -snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) - -fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) - -tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) - -tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/clip.c -o tran/clip.o $(CFLAGS) - -tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/const.c -o tran/const.o $(CFLAGS) - -tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) - -tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) - -tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/log.c -o tran/log.o $(CFLAGS) - -tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) - -tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/osc.c -o tran/osc.o $(CFLAGS) - -tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/prod.c -o tran/prod.o $(CFLAGS) - -tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) - -tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) - -tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/recip.c -o tran/recip.o $(CFLAGS) - -tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) - -tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/scale.c -o tran/scale.o $(CFLAGS) - -tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sine.c -o tran/sine.o $(CFLAGS) - -tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/partial.c -o tran/partial.o $(CFLAGS) - -tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/white.c -o tran/white.o $(CFLAGS) - -tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tone.c -o tran/tone.o $(CFLAGS) - -tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) - -tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) - -tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atone.c -o tran/atone.o $(CFLAGS) - -tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/reson.c -o tran/reson.o $(CFLAGS) - -tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/areson.c -o tran/areson.o $(CFLAGS) - -tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) - -tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) - -tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) - -tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) - -tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) - -tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) - -tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/offset.c -o tran/offset.o $(CFLAGS) - -tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/slope.c -o tran/slope.o $(CFLAGS) - -tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) - -tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) - -tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/shape.c -o tran/shape.o $(CFLAGS) - -tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) - -tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/exp.c -o tran/exp.o $(CFLAGS) - -tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) - -tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/follow.c -o tran/follow.o $(CFLAGS) - -tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/gate.c -o tran/gate.o $(CFLAGS) - -tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) - -tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) - -tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/congen.c -o tran/congen.o $(CFLAGS) - -tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) - -tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) - -tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) - -tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) - -tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) - -tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) - -tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/chase.c -o tran/chase.o $(CFLAGS) - -tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) - -tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) - -tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) - -nyqsrc/sndfnint.o: nyqsrc/sndfnint.c - cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) - -nyqsrc/seqfnint.o: nyqsrc/seqfnint.c - cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) - -xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h - cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) - -xlisp/extern.o: xlisp/extern.c - cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) - -xlisp/xldmem.o: xlisp/xldmem.c - cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) - -xlisp/xlbfun.o: xlisp/xlbfun.c - cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) - -xlisp/xlcont.o: xlisp/xlcont.c - cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) - -xlisp/xldbug.o: xlisp/xldbug.c - cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) - -xlisp/xleval.o: xlisp/xleval.c - cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) - -xlisp/xlfio.o: xlisp/xlfio.c - cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) - -xlisp/xlglob.o: xlisp/xlglob.c - cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) - -xlisp/xlimage.o: xlisp/xlimage.c - cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) - -xlisp/xlinit.o: xlisp/xlinit.c - cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) - -xlisp/xlio.o: xlisp/xlio.c - cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) - -xlisp/xlisp.o: xlisp/xlisp.c - cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) - -xlisp/xllist.o: xlisp/xllist.c - cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) - -xlisp/xlmath.o: xlisp/xlmath.c - cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) - -xlisp/xlobj.o: xlisp/xlobj.c - cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) - -xlisp/xlpp.o: xlisp/xlpp.c - cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) - -xlisp/xlprin.o: xlisp/xlprin.c - cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) - -xlisp/xlread.o: xlisp/xlread.c - cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) - -xlisp/xlstr.o: xlisp/xlstr.c - cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) - -xlisp/xlsubr.o: xlisp/xlsubr.c - cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) - -xlisp/xlsym.o: xlisp/xlsym.c - cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) - -xlisp/xlsys.o: xlisp/xlsys.c - cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) - -cmt/cext.o: cmt/cext.c - cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) - -cmt/cleanup.o: cmt/cleanup.c - cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) - -cmt/cmdline.o: cmt/cmdline.c - cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) - -cmt/cmtcmd.o: cmt/cmtcmd.c - cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) - -cmt/moxc.o: cmt/moxc.c - cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) - -cmt/mem.o: cmt/mem.c - cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) - -cmt/midifile.o: cmt/midifile.c - cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) - -cmt/midifns.o: cmt/midifns.c - cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) - -cmt/record.o: cmt/record.c - cc -c cmt/record.c -o cmt/record.o $(CFLAGS) - -cmt/seq.o: cmt/seq.c - cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) - -cmt/seqmread.o: cmt/seqmread.c - cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) - -cmt/seqmwrite.o: cmt/seqmwrite.c - cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) - -cmt/seqread.o: cmt/seqread.c - cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) - -cmt/seqwrite.o: cmt/seqwrite.c - cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) - -cmt/tempomap.o: cmt/tempomap.c - cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) - -cmt/timebase.o: cmt/timebase.c - cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) - -cmt/userio.o: cmt/userio.c - cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) - -sys/unix/osstuff.o: sys/unix/osstuff.c - cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) - - -# this doesn't compile with the -O switch (a NeXT compiler bug?) -xlisp/xljump.o : xlisp/xljump.c xlisp/xlisp.h - $(CC) -DCMTSTUFF -c xlisp/xljump.c -o xlisp/xljump.o -misc/intgen: misc/intgen.c - cd misc; make intgen - -misc/unpacker: misc/unpacker.c misc/convert.c - cd misc; make unpacker - -misc/packer: misc/packer.c misc/convert.c - cd misc; make packer - -nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen - $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) - -nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen - $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) - -clean: - cd misc; make clean - rm -f $(OBJECTS) -# Note that these files are machine-generated: - rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h - rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h - -cleaner: clean - cd misc; make cleaner - rm -f *.backup */*.backup - rm -f *~ */*.*~ - rm -f *.save */*.save - rm -f *.CKP */*.CKP - rm -f *.BAK */*.BAK - rm -f *.old */*.old - rm -f *.gold */*.gold - rm -f playparms - rm -f points.dat diff --git a/lib-src/libnyquist/nyquist/sys/unix/nonalsa/Makefile b/lib-src/libnyquist/nyquist/sys/unix/nonalsa/Makefile deleted file mode 100644 index 2b3159b2c..000000000 --- a/lib-src/libnyquist/nyquist/sys/unix/nonalsa/Makefile +++ /dev/null @@ -1,1140 +0,0 @@ -# -# Makefile for Nyquist, SYSTEM-TYPE is NONALSA -# run make in the top-level Nyquist directory to compile Nyquist -# -# NOTE: this file is machine-generated. DO NOT EDIT! -# Instead, modify makefile.lsp and regenerate the makefile. -# Ports and bug fixes are welcome - please mail them to -# dannenberg@cs.cmu.edu. Thanks. -# - -# This is the resulting executable (normally "ny"): -NY = ny - -OPT = -O2 -m32 -# OPT = -g -m32 - -EVERYTHING = $(NY) runtime/system.lsp jnyqide/jNyqIDE.jar \ - bin/ser-to-osc bin/test-client - -CURRENT = $(EVERYTHING) - -current: $(CURRENT) - -onlyny: $(NY) runtime/system.lsp - -JAVASRC = jnyqide/browser.java jnyqide/NyquistThread.java \ - jnyqide/Pair.java jnyqide/BareBonesBrowserLaunch.java \ - jnyqide/EnvelopeFrame.java jnyqide/Piano_Roll.java \ - jnyqide/FindDialog.java jnyqide/PlotFrame.java \ - jnyqide/InstrumentCharacteristics.java jnyqide/PlotMouseAdapter.java \ - jnyqide/Jslide.java jnyqide/PopupListener.java \ - jnyqide/LispFileFilter.java jnyqide/PreferencesDialog.java \ - jnyqide/MainFrame_AboutBox.java jnyqide/ReplaceDialog.java \ - jnyqide/MainFrame.java jnyqide/SpringUtilities.java jnyqide/Main.java \ - jnyqide/NotFoundDialog.java jnyqide/TextColor.java jnyqide/NyqPlot.java \ - jnyqide/Trie.java jnyqide/NyquistFile.java jnyqide/WordList.java - -jnyqide/jNyqIDE.jar: $(JAVASRC) - if [ -r jnyqide/SpecialMacHandler.java ] ; then \ - mv jnyqide/SpecialMacHandler.java jnyqide/SpecialMacHandler.hidden ;\ - fi - cd jnyqide; javac *.java - mv jnyqide/SpecialMacHandler.hidden jnyqide/SpecialMacHandler.java - rm -rf jnyqide/jNyqIDE.jar - jar -cfm jnyqide/jNyqIDE.jar jnyqide/manifest.txt jnyqide/*.class - -# Standard list of includes (common to all unix versions) -# Keeping portaudio and libsndfile sources local to nyquist -INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Iffts/src \ - -Inyqstk/include -Inyqstk -Iportaudio/include -Iportaudio/src/common \ - -Iportaudio/src/os/unix \ - -Iliblo -Inylsf -IFLAC/include -Ilibogg/include - -# system dependent stuff for nonalsa: - -AUDIOLIBS = - -CC = gcc - -LIBPA_PATH = portaudio/lib/.libs -LIBOGG_PATH = libogg/src/.libs -LIBVORBIS_PATH = libvorbis/lib/.libs -LIBLO_PATH = liblo/src/.libs -LIBFLAC_PATH = FLAC/obj/release/lib - -# to enable command line editing, use -DREADLINE. WARNING: THIS WILL -# DISABLE THE ABILITY TO INTERRUPT LISP AND USE SOME OTHER HANDY -# CONTROL CHARACTERS (You will also need the readline and curses libraries) -CFLAGS = -DOSC -DCMTSTUFF $(OPT) $(INCL) \ - -DHAVE_LIBPTHREAD=1 -D_FILE_OFFSET_BITS=64 \ - -DSTK_NYQUIST -DUSE_VSPRINTF \ - -DHAVE_CONFIG_H -LN = g++ -m32 -AR = ar -# to enable command line editing, insert -lreadline -lcurses -LFLAGS = -L/usr/lib32 $(LIBPA_PATH)/libportaudio.a \ - $(LIBLO_PATH)/liblo.a $(AUDIOLIBS) $(LIBFLAC_PATH)/libFLAC.a \ - $(LIBVORBIS_PATH)/libvorbis.a \ - $(LIBVORBIS_PATH)/libvorbisfile.a \ - $(LIBVORBIS_PATH)/libvorbisenc.a $(LIBOGG_PATH)/libogg.a \ - -lm -lpthread -lrt - -TAGS: - find . ( -name "*.c" -o -name "*.h" ) -print | etags - - -tags: TAGS - -# end of system dependencies - -INTGEN = misc/intgen - -# Object files for Nyquist: -OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ - xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ - xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ - xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ - xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o xlisp/xlstr.o \ - xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o xlisp/path.o tran/abs.o \ - tran/allpoles.o tran/alpass.o tran/alpasscv.o tran/alpassvv.o \ - tran/amosc.o tran/areson.o tran/aresonvc.o tran/aresoncv.o \ - tran/aresonvv.o tran/atone.o tran/atonev.o tran/biquadfilt.o \ - tran/buzz.o tran/chase.o tran/clip.o tran/congen.o tran/const.o \ - tran/coterm.o tran/delaycc.o tran/delaycv.o tran/eqbandvvv.o tran/exp.o \ - tran/follow.o tran/fmosc.o tran/fromobject.o tran/fromarraystream.o \ - tran/gate.o tran/ifft.o tran/instrclar.o tran/instrclarall.o \ - tran/instrclarfreq.o tran/instrsax.o tran/instrsaxall.o \ - tran/instrsaxfreq.o tran/integrate.o tran/log.o tran/lpreson.o \ - tran/maxv.o tran/offset.o tran/oneshot.o tran/osc.o tran/partial.o \ - tran/pluck.o tran/prod.o tran/pwl.o tran/quantize.o tran/recip.o \ - tran/reson.o tran/resonvc.o tran/resoncv.o tran/resonvv.o \ - tran/sampler.o tran/scale.o tran/shape.o tran/sine.o tran/siosc.o \ - tran/slope.o tran/sqrt.o tran/tapf.o tran/tapv.o tran/tone.o \ - tran/tonev.o tran/upsample.o tran/white.o tran/stkrev.o \ - tran/stkpitshift.o tran/stkchorus.o tran/instrbow.o \ - tran/instrbowedfreq.o tran/instrbanded.o tran/instrmandolin.o \ - tran/instrsitar.o tran/instrmodalbar.o tran/instrflute.o \ - tran/instrflutefreq.o tran/instrfluteall.o tran/fmfb.o tran/fmfbv.o \ - cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o cmt/moxc.o \ - cmt/mem.o cmt/midifile.o cmt/midifns.o cmt/record.o cmt/seq.o \ - cmt/seqmread.o cmt/seqmwrite.o cmt/seqread.o cmt/seqwrite.o \ - cmt/tempomap.o cmt/timebase.o cmt/userio.o nylsf/aiff.o nylsf/alaw.o \ - nylsf/au.o nylsf/audio_detect.o nylsf/avr.o nylsf/broadcast.o \ - nylsf/caf.o nylsf/chanmap.o nylsf/chunk.o nylsf/command.o \ - nylsf/common.o nylsf/dither.o nylsf/double64.o nylsf/dwd.o nylsf/dwvw.o \ - nylsf/file_io.o nylsf/flac.o nylsf/float32.o nylsf/gsm610.o nylsf/htk.o \ - nylsf/id3.o nylsf/ima_adpcm.o nylsf/ima_oki_adpcm.o nylsf/interleave.o \ - nylsf/ircam.o nylsf/macbinary3.o nylsf/macos.o nylsf/mat4.o \ - nylsf/mat5.o nylsf/mpc2k.o nylsf/ms_adpcm.o nylsf/nist.o nylsf/ogg.o \ - nylsf/ogg_vorbis.o nylsf/paf.o nylsf/pcm.o nylsf/pvf.o nylsf/raw.o \ - nylsf/rf64.o nylsf/rx2.o nylsf/sd2.o nylsf/sds.o nylsf/sndfile.o \ - nylsf/strings.o nylsf/svx.o nylsf/txw.o nylsf/ulaw.o nylsf/voc.o \ - nylsf/vox_adpcm.o nylsf/w64.o nylsf/wav.o nylsf/wav_w64.o nylsf/wve.o \ - nylsf/xi.o nylsf/g72x.o nylsf/GSM610/add.o nylsf/GSM610/code.o \ - nylsf/GSM610/decode.o nylsf/GSM610/gsm_create.o \ - nylsf/GSM610/gsm_decode.o nylsf/GSM610/gsm_destroy.o \ - nylsf/GSM610/gsm_encode.o nylsf/GSM610/gsm_option.o \ - nylsf/GSM610/long_term.o nylsf/GSM610/lpc.o nylsf/GSM610/preprocess.o \ - nylsf/GSM610/rpe.o nylsf/GSM610/short_term.o nylsf/GSM610/table.o \ - nylsf/G72x/g721.o nylsf/G72x/g723_16.o nylsf/G72x/g723_24.o \ - nylsf/G72x/g723_40.o nylsf/G72x/g72x.o nyqsrc/debug.o nyqsrc/falloc.o \ - nyqsrc/local.o nyqsrc/handlers.o nyqsrc/multiread.o nyqsrc/seqext.o \ - nyqsrc/seqinterf.o nyqsrc/stats.o nyqsrc/ffilterkit.o nyqsrc/sound.o \ - nyqsrc/add.o nyqsrc/avg.o nyqsrc/compose.o nyqsrc/convolve.o \ - nyqsrc/downsample.o nyqsrc/fft.o nyqsrc/inverse.o nyqsrc/multiseq.o \ - nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/samples.o nyqsrc/sndmax.o \ - nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndsliders.o \ - nyqsrc/sliderdata.o nyqsrc/sndwritepa.o nyqsrc/yin.o \ - nyqsrc/nyq-osc-server.o nyqsrc/trigger.o nyqsrc/lpanal.o \ - nyqsrc/phasevocoder.o nyqsrc/pvshell.o nyqstk/src/Generator.o \ - nyqstk/src/SineWave.o nyqstk/src/Function.o nyqstk/src/FileRead.o \ - nyqstk/src/FileWvIn.o nyqstk/src/Effect.o nyqstk/src/Clarinet.o \ - nyqstk/src/Delay.o nyqstk/src/DelayL.o nyqstk/src/Envelope.o \ - nyqstk/src/Filter.o nyqstk/src/Instrmnt.o nyqstk/src/Noise.o \ - nyqstk/src/OneZero.o nyqstk/src/ReedTable.o nyqstk/src/Saxofony.o \ - nyqstk/src/Stk.o nyqstk/src/WaveLoop.o nyqstk/src/WvIn.o \ - nyqstk/src/NRev.o nyqstk/src/JCRev.o nyqstk/src/PRCRev.o \ - nyqstk/src/PitShift.o nyqstk/src/Chorus.o nyqstk/src/Bowed.o \ - nyqstk/src/BowTable.o nyqstk/src/ADSR.o nyqstk/src/OnePole.o \ - nyqstk/src/BiQuad.o nyqstk/src/BandedWG.o nyqstk/src/DelayA.o \ - nyqstk/src/Mandolin.o nyqstk/src/PluckTwo.o nyqstk/src/Sitar.o \ - nyqstk/src/ModalBar.o nyqstk/src/Modal.o nyqstk/src/Flute.o \ - nyqstk/src/JetTable.o nyqstk/src/PoleZero.o nyqstk/stkinit.o \ - nyqstk/instr.o nyqstk/stkint.o ffts/src/fftext.o ffts/src/fftlib.o \ - ffts/src/matlib.o nyqsrc/sndfnint.o nyqsrc/seqfnint.o \ - sys/unix/osstuff.o sys/unix/term.o - -# Sound functions to add to xlisp -SNDFNINT_HDRS = nyqsrc/sndfmt.h nylsf/sndfile.h nyqsrc/sound.h \ - nyqsrc/add.h nyqsrc/avg.h nyqsrc/compose.h nyqsrc/convolve.h \ - nyqsrc/downsample.h nyqsrc/fft.h nyqsrc/inverse.h nyqsrc/multiseq.h \ - nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/samples.h nyqsrc/sndmax.h \ - nyqsrc/sndread.h nyqsrc/sndseq.h nyqsrc/sndsliders.h \ - nyqsrc/sliderdata.h nyqsrc/sndwritepa.h nyqsrc/yin.h \ - nyqsrc/nyq-osc-server.h nyqsrc/trigger.h nyqsrc/lpanal.h \ - nyqsrc/phasevocoder.h nyqsrc/pvshell.h tran/abs.h tran/allpoles.h \ - tran/alpass.h tran/alpasscv.h tran/alpassvv.h tran/amosc.h \ - tran/areson.h tran/aresonvc.h tran/aresoncv.h tran/aresonvv.h \ - tran/atone.h tran/atonev.h tran/biquadfilt.h tran/buzz.h tran/chase.h \ - tran/clip.h tran/congen.h tran/const.h tran/coterm.h tran/delaycc.h \ - tran/delaycv.h tran/eqbandvvv.h tran/exp.h tran/follow.h tran/fmosc.h \ - tran/fromobject.h tran/fromarraystream.h tran/gate.h tran/ifft.h \ - tran/instrclar.h tran/instrclarall.h tran/instrclarfreq.h \ - tran/instrsax.h tran/instrsaxall.h tran/instrsaxfreq.h tran/integrate.h \ - tran/log.h tran/lpreson.h tran/maxv.h tran/offset.h tran/oneshot.h \ - tran/osc.h tran/partial.h tran/pluck.h tran/prod.h tran/pwl.h \ - tran/quantize.h tran/recip.h tran/reson.h tran/resonvc.h tran/resoncv.h \ - tran/resonvv.h tran/sampler.h tran/scale.h tran/shape.h tran/sine.h \ - tran/siosc.h tran/slope.h tran/sqrt.h tran/tapf.h tran/tapv.h \ - tran/tone.h tran/tonev.h tran/upsample.h tran/white.h tran/stkrev.h \ - tran/stkpitshift.h tran/stkchorus.h tran/instrbow.h \ - tran/instrbowedfreq.h tran/instrbanded.h tran/instrmandolin.h \ - tran/instrsitar.h tran/instrmodalbar.h tran/instrflute.h \ - tran/instrflutefreq.h tran/instrfluteall.h tran/fmfb.h tran/fmfbv.h \ - nyqsrc/sndwrite.h - -SEQFNINT_HDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h \ - nyqsrc/seqinterf.h cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h \ - cmt/seqmwrite.h - - - -liblo/Makefile: - cd liblo; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared - # sometimes, residual files cause problems - cd liblo; make clean - -$(LIBLO_PATH)/liblo.a: liblo/Makefile - cd liblo; make - -bin/ser-to-osc: $(LIBLO_PATH)/liblo.a - mkdir -p bin - $(CC) -c $(CFLAGS) liblo/ser-to-osc/ser-to-osc.cpp \ - -o liblo/ser-to-osc/ser-to-osc.o - $(LN) liblo/ser-to-osc/ser-to-osc.o -o bin/ser-to-osc $(LFLAGS) - -bin/test-client: $(LIBLO_PATH)/liblo.a - mkdir -p bin - $(CC) -c $(CFLAGS) liblo/test-client/test-client.c \ - -o liblo/test-client/test-client.o - $(LN) liblo/test-client/test-client.o -o bin/test-client $(LFLAGS) - -portaudio/Makefile: - # note: without-jack avoids 32/64-bit link error on Debian - cd portaudio; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared --without-jack --with-oss - # sometimes, residual files cause problems - cd portaudio; make clean - -$(LIBPA_PATH)/libportaudio.a: portaudio/Makefile - cd portaudio; make - -libogg/Makefile: - cd libogg; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared - -$(LIBOGG_PATH)/libogg.a: libogg/Makefile - cd libogg; make - -# NOTE: libvorbis/configure on a 64-bit machine will expect to find -# libogg installed (even though we are not going to use the installed -# libogg library, and even though the installed libogg library will -# be for 64-bit architecture. This represents a bug in configure -# because it checks for a 64-bit library when it is building for -# a 32-bit architecture (we pass in CFLAGS=-m32). In spite of the -# bug, configure will build a Makefile that will build a 32-bit -# libvorbis library that we need. We will link it with other -# 32-bit code including 32-bit libogg.a - -libvorbis/Makefile: - cd libvorbis; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared - -$(LIBVORBIS_PATH)/libvorbis.a: libvorbis/Makefile - cd libvorbis; make - -$(LIBVORBIS_PATH)/libvorbisfile.a: libvorbis/Makefile - cd libvorbis; make - -$(LIBVORBIS_PATH)/libvorbisenc.a: libvorbis/Makefile - cd libvorbis; make - - -$(LIBFLAC_PATH)/libFLAC.a: FLAC/src/libFLAC/Makefile.lite - cd FLAC/src/libFLAC; make -f Makefile.lite - -$(NY): $(OBJECTS) $(LIBPA_PATH)/libportaudio.a $(LIBLO_PATH)/liblo.a \ - FLAC/obj/release/lib/libFLAC.a \ - $(LIBVORBIS_PATH)/libvorbis.a $(LIBVORBIS_PATH)/libvorbisfile.a \ - $(LIBVORBIS_PATH)/libvorbisenc.a $(LIBOGG_PATH)/libogg.a - $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) - -# copy appropriate system.lsp and make it read-only; -# changes should be made to sys/unix//system.lsp -runtime/system.lsp: sys/unix/nonalsa/system.lsp -# make sure it's there before you make it writeable - touch runtime/system.lsp - chmod +w runtime/system.lsp - cp -p sys/unix/nonalsa/system.lsp runtime/system.lsp - chmod -w runtime/system.lsp - -NYQDEP = nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - -nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h $(NYQDEP) - $(CC) -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) - -nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h $(NYQDEP) - $(CC) -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) - -nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h $(NYQDEP) - $(CC) -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) - -nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h $(NYQDEP) - $(CC) -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) - -nyqsrc/convolve.o: nyqsrc/convolve.c nyqsrc/convolve.h $(NYQDEP) - $(CC) -c nyqsrc/convolve.c -o nyqsrc/convolve.o $(CFLAGS) - -nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h $(NYQDEP) - $(CC) -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) - -nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h $(NYQDEP) - $(CC) -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) - -nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h $(NYQDEP) - $(CC) -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) - -nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h $(NYQDEP) - $(CC) -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) - -nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h $(NYQDEP) - $(CC) -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) - -nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h $(NYQDEP) - $(CC) -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) - -nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h $(NYQDEP) - $(CC) -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) - -nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h $(NYQDEP) - $(CC) -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) - -nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h $(NYQDEP) - $(CC) -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) - -nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h $(NYQDEP) - $(CC) -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) - -nyqsrc/sndsliders.o: nyqsrc/sndsliders.c nyqsrc/sndsliders.h $(NYQDEP) - $(CC) -c nyqsrc/sndsliders.c -o nyqsrc/sndsliders.o $(CFLAGS) - -nyqsrc/sliderdata.o: nyqsrc/sliderdata.c nyqsrc/sliderdata.h $(NYQDEP) - $(CC) -c nyqsrc/sliderdata.c -o nyqsrc/sliderdata.o $(CFLAGS) - -nyqsrc/sndwritepa.o: nyqsrc/sndwritepa.c nyqsrc/sndwrite.h - $(CC) -c nyqsrc/sndwritepa.c -o nyqsrc/sndwritepa.o $(CFLAGS) - -nyqsrc/yin.o: nyqsrc/yin.c nyqsrc/yin.h $(NYQDEP) - $(CC) -c nyqsrc/yin.c -o nyqsrc/yin.o $(CFLAGS) - -nyqsrc/nyq-osc-server.o: nyqsrc/nyq-osc-server.c nyqsrc/nyq-osc-server.h $(NYQDEP) - $(CC) -c nyqsrc/nyq-osc-server.c -o nyqsrc/nyq-osc-server.o $(CFLAGS) - -nyqsrc/trigger.o: nyqsrc/trigger.c nyqsrc/trigger.h $(NYQDEP) - $(CC) -c nyqsrc/trigger.c -o nyqsrc/trigger.o $(CFLAGS) - -nyqsrc/lpanal.o: nyqsrc/lpanal.c nyqsrc/lpanal.h $(NYQDEP) - $(CC) -c nyqsrc/lpanal.c -o nyqsrc/lpanal.o $(CFLAGS) - -nyqsrc/phasevocoder.o: nyqsrc/phasevocoder.c nyqsrc/phasevocoder.h $(NYQDEP) - $(CC) -c nyqsrc/phasevocoder.c -o nyqsrc/phasevocoder.o $(CFLAGS) - -nyqsrc/pvshell.o: nyqsrc/pvshell.c nyqsrc/pvshell.h $(NYQDEP) - $(CC) -c nyqsrc/pvshell.c -o nyqsrc/pvshell.o $(CFLAGS) - -nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h $(NYQDEP) - $(CC) -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) - -nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h $(NYQDEP) - $(CC) -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) - -nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h - $(CC) -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) - -nyqsrc/handlers.o: nyqsrc/handlers.c - $(CC) -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) - -nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h $(NYQDEP) - $(CC) -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) - -nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h $(NYQDEP) - $(CC) -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) - -nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h $(NYQDEP) - $(CC) -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) - -nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - $(CC) -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) - -nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h $(NYQDEP) - $(CC) -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) - -ffts/src/fftext.o: ffts/src/fftext.c ffts/src/fftext.h $(NYQDEP) - $(CC) -c ffts/src/fftext.c -o ffts/src/fftext.o $(CFLAGS) - -ffts/src/fftlib.o: ffts/src/fftlib.c ffts/src/fftlib.h $(NYQDEP) - $(CC) -c ffts/src/fftlib.c -o ffts/src/fftlib.o $(CFLAGS) - -ffts/src/matlib.o: ffts/src/matlib.c ffts/src/matlib.h $(NYQDEP) - $(CC) -c ffts/src/matlib.c -o ffts/src/matlib.o $(CFLAGS) - -tran/abs.o: tran/abs.c tran/abs.h $(NYQDEP) - $(CC) -c tran/abs.c -o tran/abs.o $(CFLAGS) - -tran/allpoles.o: tran/allpoles.c tran/allpoles.h $(NYQDEP) - $(CC) -c tran/allpoles.c -o tran/allpoles.o $(CFLAGS) - -tran/alpass.o: tran/alpass.c tran/alpass.h $(NYQDEP) - $(CC) -c tran/alpass.c -o tran/alpass.o $(CFLAGS) - -tran/alpasscv.o: tran/alpasscv.c tran/alpasscv.h $(NYQDEP) - $(CC) -c tran/alpasscv.c -o tran/alpasscv.o $(CFLAGS) - -tran/alpassvv.o: tran/alpassvv.c tran/alpassvv.h $(NYQDEP) - $(CC) -c tran/alpassvv.c -o tran/alpassvv.o $(CFLAGS) - -tran/amosc.o: tran/amosc.c tran/amosc.h $(NYQDEP) - $(CC) -c tran/amosc.c -o tran/amosc.o $(CFLAGS) - -tran/areson.o: tran/areson.c tran/areson.h $(NYQDEP) - $(CC) -c tran/areson.c -o tran/areson.o $(CFLAGS) - -tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h $(NYQDEP) - $(CC) -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) - -tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h $(NYQDEP) - $(CC) -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) - -tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h $(NYQDEP) - $(CC) -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) - -tran/atone.o: tran/atone.c tran/atone.h $(NYQDEP) - $(CC) -c tran/atone.c -o tran/atone.o $(CFLAGS) - -tran/atonev.o: tran/atonev.c tran/atonev.h $(NYQDEP) - $(CC) -c tran/atonev.c -o tran/atonev.o $(CFLAGS) - -tran/biquadfilt.o: tran/biquadfilt.c tran/biquadfilt.h $(NYQDEP) - $(CC) -c tran/biquadfilt.c -o tran/biquadfilt.o $(CFLAGS) - -tran/buzz.o: tran/buzz.c tran/buzz.h $(NYQDEP) - $(CC) -c tran/buzz.c -o tran/buzz.o $(CFLAGS) - -tran/chase.o: tran/chase.c tran/chase.h $(NYQDEP) - $(CC) -c tran/chase.c -o tran/chase.o $(CFLAGS) - -tran/clip.o: tran/clip.c tran/clip.h $(NYQDEP) - $(CC) -c tran/clip.c -o tran/clip.o $(CFLAGS) - -tran/congen.o: tran/congen.c tran/congen.h $(NYQDEP) - $(CC) -c tran/congen.c -o tran/congen.o $(CFLAGS) - -tran/const.o: tran/const.c tran/const.h $(NYQDEP) - $(CC) -c tran/const.c -o tran/const.o $(CFLAGS) - -tran/coterm.o: tran/coterm.c tran/coterm.h $(NYQDEP) - $(CC) -c tran/coterm.c -o tran/coterm.o $(CFLAGS) - -tran/delaycc.o: tran/delaycc.c tran/delaycc.h $(NYQDEP) - $(CC) -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) - -tran/delaycv.o: tran/delaycv.c tran/delaycv.h $(NYQDEP) - $(CC) -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) - -tran/eqbandvvv.o: tran/eqbandvvv.c tran/eqbandvvv.h $(NYQDEP) - $(CC) -c tran/eqbandvvv.c -o tran/eqbandvvv.o $(CFLAGS) - -tran/exp.o: tran/exp.c tran/exp.h $(NYQDEP) - $(CC) -c tran/exp.c -o tran/exp.o $(CFLAGS) - -tran/follow.o: tran/follow.c tran/follow.h $(NYQDEP) - $(CC) -c tran/follow.c -o tran/follow.o $(CFLAGS) - -tran/fmosc.o: tran/fmosc.c tran/fmosc.h $(NYQDEP) - $(CC) -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) - -tran/fromobject.o: tran/fromobject.c tran/fromobject.h $(NYQDEP) - $(CC) -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) - -tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h $(NYQDEP) - $(CC) -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) - -tran/gate.o: tran/gate.c tran/gate.h $(NYQDEP) - $(CC) -c tran/gate.c -o tran/gate.o $(CFLAGS) - -tran/ifft.o: tran/ifft.c tran/ifft.h $(NYQDEP) - $(CC) -c tran/ifft.c -o tran/ifft.o $(CFLAGS) - -tran/instrclar.o: tran/instrclar.c tran/instrclar.h $(NYQDEP) - $(CC) -c tran/instrclar.c -o tran/instrclar.o $(CFLAGS) - -tran/instrclarall.o: tran/instrclarall.c tran/instrclarall.h $(NYQDEP) - $(CC) -c tran/instrclarall.c -o tran/instrclarall.o $(CFLAGS) - -tran/instrclarfreq.o: tran/instrclarfreq.c tran/instrclarfreq.h $(NYQDEP) - $(CC) -c tran/instrclarfreq.c -o tran/instrclarfreq.o $(CFLAGS) - -tran/instrsax.o: tran/instrsax.c tran/instrsax.h $(NYQDEP) - $(CC) -c tran/instrsax.c -o tran/instrsax.o $(CFLAGS) - -tran/instrsaxall.o: tran/instrsaxall.c tran/instrsaxall.h $(NYQDEP) - $(CC) -c tran/instrsaxall.c -o tran/instrsaxall.o $(CFLAGS) - -tran/instrsaxfreq.o: tran/instrsaxfreq.c tran/instrsaxfreq.h $(NYQDEP) - $(CC) -c tran/instrsaxfreq.c -o tran/instrsaxfreq.o $(CFLAGS) - -tran/integrate.o: tran/integrate.c tran/integrate.h $(NYQDEP) - $(CC) -c tran/integrate.c -o tran/integrate.o $(CFLAGS) - -tran/log.o: tran/log.c tran/log.h $(NYQDEP) - $(CC) -c tran/log.c -o tran/log.o $(CFLAGS) - -tran/lpreson.o: tran/lpreson.c tran/lpreson.h $(NYQDEP) - $(CC) -c tran/lpreson.c -o tran/lpreson.o $(CFLAGS) - -tran/maxv.o: tran/maxv.c tran/maxv.h $(NYQDEP) - $(CC) -c tran/maxv.c -o tran/maxv.o $(CFLAGS) - -tran/offset.o: tran/offset.c tran/offset.h $(NYQDEP) - $(CC) -c tran/offset.c -o tran/offset.o $(CFLAGS) - -tran/oneshot.o: tran/oneshot.c tran/oneshot.h $(NYQDEP) - $(CC) -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) - -tran/osc.o: tran/osc.c tran/osc.h $(NYQDEP) - $(CC) -c tran/osc.c -o tran/osc.o $(CFLAGS) - -tran/partial.o: tran/partial.c tran/partial.h $(NYQDEP) - $(CC) -c tran/partial.c -o tran/partial.o $(CFLAGS) - -tran/pluck.o: tran/pluck.c tran/pluck.h $(NYQDEP) - $(CC) -c tran/pluck.c -o tran/pluck.o $(CFLAGS) - -tran/prod.o: tran/prod.c tran/prod.h $(NYQDEP) - $(CC) -c tran/prod.c -o tran/prod.o $(CFLAGS) - -tran/pwl.o: tran/pwl.c tran/pwl.h $(NYQDEP) - $(CC) -c tran/pwl.c -o tran/pwl.o $(CFLAGS) - -tran/quantize.o: tran/quantize.c tran/quantize.h $(NYQDEP) - $(CC) -c tran/quantize.c -o tran/quantize.o $(CFLAGS) - -tran/recip.o: tran/recip.c tran/recip.h $(NYQDEP) - $(CC) -c tran/recip.c -o tran/recip.o $(CFLAGS) - -tran/reson.o: tran/reson.c tran/reson.h $(NYQDEP) - $(CC) -c tran/reson.c -o tran/reson.o $(CFLAGS) - -tran/resonvc.o: tran/resonvc.c tran/resonvc.h $(NYQDEP) - $(CC) -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) - -tran/resoncv.o: tran/resoncv.c tran/resoncv.h $(NYQDEP) - $(CC) -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) - -tran/resonvv.o: tran/resonvv.c tran/resonvv.h $(NYQDEP) - $(CC) -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) - -tran/sampler.o: tran/sampler.c tran/sampler.h $(NYQDEP) - $(CC) -c tran/sampler.c -o tran/sampler.o $(CFLAGS) - -tran/scale.o: tran/scale.c tran/scale.h $(NYQDEP) - $(CC) -c tran/scale.c -o tran/scale.o $(CFLAGS) - -tran/shape.o: tran/shape.c tran/shape.h $(NYQDEP) - $(CC) -c tran/shape.c -o tran/shape.o $(CFLAGS) - -tran/sine.o: tran/sine.c tran/sine.h $(NYQDEP) - $(CC) -c tran/sine.c -o tran/sine.o $(CFLAGS) - -tran/siosc.o: tran/siosc.c tran/siosc.h $(NYQDEP) - $(CC) -c tran/siosc.c -o tran/siosc.o $(CFLAGS) - -tran/slope.o: tran/slope.c tran/slope.h $(NYQDEP) - $(CC) -c tran/slope.c -o tran/slope.o $(CFLAGS) - -tran/sqrt.o: tran/sqrt.c tran/sqrt.h $(NYQDEP) - $(CC) -c tran/sqrt.c -o tran/sqrt.o $(CFLAGS) - -tran/tapf.o: tran/tapf.c tran/tapf.h $(NYQDEP) - $(CC) -c tran/tapf.c -o tran/tapf.o $(CFLAGS) - -tran/tapv.o: tran/tapv.c tran/tapv.h $(NYQDEP) - $(CC) -c tran/tapv.c -o tran/tapv.o $(CFLAGS) - -tran/tone.o: tran/tone.c tran/tone.h $(NYQDEP) - $(CC) -c tran/tone.c -o tran/tone.o $(CFLAGS) - -tran/tonev.o: tran/tonev.c tran/tonev.h $(NYQDEP) - $(CC) -c tran/tonev.c -o tran/tonev.o $(CFLAGS) - -tran/upsample.o: tran/upsample.c tran/upsample.h $(NYQDEP) - $(CC) -c tran/upsample.c -o tran/upsample.o $(CFLAGS) - -tran/white.o: tran/white.c tran/white.h $(NYQDEP) - $(CC) -c tran/white.c -o tran/white.o $(CFLAGS) - -tran/stkrev.o: tran/stkrev.c tran/stkrev.h $(NYQDEP) - $(CC) -c tran/stkrev.c -o tran/stkrev.o $(CFLAGS) - -tran/stkpitshift.o: tran/stkpitshift.c tran/stkpitshift.h $(NYQDEP) - $(CC) -c tran/stkpitshift.c -o tran/stkpitshift.o $(CFLAGS) - -tran/stkchorus.o: tran/stkchorus.c tran/stkchorus.h $(NYQDEP) - $(CC) -c tran/stkchorus.c -o tran/stkchorus.o $(CFLAGS) - -tran/instrbow.o: tran/instrbow.c tran/instrbow.h $(NYQDEP) - $(CC) -c tran/instrbow.c -o tran/instrbow.o $(CFLAGS) - -tran/instrbowedfreq.o: tran/instrbowedfreq.c tran/instrbowedfreq.h $(NYQDEP) - $(CC) -c tran/instrbowedfreq.c -o tran/instrbowedfreq.o $(CFLAGS) - -tran/instrbanded.o: tran/instrbanded.c tran/instrbanded.h $(NYQDEP) - $(CC) -c tran/instrbanded.c -o tran/instrbanded.o $(CFLAGS) - -tran/instrmandolin.o: tran/instrmandolin.c tran/instrmandolin.h $(NYQDEP) - $(CC) -c tran/instrmandolin.c -o tran/instrmandolin.o $(CFLAGS) - -tran/instrsitar.o: tran/instrsitar.c tran/instrsitar.h $(NYQDEP) - $(CC) -c tran/instrsitar.c -o tran/instrsitar.o $(CFLAGS) - -tran/instrmodalbar.o: tran/instrmodalbar.c tran/instrmodalbar.h $(NYQDEP) - $(CC) -c tran/instrmodalbar.c -o tran/instrmodalbar.o $(CFLAGS) - -tran/instrflute.o: tran/instrflute.c tran/instrflute.h $(NYQDEP) - $(CC) -c tran/instrflute.c -o tran/instrflute.o $(CFLAGS) - -tran/instrflutefreq.o: tran/instrflutefreq.c tran/instrflutefreq.h $(NYQDEP) - $(CC) -c tran/instrflutefreq.c -o tran/instrflutefreq.o $(CFLAGS) - -tran/instrfluteall.o: tran/instrfluteall.c tran/instrfluteall.h $(NYQDEP) - $(CC) -c tran/instrfluteall.c -o tran/instrfluteall.o $(CFLAGS) - -tran/fmfb.o: tran/fmfb.c tran/fmfb.h $(NYQDEP) - $(CC) -c tran/fmfb.c -o tran/fmfb.o $(CFLAGS) - -tran/fmfbv.o: tran/fmfbv.c tran/fmfbv.h $(NYQDEP) - $(CC) -c tran/fmfbv.c -o tran/fmfbv.o $(CFLAGS) - -nyqsrc/sndfnint.o: nyqsrc/sndfnint.c - $(CC) -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) - -nyqsrc/seqfnint.o: nyqsrc/seqfnint.c - $(CC) -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) - -nyqstk/stkinit.o: nyqstk/stkinit.cpp nyqstk/stkinit.h - g++ -c nyqstk/stkinit.cpp -o nyqstk/stkinit.o $(CFLAGS) - -nyqstk/instr.o: nyqstk/instr.cpp nyqstk/instr.h - g++ -c nyqstk/instr.cpp -o nyqstk/instr.o $(CFLAGS) - -nyqstk/stkint.o: nyqstk/stkint.cpp nyqstk/stkint.h - g++ -c nyqstk/stkint.cpp -o nyqstk/stkint.o $(CFLAGS) - -nyqstk/src/Generator.o: nyqstk/src/Generator.cpp nyqstk/include/Generator.h - g++ -c nyqstk/src/Generator.cpp -o nyqstk/src/Generator.o $(CFLAGS) - -nyqstk/src/SineWave.o: nyqstk/src/SineWave.cpp nyqstk/include/SineWave.h - g++ -c nyqstk/src/SineWave.cpp -o nyqstk/src/SineWave.o $(CFLAGS) - -nyqstk/src/Function.o: nyqstk/src/Function.cpp nyqstk/include/Function.h - g++ -c nyqstk/src/Function.cpp -o nyqstk/src/Function.o $(CFLAGS) - -nyqstk/src/FileRead.o: nyqstk/src/FileRead.cpp nyqstk/include/FileRead.h - g++ -c nyqstk/src/FileRead.cpp -o nyqstk/src/FileRead.o $(CFLAGS) - -nyqstk/src/FileWvIn.o: nyqstk/src/FileWvIn.cpp nyqstk/include/FileWvIn.h - g++ -c nyqstk/src/FileWvIn.cpp -o nyqstk/src/FileWvIn.o $(CFLAGS) - -nyqstk/src/Effect.o: nyqstk/src/Effect.cpp nyqstk/include/Effect.h - g++ -c nyqstk/src/Effect.cpp -o nyqstk/src/Effect.o $(CFLAGS) - -nyqstk/src/Clarinet.o: nyqstk/src/Clarinet.cpp nyqstk/include/Clarinet.h - g++ -c nyqstk/src/Clarinet.cpp -o nyqstk/src/Clarinet.o $(CFLAGS) - -nyqstk/src/Delay.o: nyqstk/src/Delay.cpp nyqstk/include/Delay.h - g++ -c nyqstk/src/Delay.cpp -o nyqstk/src/Delay.o $(CFLAGS) - -nyqstk/src/DelayL.o: nyqstk/src/DelayL.cpp nyqstk/include/DelayL.h - g++ -c nyqstk/src/DelayL.cpp -o nyqstk/src/DelayL.o $(CFLAGS) - -nyqstk/src/Envelope.o: nyqstk/src/Envelope.cpp nyqstk/include/Envelope.h - g++ -c nyqstk/src/Envelope.cpp -o nyqstk/src/Envelope.o $(CFLAGS) - -nyqstk/src/Filter.o: nyqstk/src/Filter.cpp nyqstk/include/Filter.h - g++ -c nyqstk/src/Filter.cpp -o nyqstk/src/Filter.o $(CFLAGS) - -nyqstk/src/Instrmnt.o: nyqstk/src/Instrmnt.cpp nyqstk/include/Instrmnt.h - g++ -c nyqstk/src/Instrmnt.cpp -o nyqstk/src/Instrmnt.o $(CFLAGS) - -nyqstk/src/Noise.o: nyqstk/src/Noise.cpp nyqstk/include/Noise.h - g++ -c nyqstk/src/Noise.cpp -o nyqstk/src/Noise.o $(CFLAGS) - -nyqstk/src/OneZero.o: nyqstk/src/OneZero.cpp nyqstk/include/OneZero.h - g++ -c nyqstk/src/OneZero.cpp -o nyqstk/src/OneZero.o $(CFLAGS) - -nyqstk/src/ReedTable.o: nyqstk/src/ReedTable.cpp nyqstk/include/ReedTable.h - g++ -c nyqstk/src/ReedTable.cpp -o nyqstk/src/ReedTable.o $(CFLAGS) - -nyqstk/src/Saxofony.o: nyqstk/src/Saxofony.cpp nyqstk/include/Saxofony.h - g++ -c nyqstk/src/Saxofony.cpp -o nyqstk/src/Saxofony.o $(CFLAGS) - -nyqstk/src/Stk.o: nyqstk/src/Stk.cpp nyqstk/include/Stk.h - g++ -c nyqstk/src/Stk.cpp -o nyqstk/src/Stk.o $(CFLAGS) - -nyqstk/src/WaveLoop.o: nyqstk/src/WaveLoop.cpp nyqstk/include/WaveLoop.h - g++ -c nyqstk/src/WaveLoop.cpp -o nyqstk/src/WaveLoop.o $(CFLAGS) - -nyqstk/src/WvIn.o: nyqstk/src/WvIn.cpp nyqstk/include/WvIn.h - g++ -c nyqstk/src/WvIn.cpp -o nyqstk/src/WvIn.o $(CFLAGS) - -nyqstk/src/NRev.o: nyqstk/src/NRev.cpp nyqstk/include/NRev.h - g++ -c nyqstk/src/NRev.cpp -o nyqstk/src/NRev.o $(CFLAGS) - -nyqstk/src/JCRev.o: nyqstk/src/JCRev.cpp nyqstk/include/JCRev.h - g++ -c nyqstk/src/JCRev.cpp -o nyqstk/src/JCRev.o $(CFLAGS) - -nyqstk/src/PRCRev.o: nyqstk/src/PRCRev.cpp nyqstk/include/PRCRev.h - g++ -c nyqstk/src/PRCRev.cpp -o nyqstk/src/PRCRev.o $(CFLAGS) - -nyqstk/src/PitShift.o: nyqstk/src/PitShift.cpp nyqstk/include/PitShift.h - g++ -c nyqstk/src/PitShift.cpp -o nyqstk/src/PitShift.o $(CFLAGS) - -nyqstk/src/Chorus.o: nyqstk/src/Chorus.cpp nyqstk/include/Chorus.h - g++ -c nyqstk/src/Chorus.cpp -o nyqstk/src/Chorus.o $(CFLAGS) - -nyqstk/src/Bowed.o: nyqstk/src/Bowed.cpp nyqstk/include/Bowed.h - g++ -c nyqstk/src/Bowed.cpp -o nyqstk/src/Bowed.o $(CFLAGS) - -nyqstk/src/BowTable.o: nyqstk/src/BowTable.cpp nyqstk/include/BowTable.h - g++ -c nyqstk/src/BowTable.cpp -o nyqstk/src/BowTable.o $(CFLAGS) - -nyqstk/src/ADSR.o: nyqstk/src/ADSR.cpp nyqstk/include/ADSR.h - g++ -c nyqstk/src/ADSR.cpp -o nyqstk/src/ADSR.o $(CFLAGS) - -nyqstk/src/OnePole.o: nyqstk/src/OnePole.cpp nyqstk/include/OnePole.h - g++ -c nyqstk/src/OnePole.cpp -o nyqstk/src/OnePole.o $(CFLAGS) - -nyqstk/src/BiQuad.o: nyqstk/src/BiQuad.cpp nyqstk/include/BiQuad.h - g++ -c nyqstk/src/BiQuad.cpp -o nyqstk/src/BiQuad.o $(CFLAGS) - -nyqstk/src/BandedWG.o: nyqstk/src/BandedWG.cpp nyqstk/include/BandedWG.h - g++ -c nyqstk/src/BandedWG.cpp -o nyqstk/src/BandedWG.o $(CFLAGS) - -nyqstk/src/DelayA.o: nyqstk/src/DelayA.cpp nyqstk/include/DelayA.h - g++ -c nyqstk/src/DelayA.cpp -o nyqstk/src/DelayA.o $(CFLAGS) - -nyqstk/src/Mandolin.o: nyqstk/src/Mandolin.cpp nyqstk/include/Mandolin.h - g++ -c nyqstk/src/Mandolin.cpp -o nyqstk/src/Mandolin.o $(CFLAGS) - -nyqstk/src/PluckTwo.o: nyqstk/src/PluckTwo.cpp nyqstk/include/PluckTwo.h - g++ -c nyqstk/src/PluckTwo.cpp -o nyqstk/src/PluckTwo.o $(CFLAGS) - -nyqstk/src/Sitar.o: nyqstk/src/Sitar.cpp nyqstk/include/Sitar.h - g++ -c nyqstk/src/Sitar.cpp -o nyqstk/src/Sitar.o $(CFLAGS) - -nyqstk/src/ModalBar.o: nyqstk/src/ModalBar.cpp nyqstk/include/ModalBar.h - g++ -c nyqstk/src/ModalBar.cpp -o nyqstk/src/ModalBar.o $(CFLAGS) - -nyqstk/src/Modal.o: nyqstk/src/Modal.cpp nyqstk/include/Modal.h - g++ -c nyqstk/src/Modal.cpp -o nyqstk/src/Modal.o $(CFLAGS) - -nyqstk/src/Flute.o: nyqstk/src/Flute.cpp nyqstk/include/Flute.h - g++ -c nyqstk/src/Flute.cpp -o nyqstk/src/Flute.o $(CFLAGS) - -nyqstk/src/JetTable.o: nyqstk/src/JetTable.cpp nyqstk/include/JetTable.h - g++ -c nyqstk/src/JetTable.cpp -o nyqstk/src/JetTable.o $(CFLAGS) - -nyqstk/src/PoleZero.o: nyqstk/src/PoleZero.cpp nyqstk/include/PoleZero.h - g++ -c nyqstk/src/PoleZero.cpp -o nyqstk/src/PoleZero.o $(CFLAGS) - -xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h - $(CC) -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) - -xlisp/extern.o: xlisp/extern.c - $(CC) -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) - -xlisp/xldmem.o: xlisp/xldmem.c - $(CC) -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) - -xlisp/xlbfun.o: xlisp/xlbfun.c - $(CC) -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) - -xlisp/xlcont.o: xlisp/xlcont.c - $(CC) -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) - -xlisp/xldbug.o: xlisp/xldbug.c - $(CC) -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) - -xlisp/xleval.o: xlisp/xleval.c - $(CC) -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) - -xlisp/xlfio.o: xlisp/xlfio.c - $(CC) -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) - -xlisp/xlglob.o: xlisp/xlglob.c - $(CC) -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) - -xlisp/xlimage.o: xlisp/xlimage.c - $(CC) -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) - -xlisp/xlinit.o: xlisp/xlinit.c - $(CC) -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) - -xlisp/xlio.o: xlisp/xlio.c - $(CC) -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) - -xlisp/xlisp.o: xlisp/xlisp.c - $(CC) -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) - -xlisp/xljump.o: xlisp/xljump.c - $(CC) -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) - -xlisp/xllist.o: xlisp/xllist.c - $(CC) -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) - -xlisp/xlmath.o: xlisp/xlmath.c - $(CC) -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) - -xlisp/xlobj.o: xlisp/xlobj.c - $(CC) -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) - -xlisp/xlpp.o: xlisp/xlpp.c - $(CC) -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) - -xlisp/xlprin.o: xlisp/xlprin.c - $(CC) -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) - -xlisp/xlread.o: xlisp/xlread.c - $(CC) -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) - -xlisp/xlstr.o: xlisp/xlstr.c - $(CC) -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) - -xlisp/xlsubr.o: xlisp/xlsubr.c - $(CC) -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) - -xlisp/xlsym.o: xlisp/xlsym.c - $(CC) -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) - -xlisp/xlsys.o: xlisp/xlsys.c - $(CC) -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) - -xlisp/path.o: xlisp/path.c - $(CC) -c xlisp/path.c -o xlisp/path.o $(CFLAGS) - -cmt/cext.o: cmt/cext.c - $(CC) -c cmt/cext.c -o cmt/cext.o $(CFLAGS) - -cmt/cleanup.o: cmt/cleanup.c - $(CC) -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) - -cmt/cmdline.o: cmt/cmdline.c - $(CC) -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) - -cmt/cmtcmd.o: cmt/cmtcmd.c - $(CC) -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) - -cmt/moxc.o: cmt/moxc.c - $(CC) -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) - -cmt/mem.o: cmt/mem.c - $(CC) -c cmt/mem.c -o cmt/mem.o $(CFLAGS) - -cmt/midifile.o: cmt/midifile.c - $(CC) -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) - -cmt/midifns.o: cmt/midifns.c - $(CC) -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) - -cmt/record.o: cmt/record.c - $(CC) -c cmt/record.c -o cmt/record.o $(CFLAGS) - -cmt/seq.o: cmt/seq.c - $(CC) -c cmt/seq.c -o cmt/seq.o $(CFLAGS) - -cmt/seqmread.o: cmt/seqmread.c - $(CC) -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) - -cmt/seqmwrite.o: cmt/seqmwrite.c - $(CC) -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) - -cmt/seqread.o: cmt/seqread.c - $(CC) -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) - -cmt/seqwrite.o: cmt/seqwrite.c - $(CC) -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) - -cmt/tempomap.o: cmt/tempomap.c - $(CC) -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) - -cmt/timebase.o: cmt/timebase.c - $(CC) -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) - -cmt/userio.o: cmt/userio.c - $(CC) -c cmt/userio.c -o cmt/userio.o $(CFLAGS) - -nylsf/aiff.o: nylsf/aiff.c - $(CC) -c nylsf/aiff.c -o nylsf/aiff.o $(CFLAGS) - -nylsf/alaw.o: nylsf/alaw.c - $(CC) -c nylsf/alaw.c -o nylsf/alaw.o $(CFLAGS) - -nylsf/au.o: nylsf/au.c - $(CC) -c nylsf/au.c -o nylsf/au.o $(CFLAGS) - -nylsf/audio_detect.o: nylsf/audio_detect.c - $(CC) -c nylsf/audio_detect.c -o nylsf/audio_detect.o $(CFLAGS) - -nylsf/avr.o: nylsf/avr.c - $(CC) -c nylsf/avr.c -o nylsf/avr.o $(CFLAGS) - -nylsf/broadcast.o: nylsf/broadcast.c - $(CC) -c nylsf/broadcast.c -o nylsf/broadcast.o $(CFLAGS) - -nylsf/caf.o: nylsf/caf.c - $(CC) -c nylsf/caf.c -o nylsf/caf.o $(CFLAGS) - -nylsf/chanmap.o: nylsf/chanmap.c - $(CC) -c nylsf/chanmap.c -o nylsf/chanmap.o $(CFLAGS) - -nylsf/chunk.o: nylsf/chunk.c - $(CC) -c nylsf/chunk.c -o nylsf/chunk.o $(CFLAGS) - -nylsf/command.o: nylsf/command.c - $(CC) -c nylsf/command.c -o nylsf/command.o $(CFLAGS) - -nylsf/common.o: nylsf/common.c - $(CC) -c nylsf/common.c -o nylsf/common.o $(CFLAGS) - -nylsf/dither.o: nylsf/dither.c - $(CC) -c nylsf/dither.c -o nylsf/dither.o $(CFLAGS) - -nylsf/double64.o: nylsf/double64.c - $(CC) -c nylsf/double64.c -o nylsf/double64.o $(CFLAGS) - -nylsf/dwd.o: nylsf/dwd.c - $(CC) -c nylsf/dwd.c -o nylsf/dwd.o $(CFLAGS) - -nylsf/dwvw.o: nylsf/dwvw.c - $(CC) -c nylsf/dwvw.c -o nylsf/dwvw.o $(CFLAGS) - -nylsf/file_io.o: nylsf/file_io.c - $(CC) -c nylsf/file_io.c -o nylsf/file_io.o $(CFLAGS) - -nylsf/flac.o: nylsf/flac.c - $(CC) -c nylsf/flac.c -o nylsf/flac.o $(CFLAGS) - -nylsf/float32.o: nylsf/float32.c - $(CC) -c nylsf/float32.c -o nylsf/float32.o $(CFLAGS) - -nylsf/gsm610.o: nylsf/gsm610.c - $(CC) -c nylsf/gsm610.c -o nylsf/gsm610.o $(CFLAGS) - -nylsf/htk.o: nylsf/htk.c - $(CC) -c nylsf/htk.c -o nylsf/htk.o $(CFLAGS) - -nylsf/id3.o: nylsf/id3.c - $(CC) -c nylsf/id3.c -o nylsf/id3.o $(CFLAGS) - -nylsf/ima_adpcm.o: nylsf/ima_adpcm.c - $(CC) -c nylsf/ima_adpcm.c -o nylsf/ima_adpcm.o $(CFLAGS) - -nylsf/ima_oki_adpcm.o: nylsf/ima_oki_adpcm.c - $(CC) -c nylsf/ima_oki_adpcm.c -o nylsf/ima_oki_adpcm.o $(CFLAGS) - -nylsf/interleave.o: nylsf/interleave.c - $(CC) -c nylsf/interleave.c -o nylsf/interleave.o $(CFLAGS) - -nylsf/ircam.o: nylsf/ircam.c - $(CC) -c nylsf/ircam.c -o nylsf/ircam.o $(CFLAGS) - -nylsf/macbinary3.o: nylsf/macbinary3.c - $(CC) -c nylsf/macbinary3.c -o nylsf/macbinary3.o $(CFLAGS) - -nylsf/macos.o: nylsf/macos.c - $(CC) -c nylsf/macos.c -o nylsf/macos.o $(CFLAGS) - -nylsf/mat4.o: nylsf/mat4.c - $(CC) -c nylsf/mat4.c -o nylsf/mat4.o $(CFLAGS) - -nylsf/mat5.o: nylsf/mat5.c - $(CC) -c nylsf/mat5.c -o nylsf/mat5.o $(CFLAGS) - -nylsf/mpc2k.o: nylsf/mpc2k.c - $(CC) -c nylsf/mpc2k.c -o nylsf/mpc2k.o $(CFLAGS) - -nylsf/ms_adpcm.o: nylsf/ms_adpcm.c - $(CC) -c nylsf/ms_adpcm.c -o nylsf/ms_adpcm.o $(CFLAGS) - -nylsf/nist.o: nylsf/nist.c - $(CC) -c nylsf/nist.c -o nylsf/nist.o $(CFLAGS) - -nylsf/ogg.o: nylsf/ogg.c - $(CC) -c nylsf/ogg.c -o nylsf/ogg.o $(CFLAGS) - -nylsf/ogg_vorbis.o: nylsf/ogg_vorbis.c - $(CC) -c nylsf/ogg_vorbis.c -o nylsf/ogg_vorbis.o $(CFLAGS) - -nylsf/paf.o: nylsf/paf.c - $(CC) -c nylsf/paf.c -o nylsf/paf.o $(CFLAGS) - -nylsf/pcm.o: nylsf/pcm.c - $(CC) -c nylsf/pcm.c -o nylsf/pcm.o $(CFLAGS) - -nylsf/pvf.o: nylsf/pvf.c - $(CC) -c nylsf/pvf.c -o nylsf/pvf.o $(CFLAGS) - -nylsf/raw.o: nylsf/raw.c - $(CC) -c nylsf/raw.c -o nylsf/raw.o $(CFLAGS) - -nylsf/rf64.o: nylsf/rf64.c - $(CC) -c nylsf/rf64.c -o nylsf/rf64.o $(CFLAGS) - -nylsf/rx2.o: nylsf/rx2.c - $(CC) -c nylsf/rx2.c -o nylsf/rx2.o $(CFLAGS) - -nylsf/sd2.o: nylsf/sd2.c - $(CC) -c nylsf/sd2.c -o nylsf/sd2.o $(CFLAGS) - -nylsf/sds.o: nylsf/sds.c - $(CC) -c nylsf/sds.c -o nylsf/sds.o $(CFLAGS) - -nylsf/sndfile.o: nylsf/sndfile.c - $(CC) -c nylsf/sndfile.c -o nylsf/sndfile.o $(CFLAGS) - -nylsf/strings.o: nylsf/strings.c - $(CC) -c nylsf/strings.c -o nylsf/strings.o $(CFLAGS) - -nylsf/svx.o: nylsf/svx.c - $(CC) -c nylsf/svx.c -o nylsf/svx.o $(CFLAGS) - -nylsf/txw.o: nylsf/txw.c - $(CC) -c nylsf/txw.c -o nylsf/txw.o $(CFLAGS) - -nylsf/ulaw.o: nylsf/ulaw.c - $(CC) -c nylsf/ulaw.c -o nylsf/ulaw.o $(CFLAGS) - -nylsf/voc.o: nylsf/voc.c - $(CC) -c nylsf/voc.c -o nylsf/voc.o $(CFLAGS) - -nylsf/vox_adpcm.o: nylsf/vox_adpcm.c - $(CC) -c nylsf/vox_adpcm.c -o nylsf/vox_adpcm.o $(CFLAGS) - -nylsf/w64.o: nylsf/w64.c - $(CC) -c nylsf/w64.c -o nylsf/w64.o $(CFLAGS) - -nylsf/wav.o: nylsf/wav.c - $(CC) -c nylsf/wav.c -o nylsf/wav.o $(CFLAGS) - -nylsf/wav_w64.o: nylsf/wav_w64.c - $(CC) -c nylsf/wav_w64.c -o nylsf/wav_w64.o $(CFLAGS) - -nylsf/wve.o: nylsf/wve.c - $(CC) -c nylsf/wve.c -o nylsf/wve.o $(CFLAGS) - -nylsf/xi.o: nylsf/xi.c - $(CC) -c nylsf/xi.c -o nylsf/xi.o $(CFLAGS) - -nylsf/g72x.o: nylsf/g72x.c - $(CC) -c nylsf/g72x.c -o nylsf/g72x.o $(CFLAGS) - -nylsf/GSM610/add.o: nylsf/GSM610/add.c - $(CC) -c nylsf/GSM610/add.c -o nylsf/GSM610/add.o $(CFLAGS) - -nylsf/GSM610/code.o: nylsf/GSM610/code.c - $(CC) -c nylsf/GSM610/code.c -o nylsf/GSM610/code.o $(CFLAGS) - -nylsf/GSM610/decode.o: nylsf/GSM610/decode.c - $(CC) -c nylsf/GSM610/decode.c -o nylsf/GSM610/decode.o $(CFLAGS) - -nylsf/GSM610/gsm_create.o: nylsf/GSM610/gsm_create.c - $(CC) -c nylsf/GSM610/gsm_create.c -o nylsf/GSM610/gsm_create.o $(CFLAGS) - -nylsf/GSM610/gsm_decode.o: nylsf/GSM610/gsm_decode.c - $(CC) -c nylsf/GSM610/gsm_decode.c -o nylsf/GSM610/gsm_decode.o $(CFLAGS) - -nylsf/GSM610/gsm_destroy.o: nylsf/GSM610/gsm_destroy.c - $(CC) -c nylsf/GSM610/gsm_destroy.c -o nylsf/GSM610/gsm_destroy.o $(CFLAGS) - -nylsf/GSM610/gsm_encode.o: nylsf/GSM610/gsm_encode.c - $(CC) -c nylsf/GSM610/gsm_encode.c -o nylsf/GSM610/gsm_encode.o $(CFLAGS) - -nylsf/GSM610/gsm_option.o: nylsf/GSM610/gsm_option.c - $(CC) -c nylsf/GSM610/gsm_option.c -o nylsf/GSM610/gsm_option.o $(CFLAGS) - -nylsf/GSM610/long_term.o: nylsf/GSM610/long_term.c - $(CC) -c nylsf/GSM610/long_term.c -o nylsf/GSM610/long_term.o $(CFLAGS) - -nylsf/GSM610/lpc.o: nylsf/GSM610/lpc.c - $(CC) -c nylsf/GSM610/lpc.c -o nylsf/GSM610/lpc.o $(CFLAGS) - -nylsf/GSM610/preprocess.o: nylsf/GSM610/preprocess.c - $(CC) -c nylsf/GSM610/preprocess.c -o nylsf/GSM610/preprocess.o $(CFLAGS) - -nylsf/GSM610/rpe.o: nylsf/GSM610/rpe.c - $(CC) -c nylsf/GSM610/rpe.c -o nylsf/GSM610/rpe.o $(CFLAGS) - -nylsf/GSM610/short_term.o: nylsf/GSM610/short_term.c - $(CC) -c nylsf/GSM610/short_term.c -o nylsf/GSM610/short_term.o $(CFLAGS) - -nylsf/GSM610/table.o: nylsf/GSM610/table.c - $(CC) -c nylsf/GSM610/table.c -o nylsf/GSM610/table.o $(CFLAGS) - -nylsf/G72x/g721.o: nylsf/G72x/g721.c - $(CC) -c nylsf/G72x/g721.c -o nylsf/G72x/g721.o $(CFLAGS) - -nylsf/G72x/g723_16.o: nylsf/G72x/g723_16.c - $(CC) -c nylsf/G72x/g723_16.c -o nylsf/G72x/g723_16.o $(CFLAGS) - -nylsf/G72x/g723_24.o: nylsf/G72x/g723_24.c - $(CC) -c nylsf/G72x/g723_24.c -o nylsf/G72x/g723_24.o $(CFLAGS) - -nylsf/G72x/g723_40.o: nylsf/G72x/g723_40.c - $(CC) -c nylsf/G72x/g723_40.c -o nylsf/G72x/g723_40.o $(CFLAGS) - -nylsf/G72x/g72x.o: nylsf/G72x/g72x.c - $(CC) -c nylsf/G72x/g72x.c -o nylsf/G72x/g72x.o $(CFLAGS) - -sys/unix/osstuff.o: sys/unix/osstuff.c - $(CC) -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) - -misc/intgen: misc/intgen.c - cd misc; make intgen - -nyqsrc/sndfnintptrs.h: $(SNDFNINT_HDRS) misc/intgen Makefile - $(INTGEN) nyqsrc/sndfnint $(SNDFNINT_HDRS) - -nyqsrc/seqfnintptrs.h: $(SEQFNINT_HDRS) misc/intgen Makefile - $(INTGEN) nyqsrc/seqfnint $(SEQFNINT_HDRS) - -clean: - cd misc; make clean - cd liblo; test -f Makefile && make clean || true - cd portaudio; test -f Makefile && make clean || true - rm -f $(OBJECTS) -# These could be deleted, but they're part of the release, so we won't -# Note that these files are machine-generated: -# rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h -# rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h - -cleaner: clean - cd misc; make cleaner - rm -f *.backup */*.backup - rm -f *~ */*.*~ - rm -f #*# */#*# - rm -f *.save */*.save - rm -f *.CKP */*.CKP - rm -f *.BAK */*.BAK - rm -f *.old */*.old - rm -f *.gold */*.gold - rm -f playparms - rm -f points.dat - rm -f core.* core - rm -f $(NY) diff --git a/lib-src/libnyquist/nyquist/sys/unix/osstuff.c b/lib-src/libnyquist/nyquist/sys/unix/osstuff.c index 75b736fd6..2aa32b57f 100644 --- a/lib-src/libnyquist/nyquist/sys/unix/osstuff.c +++ b/lib-src/libnyquist/nyquist/sys/unix/osstuff.c @@ -70,7 +70,9 @@ static int lposition; static int line_edit = TRUE; #ifndef READ_LINE -#define typeahead_max 128 +// typeahead is high for humans but allows NyquistIDE to +// send envelope data and preferences +#define typeahead_max 1024 static char typeahead[typeahead_max]; static int typeahead_tail = 0; static int typeahead_head = 0; @@ -115,10 +117,24 @@ void osinit(const char *banner) pseudo randomness than does rand(). */ #if USE_RAND - srand(1); + // srand(1); +#if __APPLE__ + sranddev(); // initialize to a random seed +#else + srand(time(NULL)); +#endif #endif #if USE_RANDOM +#define USE_RANDOM something // see if compiler will tell us who + // set this first +// USE_RANDOM is not supported, or at least the code should +// be inspected carefully if USE_RANDOM is set. Things to look +// for are: Is USE_RAND undefined to avoid conflicts? Should +// the seed be initialized (as in sranddev() above under USE_RAND)? +// Who uses random()? Nyquist uses random numbers in XLISP, in the +// noise() function, in STK's Noise class, and probably other places. +you must die here srandom(1); #endif @@ -532,7 +548,7 @@ int ostgetc() /* ostputc - put a character to the terminal */ void ostputc(int ch) - { +{ oscheck(); /* check for control characters */ /* output the character */ @@ -542,7 +558,7 @@ void ostputc(int ch) /* output the character to the transcript file */ if (tfp) osaputc(ch,tfp); putchar(((char) ch)); - } +} /* ostoutflush - flush output buffer */ void ostoutflush() @@ -651,7 +667,6 @@ void oscheck(void) } } - run_time++; // when compute-bound, run_time is incremented by 10000 in about 15s, so // that's about 700 Hz. We want to flush any output at about 2Hz, so // we'll pick 400 as a round number. @@ -743,10 +758,10 @@ LVAL xget_user() /* xechoenabled -- set/clear echo_enabled flag (unix only) */ LVAL xechoenabled() { - int flag = (xlgetarg() != NULL); + int flag = (xlgetarg() != NULL); xllastarg(); - echo_enabled = flag; - return NULL; + echo_enabled = flag; + return NULL; } diff --git a/lib-src/libnyquist/nyquist/sys/unix/osx/run b/lib-src/libnyquist/nyquist/sys/unix/osx/run old mode 100644 new mode 100755 diff --git a/lib-src/libnyquist/nyquist/sys/unix/pmax/Makefile b/lib-src/libnyquist/nyquist/sys/unix/pmax/Makefile deleted file mode 100644 index 878479093..000000000 --- a/lib-src/libnyquist/nyquist/sys/unix/pmax/Makefile +++ /dev/null @@ -1,520 +0,0 @@ -# -# Makefile for Nyquist, SYSTEM-TYPE is PMAX -# run make in the top-level Nyquist directory to compile Nyquist -# -# NOTE: this file is machine-generated. DO NOT EDIT! -# Instead, modify makefile.lsp and regenerate the makefile. -# Ports and bug fixes are welcome - please mail them to -# dannenberg@cs.cmu.edu. Thanks. -# - -# This is the resulting executable (normally "ny"): -NY = ny - -# Standard list of includes (common to all unix versions) -INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft - -# system dependent stuff for pmax: - -CC = cc -CFLAGS = -DCMTSTUFF -g $(INCL) -LN = cc -LFLAGS = -lm - - -INTGEN = misc/intgen - -# Object files for Nyquist: -OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ - xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ - xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ - xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ - xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ - xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ - tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ - tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ - tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ - tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ - tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ - tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ - tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ - tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ - tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ - tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ - tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ - tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ - tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ - cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ - cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ - cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ - cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ - cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ - nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ - nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ - nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ - nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ - nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ - nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ - nyqsrc/seqfnint.o snd/audiopmax.o snd/sndpmax.o snd/ieeecvt.o \ - snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ - sys/unix/osstuff.o sys/unix/term.o - -# Sound functions to add to xlisp -NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ - nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ - nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ - nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ - tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ - tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ - tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ - tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ - tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ - tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ - tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ - tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ - tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ - tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ - tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ - tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ - tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h - -CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ - cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h - - -EVERYTHING = $(NY) runtime/system.lsp - -CURRENT = $(EVERYTHING) - -current: $(CURRENT) - -$(NY): $(OBJECTS) - $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) - -# copy appropriate system.lsp and make it read-only; -# changes should be made to sys/unix//system.lsp -runtime/system.lsp: sys/unix/pmax/system.lsp - chmod +w runtime/system.lsp - cp -p sys/unix/pmax/system.lsp runtime/system.lsp - chmod -w runtime/system.lsp - -nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) - -nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) - -nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) - -nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h - cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) - -nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) - -nyqsrc/handlers.o: nyqsrc/handlers.c - cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) - -nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) - -nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) - -nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) - -nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) - -nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) - -nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) - -nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) - -nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) - -nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) - -nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) - -nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) - -nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) - -nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) - -nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) - -nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) - -nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) - -nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) - -nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) - -nyqsrc/sndfail.o: nyqsrc/sndfail.c - cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) - -snd/audiopmax.o: snd/audiopmax.c snd/snd.h - cc -c snd/audiopmax.c -o snd/audiopmax.o $(CFLAGS) - -snd/sndpmax.o: snd/sndpmax.c snd/sndpmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndpmax.c -o snd/sndpmax.o $(CFLAGS) - -snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) - -snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/snd.c -o snd/snd.o $(CFLAGS) - -snd/sndcvt.o: snd/sndcvt.c snd/snd.h - cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) - -snd/sndio.o: snd/sndio.c snd/snd.h - cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) - -snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) - -fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) - -tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) - -tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/clip.c -o tran/clip.o $(CFLAGS) - -tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/const.c -o tran/const.o $(CFLAGS) - -tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) - -tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) - -tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/log.c -o tran/log.o $(CFLAGS) - -tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) - -tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/osc.c -o tran/osc.o $(CFLAGS) - -tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/prod.c -o tran/prod.o $(CFLAGS) - -tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) - -tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) - -tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/recip.c -o tran/recip.o $(CFLAGS) - -tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) - -tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/scale.c -o tran/scale.o $(CFLAGS) - -tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sine.c -o tran/sine.o $(CFLAGS) - -tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/partial.c -o tran/partial.o $(CFLAGS) - -tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/white.c -o tran/white.o $(CFLAGS) - -tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tone.c -o tran/tone.o $(CFLAGS) - -tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) - -tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) - -tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atone.c -o tran/atone.o $(CFLAGS) - -tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/reson.c -o tran/reson.o $(CFLAGS) - -tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/areson.c -o tran/areson.o $(CFLAGS) - -tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) - -tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) - -tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) - -tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) - -tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) - -tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) - -tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/offset.c -o tran/offset.o $(CFLAGS) - -tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/slope.c -o tran/slope.o $(CFLAGS) - -tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) - -tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) - -tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/shape.c -o tran/shape.o $(CFLAGS) - -tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) - -tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/exp.c -o tran/exp.o $(CFLAGS) - -tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) - -tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/follow.c -o tran/follow.o $(CFLAGS) - -tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/gate.c -o tran/gate.o $(CFLAGS) - -tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) - -tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) - -tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/congen.c -o tran/congen.o $(CFLAGS) - -tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) - -tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) - -tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) - -tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) - -tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) - -tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) - -tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/chase.c -o tran/chase.o $(CFLAGS) - -tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) - -tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) - -tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) - -nyqsrc/sndfnint.o: nyqsrc/sndfnint.c - cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) - -nyqsrc/seqfnint.o: nyqsrc/seqfnint.c - cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) - -xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h - cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) - -xlisp/extern.o: xlisp/extern.c - cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) - -xlisp/xldmem.o: xlisp/xldmem.c - cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) - -xlisp/xlbfun.o: xlisp/xlbfun.c - cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) - -xlisp/xlcont.o: xlisp/xlcont.c - cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) - -xlisp/xldbug.o: xlisp/xldbug.c - cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) - -xlisp/xleval.o: xlisp/xleval.c - cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) - -xlisp/xlfio.o: xlisp/xlfio.c - cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) - -xlisp/xlglob.o: xlisp/xlglob.c - cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) - -xlisp/xlimage.o: xlisp/xlimage.c - cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) - -xlisp/xlinit.o: xlisp/xlinit.c - cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) - -xlisp/xlio.o: xlisp/xlio.c - cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) - -xlisp/xlisp.o: xlisp/xlisp.c - cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) - -xlisp/xljump.o: xlisp/xljump.c - cc -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) - -xlisp/xllist.o: xlisp/xllist.c - cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) - -xlisp/xlmath.o: xlisp/xlmath.c - cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) - -xlisp/xlobj.o: xlisp/xlobj.c - cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) - -xlisp/xlpp.o: xlisp/xlpp.c - cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) - -xlisp/xlprin.o: xlisp/xlprin.c - cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) - -xlisp/xlread.o: xlisp/xlread.c - cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) - -xlisp/xlstr.o: xlisp/xlstr.c - cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) - -xlisp/xlsubr.o: xlisp/xlsubr.c - cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) - -xlisp/xlsym.o: xlisp/xlsym.c - cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) - -xlisp/xlsys.o: xlisp/xlsys.c - cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) - -cmt/cext.o: cmt/cext.c - cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) - -cmt/cleanup.o: cmt/cleanup.c - cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) - -cmt/cmdline.o: cmt/cmdline.c - cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) - -cmt/cmtcmd.o: cmt/cmtcmd.c - cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) - -cmt/moxc.o: cmt/moxc.c - cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) - -cmt/mem.o: cmt/mem.c - cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) - -cmt/midifile.o: cmt/midifile.c - cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) - -cmt/midifns.o: cmt/midifns.c - cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) - -cmt/record.o: cmt/record.c - cc -c cmt/record.c -o cmt/record.o $(CFLAGS) - -cmt/seq.o: cmt/seq.c - cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) - -cmt/seqmread.o: cmt/seqmread.c - cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) - -cmt/seqmwrite.o: cmt/seqmwrite.c - cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) - -cmt/seqread.o: cmt/seqread.c - cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) - -cmt/seqwrite.o: cmt/seqwrite.c - cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) - -cmt/tempomap.o: cmt/tempomap.c - cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) - -cmt/timebase.o: cmt/timebase.c - cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) - -cmt/userio.o: cmt/userio.c - cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) - -sys/unix/osstuff.o: sys/unix/osstuff.c - cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) - -misc/intgen: misc/intgen.c - cd misc; make intgen - -misc/unpacker: misc/unpacker.c misc/convert.c - cd misc; make unpacker - -misc/packer: misc/packer.c misc/convert.c - cd misc; make packer - -nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen - $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) - -nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen - $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) - -clean: - cd misc; make clean - rm -f $(OBJECTS) -# Note that these files are machine-generated: - rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h - rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h - -cleaner: clean - cd misc; make cleaner - rm -f *.backup */*.backup - rm -f *~ */*.*~ - rm -f *.save */*.save - rm -f *.CKP */*.CKP - rm -f *.BAK */*.BAK - rm -f *.old */*.old - rm -f *.gold */*.gold - rm -f playparms - rm -f points.dat diff --git a/lib-src/libnyquist/nyquist/sys/unix/rs6k/Makefile b/lib-src/libnyquist/nyquist/sys/unix/rs6k/Makefile deleted file mode 100644 index 1ba39f466..000000000 --- a/lib-src/libnyquist/nyquist/sys/unix/rs6k/Makefile +++ /dev/null @@ -1,529 +0,0 @@ -# -# Makefile for Nyquist, SYSTEM-TYPE is RS6K -# run make in the top-level Nyquist directory to compile Nyquist -# -# NOTE: this file is machine-generated. DO NOT EDIT! -# Instead, modify makefile.lsp and regenerate the makefile. -# Ports and bug fixes are welcome - please mail them to -# dannenberg@cs.cmu.edu. Thanks. -# - -# This is the resulting executable (normally "ny"): -NY = ny - -# Standard list of includes (common to all unix versions) -INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft - -# system dependent stuff for rs6k: - -MIDI = /afs/cs/project/music/rs6k/midilib -CC = cc -# change -g to -O for optimization -CFLAGS = -DCMTSTUFF -g $(INCL) -I$(MIDI) -XFLAGS = $(CFLAGS) -qlanglvl=extended -LN = xlc -qattr -qlist -LFLAGS = -lm -L$(MIDI) -lmidi -lbsd -lg - - -INTGEN = misc/intgen - -# Object files for Nyquist: -OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ - xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ - xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ - xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ - xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ - xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ - tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ - tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ - tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ - tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ - tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ - tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ - tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ - tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ - tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ - tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ - tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ - tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ - tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ - cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ - cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ - cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ - cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ - cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ - nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ - nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ - nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ - nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ - nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ - nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ - nyqsrc/seqfnint.o snd/audiors6k.o snd/sndrs6k.o snd/ieeecvt.o \ - snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ - sys/unix/osstuff.o sys/unix/term.o - -# Sound functions to add to xlisp -NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ - nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ - nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ - nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ - tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ - tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ - tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ - tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ - tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ - tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ - tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ - tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ - tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ - tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ - tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ - tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ - tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h - -CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ - cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h - - -EVERYTHING = $(NY) runtime/system.lsp - -CURRENT = $(EVERYTHING) - -current: $(CURRENT) - -$(NY): $(OBJECTS) - $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) - -# copy appropriate system.lsp and make it read-only; -# changes should be made to sys/unix//system.lsp -runtime/system.lsp: sys/unix/rs6k/system.lsp - chmod +w runtime/system.lsp - cp -p sys/unix/rs6k/system.lsp runtime/system.lsp - chmod -w runtime/system.lsp - -nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) - -nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) - -nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) - -nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h - cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) - -nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) - -nyqsrc/handlers.o: nyqsrc/handlers.c - cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) - -nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) - -nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) - -nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) - -nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) - -nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) - -nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) - -nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) - -nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) - -nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) - -nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) - -nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) - -nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) - -nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) - -nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) - -nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) - -nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) - -nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) - -nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) - -nyqsrc/sndfail.o: nyqsrc/sndfail.c - cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) - -snd/audiors6k.o: snd/audiors6k.c snd/snd.h - cc -c snd/audiors6k.c -o snd/audiors6k.o $(CFLAGS) - -snd/sndrs6k.o: snd/sndrs6k.c snd/sndrs6k.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndrs6k.c -o snd/sndrs6k.o $(CFLAGS) - -snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) - -snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/snd.c -o snd/snd.o $(CFLAGS) - -snd/sndcvt.o: snd/sndcvt.c snd/snd.h - cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) - -snd/sndio.o: snd/sndio.c snd/snd.h - cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) - -snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) - -fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) - -tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) - -tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/clip.c -o tran/clip.o $(CFLAGS) - -tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/const.c -o tran/const.o $(CFLAGS) - -tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) - -tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) - -tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/log.c -o tran/log.o $(CFLAGS) - -tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) - -tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/osc.c -o tran/osc.o $(CFLAGS) - -tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/prod.c -o tran/prod.o $(CFLAGS) - -tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) - -tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) - -tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/recip.c -o tran/recip.o $(CFLAGS) - -tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) - -tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/scale.c -o tran/scale.o $(CFLAGS) - -tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sine.c -o tran/sine.o $(CFLAGS) - -tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/partial.c -o tran/partial.o $(CFLAGS) - -tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/white.c -o tran/white.o $(CFLAGS) - -tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tone.c -o tran/tone.o $(CFLAGS) - -tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) - -tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) - -tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atone.c -o tran/atone.o $(CFLAGS) - -tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/reson.c -o tran/reson.o $(CFLAGS) - -tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/areson.c -o tran/areson.o $(CFLAGS) - -tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) - -tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) - -tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) - -tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) - -tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) - -tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) - -tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/offset.c -o tran/offset.o $(CFLAGS) - -tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/slope.c -o tran/slope.o $(CFLAGS) - -tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) - -tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) - -tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/shape.c -o tran/shape.o $(CFLAGS) - -tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) - -tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/exp.c -o tran/exp.o $(CFLAGS) - -tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) - -tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/follow.c -o tran/follow.o $(CFLAGS) - -tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/gate.c -o tran/gate.o $(CFLAGS) - -tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) - -tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) - -tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/congen.c -o tran/congen.o $(CFLAGS) - -tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) - -tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) - -tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) - -tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) - -tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) - -tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) - -tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/chase.c -o tran/chase.o $(CFLAGS) - -tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) - -tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) - -tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) - -nyqsrc/sndfnint.o: nyqsrc/sndfnint.c - cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) - -nyqsrc/seqfnint.o: nyqsrc/seqfnint.c - cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) - -xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h - cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) - -xlisp/extern.o: xlisp/extern.c - cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) - -xlisp/xldmem.o: xlisp/xldmem.c - cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) - -xlisp/xlbfun.o: xlisp/xlbfun.c - cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) - -xlisp/xlcont.o: xlisp/xlcont.c - cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) - -xlisp/xldbug.o: xlisp/xldbug.c - cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) - -xlisp/xleval.o: xlisp/xleval.c - cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) - -xlisp/xlfio.o: xlisp/xlfio.c - cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) - -xlisp/xlglob.o: xlisp/xlglob.c - cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) - -xlisp/xlimage.o: xlisp/xlimage.c - cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) - -xlisp/xlinit.o: xlisp/xlinit.c - cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) - -xlisp/xlio.o: xlisp/xlio.c - cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) - -xlisp/xlisp.o: xlisp/xlisp.c - cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) - -xlisp/xljump.o: xlisp/xljump.c - cc -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) - -xlisp/xllist.o: xlisp/xllist.c - cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) - -xlisp/xlmath.o: xlisp/xlmath.c - cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) - -xlisp/xlobj.o: xlisp/xlobj.c - cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) - -xlisp/xlpp.o: xlisp/xlpp.c - cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) - -xlisp/xlprin.o: xlisp/xlprin.c - cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) - -xlisp/xlread.o: xlisp/xlread.c - cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) - -xlisp/xlstr.o: xlisp/xlstr.c - cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) - -xlisp/xlsubr.o: xlisp/xlsubr.c - cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) - -xlisp/xlsym.o: xlisp/xlsym.c - cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) - -xlisp/xlsys.o: xlisp/xlsys.c - cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) - -cmt/cext.o: cmt/cext.c - cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) - -cmt/cleanup.o: cmt/cleanup.c - cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) - -cmt/cmdline.o: cmt/cmdline.c - cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) - -cmt/cmtcmd.o: cmt/cmtcmd.c - cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) - -cmt/moxc.o: cmt/moxc.c - cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) - -cmt/mem.o: cmt/mem.c - cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) - -cmt/midifile.o: cmt/midifile.c - cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) - -cmt/midifns.o: cmt/midifns.c - cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) - -cmt/record.o: cmt/record.c - cc -c cmt/record.c -o cmt/record.o $(CFLAGS) - -cmt/seq.o: cmt/seq.c - cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) - -cmt/seqmread.o: cmt/seqmread.c - cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) - -cmt/seqmwrite.o: cmt/seqmwrite.c - cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) - -cmt/seqread.o: cmt/seqread.c - cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) - -cmt/seqwrite.o: cmt/seqwrite.c - cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) - -cmt/tempomap.o: cmt/tempomap.c - cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) - -cmt/timebase.o: cmt/timebase.c - cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) - -cmt/userio.o: cmt/userio.c - cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) - -sys/unix/osstuff.o: sys/unix/osstuff.c - cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) - -misc/intgen: misc/intgen.c - cd misc; make intgen - -misc/unpacker: misc/unpacker.c misc/convert.c - cd misc; make unpacker - -misc/packer: misc/packer.c misc/convert.c - cd misc; make packer - -nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen - $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) - -nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen - $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) - -clean: - cd misc; make clean - rm -f $(OBJECTS) -# Note that these files are machine-generated: - rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h - rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h - -cleaner: clean - cd misc; make cleaner - rm -f *.backup */*.backup - rm -f *~ */*.*~ - rm -f *.save */*.save - rm -f *.CKP */*.CKP - rm -f *.BAK */*.BAK - rm -f *.old */*.old - rm -f *.gold */*.gold - rm -f playparms - rm -f points.dat - -tar: cleaner - sh -v sys/unix/cmu/tar.script - -backup: cleaner - sh -v sys/unix/cmu/backup.script diff --git a/lib-src/libnyquist/nyquist/sys/unix/sgi/Makefile b/lib-src/libnyquist/nyquist/sys/unix/sgi/Makefile deleted file mode 100644 index 309bc1978..000000000 --- a/lib-src/libnyquist/nyquist/sys/unix/sgi/Makefile +++ /dev/null @@ -1,521 +0,0 @@ -# -# Makefile for Nyquist, SYSTEM-TYPE is SGI -# run make in the top-level Nyquist directory to compile Nyquist -# -# NOTE: this file is machine-generated. DO NOT EDIT! -# Instead, modify makefile.lsp and regenerate the makefile. -# Ports and bug fixes are welcome - please mail them to -# dannenberg@cs.cmu.edu. Thanks. -# - -# This is the resulting executable (normally "ny"): -NY = ny - -# Standard list of includes (common to all unix versions) -INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft - -# system dependent stuff for sgi: - -CC = cc -CFLAGS = -DCMTSTUFF -g $(INCL) -LN = cc -LFLAGS = -lm -# you would need -lmd if UNIX_IRIX_MIDIFNS were defined in midifns.c - - -INTGEN = misc/intgen - -# Object files for Nyquist: -OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ - xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ - xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ - xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ - xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ - xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ - tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ - tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ - tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ - tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ - tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ - tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ - tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ - tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ - tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ - tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ - tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ - tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ - tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ - cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ - cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ - cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ - cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ - cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ - nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ - nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ - nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ - nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ - nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ - nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ - nyqsrc/seqfnint.o snd/audiosgi.o snd/sndsgi.o snd/ieeecvt.o \ - snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ - sys/unix/osstuff.o sys/unix/term.o - -# Sound functions to add to xlisp -NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ - nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ - nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ - nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ - tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ - tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ - tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ - tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ - tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ - tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ - tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ - tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ - tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ - tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ - tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ - tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ - tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h - -CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ - cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h - - -EVERYTHING = $(NY) runtime/system.lsp - -CURRENT = $(EVERYTHING) - -current: $(CURRENT) - -$(NY): $(OBJECTS) - $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) - -# copy appropriate system.lsp and make it read-only; -# changes should be made to sys/unix//system.lsp -runtime/system.lsp: sys/unix/sgi/system.lsp - chmod +w runtime/system.lsp - cp -p sys/unix/sgi/system.lsp runtime/system.lsp - chmod -w runtime/system.lsp - -nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) - -nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) - -nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) - -nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h - cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) - -nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) - -nyqsrc/handlers.o: nyqsrc/handlers.c - cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) - -nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) - -nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) - -nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) - -nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) - -nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) - -nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) - -nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) - -nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) - -nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) - -nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) - -nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) - -nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) - -nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) - -nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) - -nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) - -nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) - -nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) - -nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) - -nyqsrc/sndfail.o: nyqsrc/sndfail.c - cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) - -snd/audiosgi.o: snd/audiosgi.c snd/snd.h - cc -c snd/audiosgi.c -o snd/audiosgi.o $(CFLAGS) - -snd/sndsgi.o: snd/sndsgi.c snd/sndsgi.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndsgi.c -o snd/sndsgi.o $(CFLAGS) - -snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) - -snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/snd.c -o snd/snd.o $(CFLAGS) - -snd/sndcvt.o: snd/sndcvt.c snd/snd.h - cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) - -snd/sndio.o: snd/sndio.c snd/snd.h - cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) - -snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) - -fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) - -tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) - -tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/clip.c -o tran/clip.o $(CFLAGS) - -tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/const.c -o tran/const.o $(CFLAGS) - -tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) - -tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) - -tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/log.c -o tran/log.o $(CFLAGS) - -tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) - -tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/osc.c -o tran/osc.o $(CFLAGS) - -tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/prod.c -o tran/prod.o $(CFLAGS) - -tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) - -tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) - -tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/recip.c -o tran/recip.o $(CFLAGS) - -tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) - -tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/scale.c -o tran/scale.o $(CFLAGS) - -tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sine.c -o tran/sine.o $(CFLAGS) - -tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/partial.c -o tran/partial.o $(CFLAGS) - -tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/white.c -o tran/white.o $(CFLAGS) - -tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tone.c -o tran/tone.o $(CFLAGS) - -tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) - -tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) - -tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atone.c -o tran/atone.o $(CFLAGS) - -tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/reson.c -o tran/reson.o $(CFLAGS) - -tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/areson.c -o tran/areson.o $(CFLAGS) - -tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) - -tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) - -tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) - -tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) - -tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) - -tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) - -tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/offset.c -o tran/offset.o $(CFLAGS) - -tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/slope.c -o tran/slope.o $(CFLAGS) - -tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) - -tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) - -tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/shape.c -o tran/shape.o $(CFLAGS) - -tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) - -tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/exp.c -o tran/exp.o $(CFLAGS) - -tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) - -tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/follow.c -o tran/follow.o $(CFLAGS) - -tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/gate.c -o tran/gate.o $(CFLAGS) - -tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) - -tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) - -tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/congen.c -o tran/congen.o $(CFLAGS) - -tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) - -tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) - -tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) - -tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) - -tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) - -tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) - -tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/chase.c -o tran/chase.o $(CFLAGS) - -tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) - -tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) - -tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) - -nyqsrc/sndfnint.o: nyqsrc/sndfnint.c - cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) - -nyqsrc/seqfnint.o: nyqsrc/seqfnint.c - cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) - -xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h - cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) - -xlisp/extern.o: xlisp/extern.c - cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) - -xlisp/xldmem.o: xlisp/xldmem.c - cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) - -xlisp/xlbfun.o: xlisp/xlbfun.c - cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) - -xlisp/xlcont.o: xlisp/xlcont.c - cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) - -xlisp/xldbug.o: xlisp/xldbug.c - cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) - -xlisp/xleval.o: xlisp/xleval.c - cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) - -xlisp/xlfio.o: xlisp/xlfio.c - cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) - -xlisp/xlglob.o: xlisp/xlglob.c - cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) - -xlisp/xlimage.o: xlisp/xlimage.c - cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) - -xlisp/xlinit.o: xlisp/xlinit.c - cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) - -xlisp/xlio.o: xlisp/xlio.c - cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) - -xlisp/xlisp.o: xlisp/xlisp.c - cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) - -xlisp/xljump.o: xlisp/xljump.c - cc -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) - -xlisp/xllist.o: xlisp/xllist.c - cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) - -xlisp/xlmath.o: xlisp/xlmath.c - cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) - -xlisp/xlobj.o: xlisp/xlobj.c - cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) - -xlisp/xlpp.o: xlisp/xlpp.c - cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) - -xlisp/xlprin.o: xlisp/xlprin.c - cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) - -xlisp/xlread.o: xlisp/xlread.c - cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) - -xlisp/xlstr.o: xlisp/xlstr.c - cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) - -xlisp/xlsubr.o: xlisp/xlsubr.c - cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) - -xlisp/xlsym.o: xlisp/xlsym.c - cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) - -xlisp/xlsys.o: xlisp/xlsys.c - cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) - -cmt/cext.o: cmt/cext.c - cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) - -cmt/cleanup.o: cmt/cleanup.c - cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) - -cmt/cmdline.o: cmt/cmdline.c - cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) - -cmt/cmtcmd.o: cmt/cmtcmd.c - cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) - -cmt/moxc.o: cmt/moxc.c - cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) - -cmt/mem.o: cmt/mem.c - cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) - -cmt/midifile.o: cmt/midifile.c - cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) - -cmt/midifns.o: cmt/midifns.c - cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) - -cmt/record.o: cmt/record.c - cc -c cmt/record.c -o cmt/record.o $(CFLAGS) - -cmt/seq.o: cmt/seq.c - cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) - -cmt/seqmread.o: cmt/seqmread.c - cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) - -cmt/seqmwrite.o: cmt/seqmwrite.c - cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) - -cmt/seqread.o: cmt/seqread.c - cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) - -cmt/seqwrite.o: cmt/seqwrite.c - cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) - -cmt/tempomap.o: cmt/tempomap.c - cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) - -cmt/timebase.o: cmt/timebase.c - cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) - -cmt/userio.o: cmt/userio.c - cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) - -sys/unix/osstuff.o: sys/unix/osstuff.c - cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) - -misc/intgen: misc/intgen.c - cd misc; make intgen - -misc/unpacker: misc/unpacker.c misc/convert.c - cd misc; make unpacker - -misc/packer: misc/packer.c misc/convert.c - cd misc; make packer - -nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen - $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) - -nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen - $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) - -clean: - cd misc; make clean - rm -f $(OBJECTS) -# Note that these files are machine-generated: - rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h - rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h - -cleaner: clean - cd misc; make cleaner - rm -f *.backup */*.backup - rm -f *~ */*.*~ - rm -f *.save */*.save - rm -f *.CKP */*.CKP - rm -f *.BAK */*.BAK - rm -f *.old */*.old - rm -f *.gold */*.gold - rm -f playparms - rm -f points.dat diff --git a/lib-src/libnyquist/nyquist/sys/unix/sparc/Makefile b/lib-src/libnyquist/nyquist/sys/unix/sparc/Makefile deleted file mode 100644 index 5a0fba29b..000000000 --- a/lib-src/libnyquist/nyquist/sys/unix/sparc/Makefile +++ /dev/null @@ -1,520 +0,0 @@ -# -# Makefile for Nyquist, SYSTEM-TYPE is SPARC -# run make in the top-level Nyquist directory to compile Nyquist -# -# NOTE: this file is machine-generated. DO NOT EDIT! -# Instead, modify makefile.lsp and regenerate the makefile. -# Ports and bug fixes are welcome - please mail them to -# dannenberg@cs.cmu.edu. Thanks. -# - -# This is the resulting executable (normally "ny"): -NY = ny - -# Standard list of includes (common to all unix versions) -INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft - -# system dependent stuff for sparc: - -CC = gcc -CFLAGS = -DCMTSTUFF -g $(INCL) -LN = $(CC) -LFLAGS = -lm - - -INTGEN = misc/intgen - -# Object files for Nyquist: -OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ - xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ - xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ - xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ - xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ - xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ - tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ - tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ - tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ - tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ - tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ - tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ - tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ - tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ - tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ - tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ - tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ - tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ - tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ - cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ - cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ - cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ - cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ - cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ - nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ - nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ - nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ - nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ - nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ - nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ - nyqsrc/seqfnint.o snd/audiosparc.o snd/sndsparc.o snd/ieeecvt.o \ - snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ - sys/unix/osstuff.o sys/unix/term.o - -# Sound functions to add to xlisp -NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ - nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ - nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ - nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ - tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ - tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ - tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ - tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ - tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ - tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ - tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ - tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ - tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ - tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ - tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ - tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ - tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h - -CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ - cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h - - -EVERYTHING = $(NY) runtime/system.lsp - -CURRENT = $(EVERYTHING) - -current: $(CURRENT) - -$(NY): $(OBJECTS) - $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) - -# copy appropriate system.lsp and make it read-only; -# changes should be made to sys/unix//system.lsp -runtime/system.lsp: sys/unix/sparc/system.lsp - chmod +w runtime/system.lsp - cp -p sys/unix/sparc/system.lsp runtime/system.lsp - chmod -w runtime/system.lsp - -nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) - -nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) - -nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) - -nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h - cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) - -nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) - -nyqsrc/handlers.o: nyqsrc/handlers.c - cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) - -nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) - -nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) - -nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) - -nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) - -nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) - -nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) - -nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) - -nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) - -nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) - -nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) - -nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) - -nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) - -nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) - -nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) - -nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) - -nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) - -nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) - -nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) - -nyqsrc/sndfail.o: nyqsrc/sndfail.c - cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) - -snd/audiosparc.o: snd/audiosparc.c snd/snd.h - cc -c snd/audiosparc.c -o snd/audiosparc.o $(CFLAGS) - -snd/sndsparc.o: snd/sndsparc.c snd/sndsparc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndsparc.c -o snd/sndsparc.o $(CFLAGS) - -snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) - -snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/snd.c -o snd/snd.o $(CFLAGS) - -snd/sndcvt.o: snd/sndcvt.c snd/snd.h - cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) - -snd/sndio.o: snd/sndio.c snd/snd.h - cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) - -snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) - -fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) - -tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) - -tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/clip.c -o tran/clip.o $(CFLAGS) - -tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/const.c -o tran/const.o $(CFLAGS) - -tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) - -tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) - -tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/log.c -o tran/log.o $(CFLAGS) - -tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) - -tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/osc.c -o tran/osc.o $(CFLAGS) - -tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/prod.c -o tran/prod.o $(CFLAGS) - -tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) - -tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) - -tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/recip.c -o tran/recip.o $(CFLAGS) - -tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) - -tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/scale.c -o tran/scale.o $(CFLAGS) - -tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sine.c -o tran/sine.o $(CFLAGS) - -tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/partial.c -o tran/partial.o $(CFLAGS) - -tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/white.c -o tran/white.o $(CFLAGS) - -tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tone.c -o tran/tone.o $(CFLAGS) - -tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) - -tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) - -tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/atone.c -o tran/atone.o $(CFLAGS) - -tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/reson.c -o tran/reson.o $(CFLAGS) - -tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/areson.c -o tran/areson.o $(CFLAGS) - -tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) - -tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) - -tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) - -tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) - -tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) - -tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) - -tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/offset.c -o tran/offset.o $(CFLAGS) - -tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/slope.c -o tran/slope.o $(CFLAGS) - -tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) - -tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) - -tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/shape.c -o tran/shape.o $(CFLAGS) - -tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) - -tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/exp.c -o tran/exp.o $(CFLAGS) - -tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) - -tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/follow.c -o tran/follow.o $(CFLAGS) - -tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/gate.c -o tran/gate.o $(CFLAGS) - -tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) - -tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) - -tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/congen.c -o tran/congen.o $(CFLAGS) - -tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) - -tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) - -tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) - -tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) - -tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) - -tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) - -tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/chase.c -o tran/chase.o $(CFLAGS) - -tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) - -tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) - -tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h - cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) - -nyqsrc/sndfnint.o: nyqsrc/sndfnint.c - cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) - -nyqsrc/seqfnint.o: nyqsrc/seqfnint.c - cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) - -xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h - cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) - -xlisp/extern.o: xlisp/extern.c - cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) - -xlisp/xldmem.o: xlisp/xldmem.c - cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) - -xlisp/xlbfun.o: xlisp/xlbfun.c - cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) - -xlisp/xlcont.o: xlisp/xlcont.c - cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) - -xlisp/xldbug.o: xlisp/xldbug.c - cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) - -xlisp/xleval.o: xlisp/xleval.c - cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) - -xlisp/xlfio.o: xlisp/xlfio.c - cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) - -xlisp/xlglob.o: xlisp/xlglob.c - cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) - -xlisp/xlimage.o: xlisp/xlimage.c - cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) - -xlisp/xlinit.o: xlisp/xlinit.c - cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) - -xlisp/xlio.o: xlisp/xlio.c - cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) - -xlisp/xlisp.o: xlisp/xlisp.c - cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) - -xlisp/xljump.o: xlisp/xljump.c - cc -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) - -xlisp/xllist.o: xlisp/xllist.c - cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) - -xlisp/xlmath.o: xlisp/xlmath.c - cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) - -xlisp/xlobj.o: xlisp/xlobj.c - cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) - -xlisp/xlpp.o: xlisp/xlpp.c - cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) - -xlisp/xlprin.o: xlisp/xlprin.c - cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) - -xlisp/xlread.o: xlisp/xlread.c - cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) - -xlisp/xlstr.o: xlisp/xlstr.c - cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) - -xlisp/xlsubr.o: xlisp/xlsubr.c - cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) - -xlisp/xlsym.o: xlisp/xlsym.c - cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) - -xlisp/xlsys.o: xlisp/xlsys.c - cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) - -cmt/cext.o: cmt/cext.c - cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) - -cmt/cleanup.o: cmt/cleanup.c - cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) - -cmt/cmdline.o: cmt/cmdline.c - cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) - -cmt/cmtcmd.o: cmt/cmtcmd.c - cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) - -cmt/moxc.o: cmt/moxc.c - cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) - -cmt/mem.o: cmt/mem.c - cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) - -cmt/midifile.o: cmt/midifile.c - cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) - -cmt/midifns.o: cmt/midifns.c - cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) - -cmt/record.o: cmt/record.c - cc -c cmt/record.c -o cmt/record.o $(CFLAGS) - -cmt/seq.o: cmt/seq.c - cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) - -cmt/seqmread.o: cmt/seqmread.c - cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) - -cmt/seqmwrite.o: cmt/seqmwrite.c - cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) - -cmt/seqread.o: cmt/seqread.c - cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) - -cmt/seqwrite.o: cmt/seqwrite.c - cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) - -cmt/tempomap.o: cmt/tempomap.c - cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) - -cmt/timebase.o: cmt/timebase.c - cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) - -cmt/userio.o: cmt/userio.c - cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) - -sys/unix/osstuff.o: sys/unix/osstuff.c - cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) - -misc/intgen: misc/intgen.c - cd misc; make intgen - -misc/unpacker: misc/unpacker.c misc/convert.c - cd misc; make unpacker - -misc/packer: misc/packer.c misc/convert.c - cd misc; make packer - -nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen - $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) - -nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen - $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) - -clean: - cd misc; make clean - rm -f $(OBJECTS) -# Note that these files are machine-generated: - rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h - rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h - -cleaner: clean - cd misc; make cleaner - rm -f *.backup */*.backup - rm -f *~ */*.*~ - rm -f *.save */*.save - rm -f *.CKP */*.CKP - rm -f *.BAK */*.BAK - rm -f *.old */*.old - rm -f *.gold */*.gold - rm -f playparms - rm -f points.dat diff --git a/lib-src/libnyquist/nyquist/sys/win/README.txt b/lib-src/libnyquist/nyquist/sys/win/README.txt index dcccb83ad..769dfe849 100644 --- a/lib-src/libnyquist/nyquist/sys/win/README.txt +++ b/lib-src/libnyquist/nyquist/sys/win/README.txt @@ -16,21 +16,13 @@ message.) A source version is also available (the same source download is for Win32, Mac OS X, and Linux). The source version is intended for -developers who want to recompile Nyquist. The contents of the source -archive are extracted to the C:\nyquist directory, but you can put it -anywhere you like. You can then open the workspace file, nyquist.sln, -using Microsoft Visual C++. You can build and run the command line -version of Nyquist from within Visual C++. There is a batch file, -comp-ide.bat, for bulding the Nyquist IDE. This requires the Java SDK -from Sun Microsystems. +developers who want to recompile Nyquist. See Win32 Installation +in the reference manual for more instructions. 64-bit Windows -------------- -Nyquist runs on 64-bit Windows. Although you can compile a 64-bit -native version, Nyquist is currently released for 32-bit Windows. -When running on 64-bit Windows, note that the Registry entries will -be under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\CMU\Nyquist. The -"Wow6432Node" creates a special namespace for 32-bit programs. +Nyquist runs on 64-bit Windows and is no longer tested on 32-bit +Windows. Optional -------- @@ -85,28 +77,9 @@ installer may fail to set up the Registry entry that Nyquist uses to find initialization files. In this case, Nyquist will run a lisp interpreter, but many Nyquist functions will not be defined. If you can log in as administrator, do it and reinstall Nyquist. If you do -not have permission, you can still run Nyquist as follows: +not have permission, you'll have to find an administrator to run +the installer. -Create a file named init.lsp in the same directory as Nyquist.exe -(the default location is C:\Program Files\Nyquist, but you may -have installed it in some other location.) Put the following text -in init.lsp: - - (setf *search-path* - "C:/Program Files/Nyquist/runtime,C:/Program Files/Nyquist/lib") - (load "C:/Program Files/Nyquist/runtime/init.lsp") - -Note: in the three places where you see C:/Program Files/Nyquist, -insert the full path where Nyquist is actually installed. Use forward -slashes (/) rather than back slashes (\) to separate directories. For -example, if Nyquist is installed at D:\rbd\nyquist, then init.lsp -should contain: - - (setf *search-path* "D:/rbd/nyquist/runtime,D:/rbd/nyquist/lib") - (load "d:/rbd/nyquist/runtime/init.lsp") - -The variable *search-path*, if defined, is used in place of the -registry to determine search paths for files. SystemRoot ---------- @@ -151,41 +124,35 @@ Files\Java\jdk1.7.0\bin." Another possible problem is that your Java version is not compatible with Nyquist. In that case, you should see an error message complaining about "Unsupported major.minor version...". The current -major.minor version is 51 and you need to have Java version 1.7 +major.minor version is 51 and you need to have Java version 10 installed. (Use the command: java -version to find out your java version number.) You might have to reboot for these changes to take effect. -Compile Nyquist for using Visual Studio +Compile Nyquist using Visual Studio --------------------------------------- -Nyquist can be compiled using Visual Studio 2010 or 2012. You can -download Visual C++ Express 2010 and Visual Studio 2012 Express for -free from Mircosoft website. +Nyquist can be compiled using Visual Studio. -If you use Visual C++ 2010 Express, you MUST install SP1 (service pack -1). - -Open nyquist-vc2010.sln; If you are using Visual Studio 2012 or later -versions, open nyquist.sln instead. +To make a VS solution file, get CMake and run it on CMakeLists.txt in +the nyquist directory. In Visual Studio, - Set solution configuration to "Release" and solution platforms - to "Win32". - Click Debug->Build Solution (or press F7) - - Click Debug->Start Debugging (or press F5) + Set solution configuration to "Release" and solution platforms + to "Win64". + Build Solution + Start Debugging To build jnyqide, - Check if you have installed JDK and have the directory to - javac.exe added to your system PATH. - Run comp-ide.bat under the project root. It will compile .java - files under jnyqide. - For debugging, you can run the IDE immediately. - First copy nyquist\WinRel\nyquist.exe to nyquist\ (only do - this each time you recompile nyquist.) - Then, run jnyqide.bat. + Check if you have installed JDK and have the directory to + javac.exe added to your system PATH. + Run comp-ide.bat under the project root. It will compile .java + files under jnyqide. + For debugging, you can run the IDE immediately. + First copy nyquist\WinRel\nyquist.exe to nyquist\ (only do + this each time you recompile nyquist.) + Then, run jnyqide.bat. To generate a release: - Run releasenyqide.bat under the project root. It will copy + Run releasenyqide.bat under the project root. It will copy all the necessary files to .\nyqrelide\. You can run jnyqide.bat from there. diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/nywininttypes.h b/lib-src/libnyquist/nyquist/sys/win/msvc/nywininttypes.h new file mode 100644 index 000000000..d43dcee01 --- /dev/null +++ b/lib-src/libnyquist/nyquist/sys/win/msvc/nywininttypes.h @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2000,2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * -- Standard C header, defined in ISO/IEC 9899:1999 + * (aka "C99"), section 7.8. This defines format string conversion + * specifiers suitable for use within arguments to fprintf and fscanf + * and their ilk. + */ + +#if !defined(_INTTYPES_H_) +#define _INTTYPES_H_ + +#include + +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) + /* Translator is not ISO/IEC 9899:1999-compliant. */ + #if !defined(restrict) + #define restrict + #define __RESTRICT_KEYWORD_DEFINED__ + #endif +#endif + +/* "C++ implementations should define these macros only when + * __STDC_FORMAT_MACROS is defined before is included." + */ +#if (! defined(__cplusplus)) || defined(__STDC_FORMAT_MACROS) + + #undef __PRI_8_LENGTH_MODIFIER__ + #undef __PRI_64_LENGTH_MODIFIER__ + #undef __SCN_8_LENGTH_MODIFIER__ + #undef __SCN_64_LENGTH_MODIFIER__ + + #if defined(__STDC_LIBRARY_SUPPORTED__) + #define __PRI_8_LENGTH_MODIFIER__ "%hh" + #define __PRI_64_LENGTH_MODIFIER__ "%ll" + #define __SCN_8_LENGTH_MODIFIER__ "%hh" + #define __SCN_64_LENGTH_MODIFIER__ "%ll" + #else + #define __PRI_8_LENGTH_MODIFIER__ "%" /* none */ + #define __PRI_64_LENGTH_MODIFIER__ "%q" + #endif + + #define PRId8 __PRI_8_LENGTH_MODIFIER__ "d" + #define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i" + #define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o" + #define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u" + #define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x" + #define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X" + + #define PRId16 "%hd" + #define PRIi16 "%hi" + #define PRIo16 "%ho" + #define PRIu16 "%hu" + #define PRIx16 "%hx" + #define PRIX16 "%hX" + + #define PRId32 "%ld" + #define PRIi32 "%li" + #define PRIo32 "%lo" + #define PRIu32 "%lu" + #define PRIx32 "%lx" + #define PRIX32 "%lX" + + #define PRId64 __PRI_64_LENGTH_MODIFIER__ "d" + #define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i" + #define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o" + #define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u" + #define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x" + #define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X" + + #define PRIdLEAST8 PRId8 + #define PRIiLEAST8 PRIi8 + #define PRIoLEAST8 PRIo8 + #define PRIuLEAST8 PRIu8 + #define PRIxLEAST8 PRIx8 + #define PRIXLEAST8 PRIX8 + + #define PRIdLEAST16 PRId16 + #define PRIiLEAST16 PRIi16 + #define PRIoLEAST16 PRIo16 + #define PRIuLEAST16 PRIu16 + #define PRIxLEAST16 PRIx16 + #define PRIXLEAST16 PRIX16 + + #define PRIdLEAST32 PRId32 + #define PRIiLEAST32 PRIi32 + #define PRIoLEAST32 PRIo32 + #define PRIuLEAST32 PRIu32 + #define PRIxLEAST32 PRIx32 + #define PRIXLEAST32 PRIX32 + + #define PRIdLEAST64 PRId64 + #define PRIiLEAST64 PRIi64 + #define PRIoLEAST64 PRIo64 + #define PRIuLEAST64 PRIu64 + #define PRIxLEAST64 PRIx64 + #define PRIXLEAST64 PRIX64 + + #define PRIdFAST8 PRId32 + #define PRIiFAST8 PRIi32 + #define PRIoFAST8 PRIo32 + #define PRIuFAST8 PRIu32 + #define PRIxFAST8 PRIx32 + #define PRIXFAST8 PRIX32 + + #define PRIdFAST16 PRId32 + #define PRIiFAST16 PRIi32 + #define PRIoFAST16 PRIo32 + #define PRIuFAST16 PRIu32 + #define PRIxFAST16 PRIx32 + #define PRIXFAST16 PRIX32 + + #define PRIdFAST32 PRId32 + #define PRIiFAST32 PRIi32 + #define PRIoFAST32 PRIo32 + #define PRIuFAST32 PRIu32 + #define PRIxFAST32 PRIx32 + #define PRIXFAST32 PRIX32 + + #define PRIdFAST64 PRId64 + #define PRIiFAST64 PRIi64 + #define PRIoFAST64 PRIo64 + #define PRIuFAST64 PRIu64 + #define PRIxFAST64 PRIx64 + #define PRIXFAST64 PRIX64 + + #define PRIdPTR PRId32 + #define PRIiPTR PRIi32 + #define PRIoPTR PRIo32 + #define PRIuPTR PRIu32 + #define PRIxPTR PRIx32 + #define PRIXPTR PRIX32 + + #define PRIdMAX PRId64 + #define PRIiMAX PRIi64 + #define PRIoMAX PRIo64 + #define PRIuMAX PRIu64 + #define PRIxMAX PRIx64 + #define PRIXMAX PRIX64 + + #if defined(__SCN_8_LENGTH_MODIFIER__) + #define SCNd8 __SCN_8_LENGTH_MODIFIER__ "d" + #define SCNi8 __SCN_8_LENGTH_MODIFIER__ "i" + #define SCNo8 __SCN_8_LENGTH_MODIFIER__ "o" + #define SCNu8 __SCN_8_LENGTH_MODIFIER__ "u" + #define SCNx8 __SCN_8_LENGTH_MODIFIER__ "x" + #endif + + #define SCNd16 "%hd" + #define SCNi16 "%hi" + #define SCNo16 "%ho" + #define SCNu16 "%hu" + #define SCNx16 "%hx" + + #define SCNd32 "%ld" + #define SCNi32 "%li" + #define SCNo32 "%lo" + #define SCNu32 "%lu" + #define SCNx32 "%lx" + + #if defined(__SCN_64_LENGTH_MODIFIER__) + #define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d" + #define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i" + #define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o" + #define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u" + #define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x" + #endif + + #if defined(__SCN_8_LENGTH_MODIFIER__) + #define SCNdLEAST8 SCNd8 + #define SCNiLEAST8 SCNi8 + #define SCNoLEAST8 SCNo8 + #define SCNuLEAST8 SCNu8 + #define SCNxLEAST8 SCNx8 + #endif + + #define SCNdLEAST16 SCNd16 + #define SCNiLEAST16 SCNi16 + #define SCNoLEAST16 SCNo16 + #define SCNuLEAST16 SCNu16 + #define SCNxLEAST16 SCNx16 + + #define SCNdLEAST32 SCNd32 + #define SCNiLEAST32 SCNi32 + #define SCNoLEAST32 SCNo32 + #define SCNuLEAST32 SCNu32 + #define SCNxLEAST32 SCNx32 + + #if defined(__SCN_64_LENGTH_MODIFIER__) + #define SCNdLEAST64 SCNd64 + #define SCNiLEAST64 SCNi64 + #define SCNoLEAST64 SCNo64 + #define SCNuLEAST64 SCNu64 + #define SCNxLEAST64 SCNx64 + #endif + + #define SCNdFAST8 SCNd32 + #define SCNiFAST8 SCNi32 + #define SCNoFAST8 SCNo32 + #define SCNuFAST8 SCNu32 + #define SCNxFAST8 SCNx32 + + #define SCNdFAST16 SCNd32 + #define SCNiFAST16 SCNi32 + #define SCNoFAST16 SCNo32 + #define SCNuFAST16 SCNu32 + #define SCNxFAST16 SCNx32 + + #define SCNdFAST32 SCNd32 + #define SCNiFAST32 SCNi32 + #define SCNoFAST32 SCNo32 + #define SCNuFAST32 SCNu32 + #define SCNxFAST32 SCNx32 + + #if defined(__SCN_64_LENGTH_MODIFIER__) + #define SCNdFAST64 SCNd64 + #define SCNiFAST64 SCNi64 + #define SCNoFAST64 SCNo64 + #define SCNuFAST64 SCNu64 + #define SCNxFAST64 SCNx64 + #endif + + #define SCNdPTR SCNd32 + #define SCNiPTR SCNi32 + #define SCNoPTR SCNo32 + #define SCNuPTR SCNu32 + #define SCNxPTR SCNx32 + + #if defined(__SCN_64_LENGTH_MODIFIER__) + #define SCNdMAX SCNd64 + #define SCNiMAX SCNi64 + #define SCNoMAX SCNo64 + #define SCNuMAX SCNu64 + #define SCNxMAX SCNx64 + #endif + +#endif /* if C++, then __STDC_FORMAT_MACROS enables the above macros */ + +#if defined(__STDC_LIBRARY_SUPPORTED__) + + /* 7.8.2.1 */ + extern intmax_t imaxabs(intmax_t j); + + /* 7.8.2.2 */ + typedef struct { + intmax_t quot; + intmax_t rem; + } imaxdiv_t; + + extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); + + /* 7.8.2.3 */ + extern intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base); + extern uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base); + + /* 7.8.2.4 */ + extern intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); + extern uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); + +#endif + +/* + No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros; + in fact, you can't #undef them, because later uses of any of + their dependents will *not* then do the intended substitution. + Expansion of a #define like this one: + + #define x IDENT y + + uses the cpp value of IDENT at the location where x is *expanded*, + not where it is #defined. +*/ + +#if defined(__RESTRICT_KEYWORD_DEFINED__) + #undef restrict + #undef __RESTRICT_KEYWORD_DEFINED__ +#endif + +#endif /* !_INTTYPES_H_ */ \ No newline at end of file diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/stdint-old.h b/lib-src/libnyquist/nyquist/sys/win/msvc/stdint-old.h new file mode 100644 index 000000000..07bfe6750 --- /dev/null +++ b/lib-src/libnyquist/nyquist/sys/win/msvc/stdint-old.h @@ -0,0 +1,55 @@ +/* stdint.h -- missing from Microsoft compilers, so this is a + * version constructed solely for libsndfile. It does not + * have a complete set of definitions. + * + * This file should be in a directory of include files used only + * by Microsoft compilers + * + * Roger Dannenberg, Aug 2012 + */ + +#ifndef _MSC_VER +#error "This Microsoft-specific file was included by a non-Microsoft compiler" +#endif + +#ifndef STDINT_H +#define STDINT_H + +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +#define _W64 __w64 +#else +#define _W64 +#endif +#endif + +#if (_MSC_VER < 1300) +//typedef signed char int8_t; +typedef signed short int16_t; +typedef signed int int32_t; +//typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#else +//typedef signed __int8 int8_t; +typedef signed __int16 int16_t; +typedef signed __int32 int32_t; +//typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +#endif +//typedef signed __int64 int64_t; +//typedef unsigned __int64 uint64_t; + + +#endif // STDINT_H + diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/switches.h b/lib-src/libnyquist/nyquist/sys/win/msvc/switches.h index a51e60345..1ae63277a 100644 --- a/lib-src/libnyquist/nyquist/sys/win/msvc/switches.h +++ b/lib-src/libnyquist/nyquist/sys/win/msvc/switches.h @@ -9,6 +9,8 @@ Error: switches.h included more than once. #endif +#define __func__ __FUNCTION__ + #define HAS_STDLIB_H 1 #define HAS_SYS_TYPES_H 1 #define HAS_SYS_STAT_H 1 @@ -78,7 +80,7 @@ void nyquist_printf(char *format, ...); #undef HAVE_GMTIME_R /* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 +#define HAVE_INTTYPES_H 0 /* Define if you have C99's lrint function. */ #define HAVE_LRINT 0 @@ -87,9 +89,7 @@ void nyquist_printf(char *format, ...); #define HAVE_LRINTF 0 /* Define to 1 if you have the `snprintf' function. */ -#if _MSC_VER < 1900 -#define snprintf _snprintf -#endif +// #define snprintf _snprintf -- snprintf is a Standard Library function #define HAVE_SNPRINTF 1 /* Define to 1 if the system has the type `ssize_t'. */ diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.c b/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.c index 6416017a7..9779e3745 100644 --- a/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.c +++ b/lib-src/libnyquist/nyquist/sys/win/msvc/winfun.c @@ -21,7 +21,7 @@ LVAL xsetdir() { verbose = (xlgetarg() != NIL); } xllastarg(); - if (ok_to_open(ssCurDir, "r")) + if (ok_to_open(ssCurDir, "r")) { if (SetCurrentDirectory(ssCurDir)) { if (GetCurrentDirectory( sizeof(szCurDir)/sizeof(TCHAR), szCurDir)) { @@ -30,7 +30,7 @@ LVAL xsetdir() { stdputstr("Current Directory: "); stdputstr(szCurDir); stdputstr("\n"); */ - } + } } } if (verbose) stdputstr("Directory Setting Error\n"); diff --git a/lib-src/libnyquist/nyquist/sys/win/msvc/winstuff.c b/lib-src/libnyquist/nyquist/sys/win/msvc/winstuff.c index 65475692f..a4babaead 100644 --- a/lib-src/libnyquist/nyquist/sys/win/msvc/winstuff.c +++ b/lib-src/libnyquist/nyquist/sys/win/msvc/winstuff.c @@ -45,6 +45,10 @@ continuing to check for Windows process messages. #include /* Added by Dannneberg, Apr 2004 */ #include "exitpa.h" /* Added by Dannneberg, Apr 2004 */ +#if OSC +#include "nyq-osc-server.h" +#endif + const char os_pathchar = '\\'; const char os_sepchar = ','; @@ -195,7 +199,7 @@ void start_input_thread() } } -void osinit (char *banner) +void osinit(const char *banner) { printf("%s\n", banner); if (_isatty( _fileno( stdin ) ) ){ @@ -217,29 +221,29 @@ void osinit (char *banner) } } -FILE *osaopen (char *name, char *mode) { +FILE *osaopen(const char *name, const char *mode) { FILE *fp = NULL; #ifdef SAFE_NYQUIST if (ok_to_open(name, mode)) #endif - fp = fopen (name, mode); + fp = fopen(name, mode); return fp; } -FILE *osbopen (char *name, char *mode) { +FILE *osbopen(const char *name, const char *mode) { FILE *fp = NULL; char nmode[4]; strcpy (nmode, mode); strcat (nmode, "b"); #ifdef SAFE_NYQUIST - if (ok_to_open(name, mode)) + if (ok_to_open(name, nmode)) #endif - fp = fopen (name, mode); + fp = fopen (name, nmode); return fp; } -int osclose (FILE *fp) { return (fclose (fp)); } -int osaputc (int ch, FILE *fp) { return (putc (ch, fp)); } -int osbputc (int ch, FILE *fp) { return (putc (ch, fp)); } +int osclose(FILE *fp) { return (fclose (fp)); } +int osaputc(int ch, FILE *fp) { return (putc (ch, fp)); } +int osbputc(int ch, FILE *fp) { return (putc (ch, fp)); } void osoutflush(FILE *fp) { fflush(fp); } /* osagetc - get a character from an ascii file */ @@ -251,7 +255,7 @@ int osagetc(fp) extern int abort_flag; extern int redirect_flag; //Added by Ning Hu Apr.2001 -int ostgetc (void) +int ostgetc(void) { int c; NEED_INPUT; @@ -275,7 +279,7 @@ int ostgetc (void) } -void ostputc (int ch) { +void ostputc(int ch) { // macputc (ch); putchar(ch); // console @@ -289,14 +293,14 @@ void ostoutflush() } -void osflush (void) { +void osflush(void) { lineptr = linebuf; numChars = 0; lposition = 0; } -void oscheck (void) { +void oscheck(void) { MSG lpMsg; #if OSC @@ -328,7 +332,7 @@ void oscheck (void) { osflush(); xlbreak("BREAK", s_unbound); } - run_time++; + if (run_time % 30 == 0) { // maybe we should call fflush here like in Unix; I'm not sure if this is // a bug or it is not necessary for Windows - RBD @@ -344,9 +348,9 @@ void oscheck (void) { } //Update end -void oserror (char *msg) { +void oserror(const char *msg) { char line[100], *p; - sprintf (line,"error: %s\n",msg); + sprintf (line, "error: %s\n", msg); for (p = line; *p != '\0'; ++p) ostputc (*p); } @@ -358,7 +362,7 @@ void osfinish(void) { // ExitToShell (); } -int renamebackup (char *filename) { return 0; } +int renamebackup(char *filename) { return 0; } @@ -373,7 +377,7 @@ static int osdir_list_status = OSDIR_LIST_READY; static char osdir_path[OSDIR_MAX_PATH]; // osdir_list_start -- prepare to list a directory -int osdir_list_start(char *path) +int osdir_list_start(const char *path) { if (!ok_to_open(path, "r")) return FALSE; if (strlen(path) >= OSDIR_MAX_PATH - 2) { diff --git a/lib-src/libnyquist/nyquist/sys/win/nyqrelide.iss b/lib-src/libnyquist/nyquist/sys/win/nyqrelide.iss index 4f9a45070..20da3c3da 100644 --- a/lib-src/libnyquist/nyquist/sys/win/nyqrelide.iss +++ b/lib-src/libnyquist/nyquist/sys/win/nyqrelide.iss @@ -1,13 +1,84 @@ ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! +[Code] +{ function BrowseForFolder(const Prompt: String; var Directory: String; const NewFolderButton: Boolean): Boolean; } +var + DataDirPage: TInputDirWizardPage; + +procedure InitializeWizard; +begin + { Create the pages } + DataDirPage := CreateInputDirPage(wpSelectDir, + 'Select nyuqist Directory', 'Where should nyquist/\{runtime,lib,doc,demos\} be installed?', + 'Select the folder in which Setup should create the nyquist directory (usually your home directory), then click Next.', + False, ''); + DataDirPage.Add(''); + { Set default values, using settings that were stored last time if possible } + + DataDirPage.Values[0] := GetPreviousData('DataDir', ''); +end; + +procedure RegisterPreviousData(PreviousDataKey: Integer); +var + UsageMode: String; +begin + { Store the settings so we can restore them next time } + SetPreviousData(PreviousDataKey, 'DataDir', DataDirPage.Values[0]); +end; + +function ShouldSkipPage(PageID: Integer): Boolean; +begin + { Skip pages that shouldn't be shown } + Result := False; +end; + +function NextButtonClick(CurPageID: Integer): Boolean; +var + I: Integer; +begin + { Validate certain pages before allowing the user to proceed } + if DataDirPage.Values[0] = '' then + DataDirPage.Values[0] := 'C:\Users\' + GetUserNameString(); + Result := True; +end; + +function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, + MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String; +var + S: String; +begin + { Fill the 'Ready Memo' with the normal settings and the custom settings } + S := Space + ExpandConstant('{app}') + ' (nyquist programs location)' + NewLine; + S := S + NewLine; + S := S + Space + DataDirPage.Values[0] + ' (nyquist directory location)' + NewLine; + S := S + Newline; + S := S + 'Note: Once installation is complete, do not move or' + NewLine; + S := S + ' rename the nyquist directory unless you also' + NewLine; + S := S + ' update the Registry:' + NewLine; + S := S + ' HKLM Software\CMU\Nyquist\XLISPPATH.' + NewLine; + Result := S; +end; + +function GetDataDir(Param: String): String; +begin + { Return the selected DataDir } + Result := DataDirPage.Values[0] + '\nyquist'; +end; [Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{3E29123D-0726-441C-8A38-42836B05F74C} +AppId=3E29123D-0726-441C-8A38-42836B05F74C +;; apply next 2 lines (x64) if ny.exe is compiled for +;; x86_64, but if nyquist is 32-bit, use the default +;; values (comment out the next 2 lines). Default puts Nyquist into +;; Program Files (x86), and sets registry values in Wow6432Node +;; section where 32-bit Nyquist will find the XLISPPATH. +ArchitecturesInstallIn64BitMode=x64 +ArchitecturesAllowed=x64 AppName=NyquistIDE -AppVerName=NyquistIDE 3.08 +AppVerName=NyquistIDE 3.15 AppPublisher=Roger B. Dannenberg AppPublisherURL=http://www.cs.cmu.edu/~music/nyquist AppSupportURL=http://www.cs.cmu.edu/~music/nyquist @@ -19,7 +90,7 @@ InfoAfterFile=nyqrelide\Readme.txt OutputDir=setup OutputBaseFilename=setupnyqiderun SetupIconFile=sys\win\wingui\nycon.ico -SourceDir=c:\Users\Roger\research\nyquist2013 +SourceDir=c:\Users\roger\nyquist Compression=lzma SolidCompression=yes @@ -30,11 +101,17 @@ Name: "english"; MessagesFile: "compiler:Default.isl" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] -Source: "nyqrelide\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "nyqrelide\jnyqide\*"; DestDir: "{app}\jnyqide"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "nyqrelide\jnyqide.bat"; DestDir: "{app}"; Flags: ignoreversion +Source: "nyqrelide\lib\*"; DestDir: "{code:GetDataDir}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "nyqrelide\doc\*"; DestDir: "{code:GetDataDir}\doc"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "nyqrelide\demos\*"; DestDir: "{code:GetDataDir}\demos"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "nyqrelide\runtime\*"; DestDir: "{code:GetDataDir}\runtime"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "nyqrelide\*.txt"; DestDir: "{code:GetDataDir}"; Flags: ignoreversion ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Registry] -Root: HKLM32; Subkey: "Software\CMU\Nyquist"; ValueType: string; ValueName: "XLISPPATH"; ValueData: "{app}\runtime,{app}\lib" +Root: HKLM; Subkey: "Software\CMU\Nyquist"; ValueType: string; ValueName: "XLISPPATH"; ValueData: "{code:GetDataDir}\runtime,{code:GetDataDir}\lib,{code:GetDataDir}\demos" [Icons] Name: "{group}\NyquistIDE"; Filename: "{app}\jnyqide.bat"; WorkingDir: "{app}" diff --git a/lib-src/libnyquist/nyquist/sys/win/wingui/nycon.ico b/lib-src/libnyquist/nyquist/sys/win/wingui/nycon.ico new file mode 100644 index 000000000..92ce305c3 Binary files /dev/null and b/lib-src/libnyquist/nyquist/sys/win/wingui/nycon.ico differ diff --git a/lib-src/libnyquist/nyquist/sys/win/wingui/winmain.aps b/lib-src/libnyquist/nyquist/sys/win/wingui/winmain.aps new file mode 100644 index 000000000..9efff7e28 Binary files /dev/null and b/lib-src/libnyquist/nyquist/sys/win/wingui/winmain.aps differ diff --git a/lib-src/libnyquist/nyquist/tran/abs.c b/lib-src/libnyquist/nyquist/tran/abs.c index 986854e9a..14a2615dc 100644 --- a/lib-src/libnyquist/nyquist/tran/abs.c +++ b/lib-src/libnyquist/nyquist/tran/abs.c @@ -121,12 +121,12 @@ void abs_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/allpoles.c b/lib-src/libnyquist/nyquist/tran/allpoles.c index a17fae549..d1ed2516e 100644 --- a/lib-src/libnyquist/nyquist/tran/allpoles.c +++ b/lib-src/libnyquist/nyquist/tran/allpoles.c @@ -171,12 +171,12 @@ void allpoles_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from x_snd up to final_time for this block of zeros */ - while ((round((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >= + while ((ROUNDBIG((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >= susp->x_snd->current) susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->x_snd->t0) * susp->x_snd->sr - + n = ROUNDBIG((final_time - susp->x_snd->t0) * susp->x_snd->sr - (susp->x_snd->current - susp->x_snd_cnt)); susp->x_snd_ptr += n; susp_took(x_snd_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/alpass.alg b/lib-src/libnyquist/nyquist/tran/alpass.alg index 3ee3b7fa5..2b2d6a4f3 100644 --- a/lib-src/libnyquist/nyquist/tran/alpass.alg +++ b/lib-src/libnyquist/nyquist/tran/alpass.alg @@ -3,7 +3,7 @@ (ARGUMENTS ("sound_type" "input") ("time_type" "delay") ("double" "feedback")) (START (MIN input)) (STATE ("double" "feedback" "feedback") - ("long" "delaylen" "max(1, round(input->sr * delay))") + ("long" "delaylen" "max(1, ROUND32(input->sr * delay))") ("sample_type *" "delaybuf" "(sample_type *) calloc (susp->delaylen, sizeof(sample_type))") ("sample_type *" "delayptr" "susp->delaybuf") diff --git a/lib-src/libnyquist/nyquist/tran/alpass.c b/lib-src/libnyquist/nyquist/tran/alpass.c index 7ab00c7e0..4d739c949 100644 --- a/lib-src/libnyquist/nyquist/tran/alpass.c +++ b/lib-src/libnyquist/nyquist/tran/alpass.c @@ -102,12 +102,12 @@ void alpass_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); @@ -156,7 +156,7 @@ sound_type snd_make_alpass(sound_type input, time_type delay, double feedback) falloc_generic(susp, alpass_susp_node, "snd_make_alpass"); susp->feedback = feedback; - susp->delaylen = max(1, round(input->sr * delay)); + susp->delaylen = max(1, ROUND32(input->sr * delay)); susp->delaybuf = (sample_type *) calloc (susp->delaylen, sizeof(sample_type)); susp->delayptr = susp->delaybuf; susp->endptr = susp->delaybuf + susp->delaylen; diff --git a/lib-src/libnyquist/nyquist/tran/alpasscv.alg b/lib-src/libnyquist/nyquist/tran/alpasscv.alg index 62960479c..f8114663e 100644 --- a/lib-src/libnyquist/nyquist/tran/alpasscv.alg +++ b/lib-src/libnyquist/nyquist/tran/alpasscv.alg @@ -3,7 +3,7 @@ (ARGUMENTS ("sound_type" "input") ("time_type" "delay") ("sound_type" "feedback")) (SAMPLE-RATE (MAX input)) (START (MAX input feedback)) -(STATE ("long" "delaylen" "max(1, round(input->sr * delay))") +(STATE ("long" "delaylen" "max(1, ROUND32(input->sr * delay))") ("sample_type *" "delaybuf" "(sample_type *) calloc (susp->delaylen, sizeof(sample_type))") ("sample_type *" "delayptr" "susp->delaybuf") diff --git a/lib-src/libnyquist/nyquist/tran/alpasscv.c b/lib-src/libnyquist/nyquist/tran/alpasscv.c index a68814877..dbdd3b325 100644 --- a/lib-src/libnyquist/nyquist/tran/alpasscv.c +++ b/lib-src/libnyquist/nyquist/tran/alpasscv.c @@ -395,20 +395,20 @@ void alpasscv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* fetch samples from feedback up to final_time for this block of zeros */ - while ((round((final_time - susp->feedback->t0) * susp->feedback->sr)) >= + while ((ROUNDBIG((final_time - susp->feedback->t0) * susp->feedback->sr)) >= susp->feedback->current) susp_get_samples(feedback, feedback_ptr, feedback_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); - n = round((final_time - susp->feedback->t0) * susp->feedback->sr - + n = ROUNDBIG((final_time - susp->feedback->t0) * susp->feedback->sr - (susp->feedback->current - susp->feedback_cnt)); susp->feedback_ptr += n; susp_took(feedback_cnt, n); @@ -463,7 +463,7 @@ sound_type snd_make_alpasscv(sound_type input, time_type delay, sound_type feedb if (input->sr < sr) { input->scale = scale_factor; scale_factor = 1.0F; } falloc_generic(susp, alpasscv_susp_node, "snd_make_alpasscv"); - susp->delaylen = max(1, round(input->sr * delay)); + susp->delaylen = max(1, ROUND32(input->sr * delay)); susp->delaybuf = (sample_type *) calloc (susp->delaylen, sizeof(sample_type)); susp->delayptr = susp->delaybuf; susp->endptr = susp->delaybuf + susp->delaylen; diff --git a/lib-src/libnyquist/nyquist/tran/alpassvc.c b/lib-src/libnyquist/nyquist/tran/alpassvc.c index 62dca79a8..63e97fd9b 100644 --- a/lib-src/libnyquist/nyquist/tran/alpassvc.c +++ b/lib-src/libnyquist/nyquist/tran/alpassvc.c @@ -419,20 +419,20 @@ void alpassvc_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* fetch samples from delaysnd up to final_time for this block of zeros */ - while ((round((final_time - susp->delaysnd->t0) * susp->delaysnd->sr)) >= + while ((ROUNDBIG((final_time - susp->delaysnd->t0) * susp->delaysnd->sr)) >= susp->delaysnd->current) susp_get_samples(delaysnd, delaysnd_ptr, delaysnd_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); - n = round((final_time - susp->delaysnd->t0) * susp->delaysnd->sr - + n = ROUNDBIG((final_time - susp->delaysnd->t0) * susp->delaysnd->sr - (susp->delaysnd->current - susp->delaysnd_cnt)); susp->delaysnd_ptr += n; susp_took(delaysnd_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/alpassvv.c b/lib-src/libnyquist/nyquist/tran/alpassvv.c index 00681998b..5347ccf92 100644 --- a/lib-src/libnyquist/nyquist/tran/alpassvv.c +++ b/lib-src/libnyquist/nyquist/tran/alpassvv.c @@ -1777,28 +1777,28 @@ void alpassvv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* fetch samples from delaysnd up to final_time for this block of zeros */ - while ((round((final_time - susp->delaysnd->t0) * susp->delaysnd->sr)) >= + while ((ROUNDBIG((final_time - susp->delaysnd->t0) * susp->delaysnd->sr)) >= susp->delaysnd->current) susp_get_samples(delaysnd, delaysnd_ptr, delaysnd_cnt); /* fetch samples from feedback up to final_time for this block of zeros */ - while ((round((final_time - susp->feedback->t0) * susp->feedback->sr)) >= + while ((ROUNDBIG((final_time - susp->feedback->t0) * susp->feedback->sr)) >= susp->feedback->current) susp_get_samples(feedback, feedback_ptr, feedback_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); - n = round((final_time - susp->delaysnd->t0) * susp->delaysnd->sr - + n = ROUNDBIG((final_time - susp->delaysnd->t0) * susp->delaysnd->sr - (susp->delaysnd->current - susp->delaysnd_cnt)); susp->delaysnd_ptr += n; susp_took(delaysnd_cnt, n); - n = round((final_time - susp->feedback->t0) * susp->feedback->sr - + n = ROUNDBIG((final_time - susp->feedback->t0) * susp->feedback->sr - (susp->feedback->current - susp->feedback_cnt)); susp->feedback_ptr += n; susp_took(feedback_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/amosc.c b/lib-src/libnyquist/nyquist/tran/amosc.c index 714b5941c..7a6054a88 100644 --- a/lib-src/libnyquist/nyquist/tran/amosc.c +++ b/lib-src/libnyquist/nyquist/tran/amosc.c @@ -405,12 +405,12 @@ void amosc_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from amod up to final_time for this block of zeros */ - while ((round((final_time - susp->amod->t0) * susp->amod->sr)) >= + while ((ROUNDBIG((final_time - susp->amod->t0) * susp->amod->sr)) >= susp->amod->current) susp_get_samples(amod, amod_ptr, amod_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->amod->t0) * susp->amod->sr - + n = ROUNDBIG((final_time - susp->amod->t0) * susp->amod->sr - (susp->amod->current - susp->amod_cnt)); susp->amod_ptr += n; susp_took(amod_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/areson.c b/lib-src/libnyquist/nyquist/tran/areson.c index f39c65f62..ae87a3d07 100644 --- a/lib-src/libnyquist/nyquist/tran/areson.c +++ b/lib-src/libnyquist/nyquist/tran/areson.c @@ -138,12 +138,12 @@ void areson_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/aresoncv.c b/lib-src/libnyquist/nyquist/tran/aresoncv.c index ed6c0284a..041796733 100644 --- a/lib-src/libnyquist/nyquist/tran/aresoncv.c +++ b/lib-src/libnyquist/nyquist/tran/aresoncv.c @@ -476,20 +476,20 @@ void aresoncv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from bw up to final_time for this block of zeros */ - while ((round((final_time - susp->bw->t0) * susp->bw->sr)) >= + while ((ROUNDBIG((final_time - susp->bw->t0) * susp->bw->sr)) >= susp->bw->current) susp_get_samples(bw, bw_ptr, bw_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->bw->t0) * susp->bw->sr - + n = ROUNDBIG((final_time - susp->bw->t0) * susp->bw->sr - (susp->bw->current - susp->bw_cnt)); susp->bw_ptr += n; susp_took(bw_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/aresonvc.c b/lib-src/libnyquist/nyquist/tran/aresonvc.c index 966d4780b..7f279c997 100644 --- a/lib-src/libnyquist/nyquist/tran/aresonvc.c +++ b/lib-src/libnyquist/nyquist/tran/aresonvc.c @@ -462,20 +462,20 @@ void aresonvc_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from hz up to final_time for this block of zeros */ - while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >= + while ((ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr)) >= susp->hz->current) susp_get_samples(hz, hz_ptr, hz_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->hz->t0) * susp->hz->sr - + n = ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr - (susp->hz->current - susp->hz_cnt)); susp->hz_ptr += n; susp_took(hz_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/aresonvv.c b/lib-src/libnyquist/nyquist/tran/aresonvv.c index a6cfb2e26..aeec995c2 100644 --- a/lib-src/libnyquist/nyquist/tran/aresonvv.c +++ b/lib-src/libnyquist/nyquist/tran/aresonvv.c @@ -1611,28 +1611,28 @@ void aresonvv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from hz1 up to final_time for this block of zeros */ - while ((round((final_time - susp->hz1->t0) * susp->hz1->sr)) >= + while ((ROUNDBIG((final_time - susp->hz1->t0) * susp->hz1->sr)) >= susp->hz1->current) susp_get_samples(hz1, hz1_ptr, hz1_cnt); /* fetch samples from bw up to final_time for this block of zeros */ - while ((round((final_time - susp->bw->t0) * susp->bw->sr)) >= + while ((ROUNDBIG((final_time - susp->bw->t0) * susp->bw->sr)) >= susp->bw->current) susp_get_samples(bw, bw_ptr, bw_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->hz1->t0) * susp->hz1->sr - + n = ROUNDBIG((final_time - susp->hz1->t0) * susp->hz1->sr - (susp->hz1->current - susp->hz1_cnt)); susp->hz1_ptr += n; susp_took(hz1_cnt, n); - n = round((final_time - susp->bw->t0) * susp->bw->sr - + n = ROUNDBIG((final_time - susp->bw->t0) * susp->bw->sr - (susp->bw->current - susp->bw_cnt)); susp->bw_ptr += n; susp_took(bw_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/atone.c b/lib-src/libnyquist/nyquist/tran/atone.c index 01ff97dc6..6b9082fd3 100644 --- a/lib-src/libnyquist/nyquist/tran/atone.c +++ b/lib-src/libnyquist/nyquist/tran/atone.c @@ -233,12 +233,12 @@ void atone_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s up to final_time for this block of zeros */ - while ((round((final_time - susp->s->t0) * susp->s->sr)) >= + while ((ROUNDBIG((final_time - susp->s->t0) * susp->s->sr)) >= susp->s->current) susp_get_samples(s, s_ptr, s_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s->t0) * susp->s->sr - + n = ROUNDBIG((final_time - susp->s->t0) * susp->s->sr - (susp->s->current - susp->s_cnt)); susp->s_ptr += n; susp_took(s_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/atonev.c b/lib-src/libnyquist/nyquist/tran/atonev.c index 8324a1900..355941d3a 100644 --- a/lib-src/libnyquist/nyquist/tran/atonev.c +++ b/lib-src/libnyquist/nyquist/tran/atonev.c @@ -409,20 +409,20 @@ void atonev_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from hz up to final_time for this block of zeros */ - while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >= + while ((ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr)) >= susp->hz->current) susp_get_samples(hz, hz_ptr, hz_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->hz->t0) * susp->hz->sr - + n = ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr - (susp->hz->current - susp->hz_cnt)); susp->hz_ptr += n; susp_took(hz_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/biquadfilt.c b/lib-src/libnyquist/nyquist/tran/biquadfilt.c index 5656f6ec5..a0d1ea517 100644 --- a/lib-src/libnyquist/nyquist/tran/biquadfilt.c +++ b/lib-src/libnyquist/nyquist/tran/biquadfilt.c @@ -144,12 +144,12 @@ void biquadfilt_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s up to final_time for this block of zeros */ - while ((round((final_time - susp->s->t0) * susp->s->sr)) >= + while ((ROUNDBIG((final_time - susp->s->t0) * susp->s->sr)) >= susp->s->current) susp_get_samples(s, s_ptr, s_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s->t0) * susp->s->sr - + n = ROUNDBIG((final_time - susp->s->t0) * susp->s->sr - (susp->s->current - susp->s_cnt)); susp->s_ptr += n; susp_took(s_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/buzz.c b/lib-src/libnyquist/nyquist/tran/buzz.c index 3273305f3..c70cd8a68 100644 --- a/lib-src/libnyquist/nyquist/tran/buzz.c +++ b/lib-src/libnyquist/nyquist/tran/buzz.c @@ -438,12 +438,12 @@ void buzz_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s_fm up to final_time for this block of zeros */ - while ((round((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >= + while ((ROUNDBIG((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >= susp->s_fm->current) susp_get_samples(s_fm, s_fm_ptr, s_fm_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s_fm->t0) * susp->s_fm->sr - + n = ROUNDBIG((final_time - susp->s_fm->t0) * susp->s_fm->sr - (susp->s_fm->current - susp->s_fm_cnt)); susp->s_fm_ptr += n; susp_took(s_fm_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/chase.c b/lib-src/libnyquist/nyquist/tran/chase.c index 53996bf4a..939be20a3 100644 --- a/lib-src/libnyquist/nyquist/tran/chase.c +++ b/lib-src/libnyquist/nyquist/tran/chase.c @@ -246,12 +246,12 @@ void chase_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/clip.c b/lib-src/libnyquist/nyquist/tran/clip.c index 1d5067b79..79bd4ad45 100644 --- a/lib-src/libnyquist/nyquist/tran/clip.c +++ b/lib-src/libnyquist/nyquist/tran/clip.c @@ -222,12 +222,12 @@ void clip_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s up to final_time for this block of zeros */ - while ((round((final_time - susp->s->t0) * susp->s->sr)) >= + while ((ROUNDBIG((final_time - susp->s->t0) * susp->s->sr)) >= susp->s->current) susp_get_samples(s, s_ptr, s_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s->t0) * susp->s->sr - + n = ROUNDBIG((final_time - susp->s->t0) * susp->s->sr - (susp->s->current - susp->s_cnt)); susp->s_ptr += n; susp_took(s_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/congen.c b/lib-src/libnyquist/nyquist/tran/congen.c index cdd22b7c5..021726176 100644 --- a/lib-src/libnyquist/nyquist/tran/congen.c +++ b/lib-src/libnyquist/nyquist/tran/congen.c @@ -173,12 +173,12 @@ void congen_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from sndin up to final_time for this block of zeros */ - while ((round((final_time - susp->sndin->t0) * susp->sndin->sr)) >= + while ((ROUNDBIG((final_time - susp->sndin->t0) * susp->sndin->sr)) >= susp->sndin->current) susp_get_samples(sndin, sndin_ptr, sndin_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->sndin->t0) * susp->sndin->sr - + n = ROUNDBIG((final_time - susp->sndin->t0) * susp->sndin->sr - (susp->sndin->current - susp->sndin_cnt)); susp->sndin_ptr += n; susp_took(sndin_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/const.c b/lib-src/libnyquist/nyquist/tran/const.c index c85a2793e..254ec9708 100644 --- a/lib-src/libnyquist/nyquist/tran/const.c +++ b/lib-src/libnyquist/nyquist/tran/const.c @@ -92,7 +92,7 @@ sound_type snd_make_const(double c, time_type t0, rate_type sr, time_type d) susp->c = (sample_type) c; susp->susp.fetch = const__fetch; - susp->terminate_cnt = check_terminate_cnt(round((d) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((d) * sr)); /* initialize susp state */ susp->susp.free = const_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/coterm.c b/lib-src/libnyquist/nyquist/tran/coterm.c index d70b1b49c..5609ebcc8 100644 --- a/lib-src/libnyquist/nyquist/tran/coterm.c +++ b/lib-src/libnyquist/nyquist/tran/coterm.c @@ -380,20 +380,20 @@ void coterm_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from s2 up to final_time for this block of zeros */ - while ((round((final_time - susp->s2->t0) * susp->s2->sr)) >= + while ((ROUNDBIG((final_time - susp->s2->t0) * susp->s2->sr)) >= susp->s2->current) susp_get_samples(s2, s2_ptr, s2_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->s2->t0) * susp->s2->sr - + n = ROUNDBIG((final_time - susp->s2->t0) * susp->s2->sr - (susp->s2->current - susp->s2_cnt)); susp->s2_ptr += n; susp_took(s2_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/delaycc.alg b/lib-src/libnyquist/nyquist/tran/delaycc.alg index 3898bb808..6e61a4ddd 100644 --- a/lib-src/libnyquist/nyquist/tran/delaycc.alg +++ b/lib-src/libnyquist/nyquist/tran/delaycc.alg @@ -3,7 +3,7 @@ (ARGUMENTS ("sound_type" "input") ("time_type" "delay") ("double" "feedback")) (START (MIN input)) (STATE ("double" "feedback" "feedback") - ("long" "delaylen" "max(1, round(input->sr * delay))") + ("long" "delaylen" "max(1, ROUND32(input->sr * delay))") ("sample_type *" "delaybuf" "(sample_type *) calloc (susp->delaylen, sizeof(sample_type))") ("sample_type *" "delayptr" "susp->delaybuf") diff --git a/lib-src/libnyquist/nyquist/tran/delaycc.c b/lib-src/libnyquist/nyquist/tran/delaycc.c index b507b7d5f..8c2e0da01 100644 --- a/lib-src/libnyquist/nyquist/tran/delaycc.c +++ b/lib-src/libnyquist/nyquist/tran/delaycc.c @@ -100,12 +100,12 @@ void delay_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); @@ -155,7 +155,7 @@ sound_type snd_make_delay(sound_type input, time_type delay, double feedback) falloc_generic(susp, delay_susp_node, "snd_make_delay"); susp->feedback = feedback; - susp->delaylen = max(1, round(input->sr * delay)); + susp->delaylen = max(1, ROUND32(input->sr * delay)); susp->delaybuf = (sample_type *) calloc (susp->delaylen, sizeof(sample_type)); susp->delayptr = susp->delaybuf; susp->endptr = susp->delaybuf + susp->delaylen; diff --git a/lib-src/libnyquist/nyquist/tran/delaycv.alg b/lib-src/libnyquist/nyquist/tran/delaycv.alg index 01cc1bc28..4dfe88a6f 100644 --- a/lib-src/libnyquist/nyquist/tran/delaycv.alg +++ b/lib-src/libnyquist/nyquist/tran/delaycv.alg @@ -2,7 +2,7 @@ (NAME "delaycv") (ARGUMENTS ("sound_type" "s") ("time_type" "delay") ("sound_type" "feedback")) (START (MAX s feedback)) -(STATE ("long" "delaylen" "round(s->sr * delay)") +(STATE ("long" "delaylen" "ROUND32(s->sr * delay)") ("sample_type *" "delaybuf" "(sample_type *) calloc (sizeof(double), susp->delaylen)") ("sample_type *" "delayptr" "susp->delaybuf") diff --git a/lib-src/libnyquist/nyquist/tran/delaycv.c b/lib-src/libnyquist/nyquist/tran/delaycv.c index f4aa3d55c..0d6987506 100644 --- a/lib-src/libnyquist/nyquist/tran/delaycv.c +++ b/lib-src/libnyquist/nyquist/tran/delaycv.c @@ -782,20 +782,20 @@ void delaycv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s up to final_time for this block of zeros */ - while ((round((final_time - susp->s->t0) * susp->s->sr)) >= + while ((ROUNDBIG((final_time - susp->s->t0) * susp->s->sr)) >= susp->s->current) susp_get_samples(s, s_ptr, s_cnt); /* fetch samples from feedback up to final_time for this block of zeros */ - while ((round((final_time - susp->feedback->t0) * susp->feedback->sr)) >= + while ((ROUNDBIG((final_time - susp->feedback->t0) * susp->feedback->sr)) >= susp->feedback->current) susp_get_samples(feedback, feedback_ptr, feedback_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s->t0) * susp->s->sr - + n = ROUNDBIG((final_time - susp->s->t0) * susp->s->sr - (susp->s->current - susp->s_cnt)); susp->s_ptr += n; susp_took(s_cnt, n); - n = round((final_time - susp->feedback->t0) * susp->feedback->sr - + n = ROUNDBIG((final_time - susp->feedback->t0) * susp->feedback->sr - (susp->feedback->current - susp->feedback_cnt)); susp->feedback_ptr += n; susp_took(feedback_cnt, n); @@ -851,7 +851,7 @@ sound_type snd_make_delaycv(sound_type s, time_type delay, sound_type feedback) if (s->sr < sr) { s->scale = scale_factor; scale_factor = 1.0F; } falloc_generic(susp, delaycv_susp_node, "snd_make_delaycv"); - susp->delaylen = round(s->sr * delay); + susp->delaylen = ROUND32(s->sr * delay); susp->delaybuf = (sample_type *) calloc (sizeof(double), susp->delaylen); susp->delayptr = susp->delaybuf; susp->endptr = susp->delaybuf + susp->delaylen; diff --git a/lib-src/libnyquist/nyquist/tran/eqbandvvv.c b/lib-src/libnyquist/nyquist/tran/eqbandvvv.c index eadd76037..5a37ebd89 100644 --- a/lib-src/libnyquist/nyquist/tran/eqbandvvv.c +++ b/lib-src/libnyquist/nyquist/tran/eqbandvvv.c @@ -671,36 +671,36 @@ void eqbandvvv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* fetch samples from hz up to final_time for this block of zeros */ - while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >= + while ((ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr)) >= susp->hz->current) susp_get_samples(hz, hz_ptr, hz_cnt); /* fetch samples from gain up to final_time for this block of zeros */ - while ((round((final_time - susp->gain->t0) * susp->gain->sr)) >= + while ((ROUNDBIG((final_time - susp->gain->t0) * susp->gain->sr)) >= susp->gain->current) susp_get_samples(gain, gain_ptr, gain_cnt); /* fetch samples from width up to final_time for this block of zeros */ - while ((round((final_time - susp->width->t0) * susp->width->sr)) >= + while ((ROUNDBIG((final_time - susp->width->t0) * susp->width->sr)) >= susp->width->current) susp_get_samples(width, width_ptr, width_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); - n = round((final_time - susp->hz->t0) * susp->hz->sr - + n = ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr - (susp->hz->current - susp->hz_cnt)); susp->hz_ptr += n; susp_took(hz_cnt, n); - n = round((final_time - susp->gain->t0) * susp->gain->sr - + n = ROUNDBIG((final_time - susp->gain->t0) * susp->gain->sr - (susp->gain->current - susp->gain_cnt)); susp->gain_ptr += n; susp_took(gain_cnt, n); - n = round((final_time - susp->width->t0) * susp->width->sr - + n = ROUNDBIG((final_time - susp->width->t0) * susp->width->sr - (susp->width->current - susp->width_cnt)); susp->width_ptr += n; susp_took(width_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/exp.c b/lib-src/libnyquist/nyquist/tran/exp.c index 2e9771214..9cc35cac0 100644 --- a/lib-src/libnyquist/nyquist/tran/exp.c +++ b/lib-src/libnyquist/nyquist/tran/exp.c @@ -119,12 +119,12 @@ void exp_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from in up to final_time for this block of zeros */ - while ((round((final_time - susp->in->t0) * susp->in->sr)) >= + while ((ROUNDBIG((final_time - susp->in->t0) * susp->in->sr)) >= susp->in->current) susp_get_samples(in, in_ptr, in_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->in->t0) * susp->in->sr - + n = ROUNDBIG((final_time - susp->in->t0) * susp->in->sr - (susp->in->current - susp->in_cnt)); susp->in_ptr += n; susp_took(in_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/fmfb.c b/lib-src/libnyquist/nyquist/tran/fmfb.c index c081d8170..fb5c37b55 100644 --- a/lib-src/libnyquist/nyquist/tran/fmfb.c +++ b/lib-src/libnyquist/nyquist/tran/fmfb.c @@ -122,7 +122,7 @@ sound_type snd_make_fmfb(time_type t0, double hz, rate_type sr, double index, ti susp->index = index * SINE_TABLE_LEN / PI2; susp->susp.fetch = fmfb__fetch; - susp->terminate_cnt = check_terminate_cnt(round((d) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((d) * sr)); /* initialize susp state */ susp->susp.free = fmfb_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/fmfbv.c b/lib-src/libnyquist/nyquist/tran/fmfbv.c index 4d486649d..1384243b2 100644 --- a/lib-src/libnyquist/nyquist/tran/fmfbv.c +++ b/lib-src/libnyquist/nyquist/tran/fmfbv.c @@ -515,12 +515,12 @@ void fmfbv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from index up to final_time for this block of zeros */ - while ((round((final_time - susp->index->t0) * susp->index->sr)) >= + while ((ROUNDBIG((final_time - susp->index->t0) * susp->index->sr)) >= susp->index->current) susp_get_samples(index, index_ptr, index_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->index->t0) * susp->index->sr - + n = ROUNDBIG((final_time - susp->index->t0) * susp->index->sr - (susp->index->current - susp->index_cnt)); susp->index_ptr += n; susp_took(index_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/fmosc.alg b/lib-src/libnyquist/nyquist/tran/fmosc.alg index b002d04ee..f7bbcf4b4 100644 --- a/lib-src/libnyquist/nyquist/tran/fmosc.alg +++ b/lib-src/libnyquist/nyquist/tran/fmosc.alg @@ -11,8 +11,8 @@ ("sample_type *" "table_ptr" "susp->the_table->samples") ("double" "phase" "compute_phase(phase, step, (long) susp->table_len, s->sr, sr, hz, &susp->ph_incr); - s_fm->scale *= hz != 0 ? (sample_type) (susp->ph_incr / hz) - : s->sr / (sr * step_to_hz(step))") ) ; cancel 0/0 + s_fm->scale *= (sample_type) (hz != 0 ? (susp->ph_incr / hz) + : s->sr / (sr * step_to_hz(step)))") ) ; cancel 0/0 (ALWAYS-SCALE s_fm) (STEP-FUNCTION s_fm) diff --git a/lib-src/libnyquist/nyquist/tran/fmosc.c b/lib-src/libnyquist/nyquist/tran/fmosc.c index ad71edbdf..eca494220 100644 --- a/lib-src/libnyquist/nyquist/tran/fmosc.c +++ b/lib-src/libnyquist/nyquist/tran/fmosc.c @@ -397,12 +397,12 @@ void fmosc_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s_fm up to final_time for this block of zeros */ - while ((round((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >= + while ((ROUNDBIG((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >= susp->s_fm->current) susp_get_samples(s_fm, s_fm_ptr, s_fm_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s_fm->t0) * susp->s_fm->sr - + n = ROUNDBIG((final_time - susp->s_fm->t0) * susp->s_fm->sr - (susp->s_fm->current - susp->s_fm_cnt)); susp->s_fm_ptr += n; susp_took(s_fm_cnt, n); @@ -451,8 +451,8 @@ sound_type snd_make_fmosc(sound_type s, double step, rate_type sr, double hz, ti susp->table_ptr = susp->the_table->samples; susp->phase = compute_phase(phase, step, (long) susp->table_len, s->sr, sr, hz, &susp->ph_incr); - s_fm->scale *= hz != 0 ? (sample_type) (susp->ph_incr / hz) - : s->sr / (sr * step_to_hz(step)); + s_fm->scale *= (sample_type) (hz != 0 ? (susp->ph_incr / hz) + : s->sr / (sr * step_to_hz(step))); /* make sure no sample rate is too high */ if (s_fm->sr > sr) { diff --git a/lib-src/libnyquist/nyquist/tran/follow.c b/lib-src/libnyquist/nyquist/tran/follow.c index a17f357b8..e41418cc7 100644 --- a/lib-src/libnyquist/nyquist/tran/follow.c +++ b/lib-src/libnyquist/nyquist/tran/follow.c @@ -197,12 +197,12 @@ void follow_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from sndin up to final_time for this block of zeros */ - while ((round((final_time - susp->sndin->t0) * susp->sndin->sr)) >= + while ((ROUNDBIG((final_time - susp->sndin->t0) * susp->sndin->sr)) >= susp->sndin->current) susp_get_samples(sndin, sndin_ptr, sndin_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->sndin->t0) * susp->sndin->sr - + n = ROUNDBIG((final_time - susp->sndin->t0) * susp->sndin->sr - (susp->sndin->current - susp->sndin_cnt)); susp->sndin_ptr += n; susp_took(sndin_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/gate.alg b/lib-src/libnyquist/nyquist/tran/gate.alg index e430139c9..576ef5510 100644 --- a/lib-src/libnyquist/nyquist/tran/gate.alg +++ b/lib-src/libnyquist/nyquist/tran/gate.alg @@ -86,7 +86,7 @@ void compute_start_rise(gate_susp_type susp) ("long" "start_fall" "0") ("long" "start_rise" "0") ("long" "stop_count" "0") - ("long" "delay_len" "max(1, round(signal->sr * lookahead))") + ("long" "delay_len" "max(1, ROUND32(signal->sr * lookahead))") ("int" "state" "ST_OFF") ("double" "value" "susp->floor")) diff --git a/lib-src/libnyquist/nyquist/tran/gate.c b/lib-src/libnyquist/nyquist/tran/gate.c index 8172e1d9d..8ae4c498f 100644 --- a/lib-src/libnyquist/nyquist/tran/gate.c +++ b/lib-src/libnyquist/nyquist/tran/gate.c @@ -256,12 +256,12 @@ void gate_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from signal up to final_time for this block of zeros */ - while ((round((final_time - susp->signal->t0) * susp->signal->sr)) >= + while ((ROUNDBIG((final_time - susp->signal->t0) * susp->signal->sr)) >= susp->signal->current) susp_get_samples(signal, signal_ptr, signal_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->signal->t0) * susp->signal->sr - + n = ROUNDBIG((final_time - susp->signal->t0) * susp->signal->sr - (susp->signal->current - susp->signal_cnt)); susp->signal_ptr += n; susp_took(signal_cnt, n); @@ -320,7 +320,7 @@ sound_type snd_make_gate(sound_type signal, time_type lookahead, double risetime susp->start_fall = 0; susp->start_rise = 0; susp->stop_count = 0; - susp->delay_len = max(1, round(signal->sr * lookahead)); + susp->delay_len = max(1, ROUND32(signal->sr * lookahead)); susp->state = ST_OFF; susp->value = susp->floor; susp->susp.fetch = gate_n_fetch; diff --git a/lib-src/libnyquist/nyquist/tran/ifft.alg b/lib-src/libnyquist/nyquist/tran/ifft.alg index a5846413f..36621a25f 100644 --- a/lib-src/libnyquist/nyquist/tran/ifft.alg +++ b/lib-src/libnyquist/nyquist/tran/ifft.alg @@ -40,9 +40,10 @@ #include \"samples.h\" #include \"fftext.h\" +#include \"fft.h\" #define MUST_BE_FLONUM(e) \\ - if (!(e) || ntype(e) != FLONUM) { xlerror(\"flonum expected\", (e)); } + if (!(e) || ntype(e) != FLONUM) { xlerror(\"in IFFT: flonum expected\", (e)); } table_type get_window_samples(LVAL window, sample_type **samples, long *len) { @@ -89,7 +90,7 @@ out: togo = 0; /* indicate termination */ susp->src = NULL; goto out; } else if (!vectorp(susp->array)) { - xlerror(\"array expected\", susp->array); + xlerror(\"in IFFT: array expected\", susp->array); } else if (susp->samples == NULL) { /* assume arrays are all the same size as first one; now that we know the size, we just have to do this @@ -97,9 +98,9 @@ out: togo = 0; /* indicate termination */ */ susp->length = getsize(susp->array); if (susp->length < 1) - xlerror(\"array has no elements\", susp->array); + xlerror(\"in IFFT: array has no elements\", susp->array); if (susp->window && (susp->window_len != susp->length)) - xlerror(\"window size and spectrum size differ\", + xlerror(\"in IFFT: window size and spectrum size differ\", susp->array); /* tricky non-power of 2 detector: only if this is a * power of 2 will the highest 1 bit be cleared when @@ -107,12 +108,17 @@ out: togo = 0; /* indicate termination */ */ if (susp->length & (susp->length - 1)) xlfail(\"spectrum size must be a power of 2\"); + if (susp->stepsize < 1) + xlfail(\"in IFFT: step size must be greater than zero\"); + if (susp->length < susp->stepsize) + xlerror(\"in IFFT: step size must be smaller than spectrum size\", + susp->array); susp->samples = (sample_type *) calloc(susp->length, sizeof(sample_type)); susp->outbuf = (sample_type *) calloc(susp->length, sizeof(sample_type)); } else if (getsize(susp->array) != susp->length) { - xlerror(\"arrays must all be the same length\", susp->array); + xlerror(\"in IFFT: arrays must all be the same length\", susp->array); } /* at this point, we have a new array to put samples */ @@ -141,9 +147,10 @@ out: togo = 0; /* indicate termination */ /* here is where the IFFT and windowing should take place */ //fftnf(1, &n, susp->samples, susp->samples + n, -1, 1.0); - m = round(log2(n)); + m = ROUND32(log2(n)); if (!fftInit(m)) riffts(susp->samples, m, 1); else xlfail(\"FFT initialization error\"); + fft_shift(susp->samples, n); if (susp->window) { n = susp->length; for (i = 0; i < n; i++) { diff --git a/lib-src/libnyquist/nyquist/tran/ifft.c b/lib-src/libnyquist/nyquist/tran/ifft.c index 5c6c922b6..4c2aa7180 100644 --- a/lib-src/libnyquist/nyquist/tran/ifft.c +++ b/lib-src/libnyquist/nyquist/tran/ifft.c @@ -64,6 +64,7 @@ typedef struct ifft_susp_struct { #include "samples.h" #include "fftext.h" +#include "fft.h" #define MUST_BE_FLONUM(e) \ if (!(e) || ntype(e) != FLONUM) { xlerror("flonum expected", (e)); } @@ -173,9 +174,10 @@ out: togo = 0; /* indicate termination */ /* here is where the IFFT and windowing should take place */ //fftnf(1, &n, susp->samples, susp->samples + n, -1, 1.0); - m = round(log2(n)); + m = ROUND32(log2(n)); if (!fftInit(m)) riffts(susp->samples, m, 1); else xlfail("FFT initialization error"); + fft_shift(susp->samples, n); if (susp->window) { n = susp->length; for (i = 0; i < n; i++) { diff --git a/lib-src/libnyquist/nyquist/tran/instrbanded.alg b/lib-src/libnyquist/nyquist/tran/instrbanded.alg index f099644cd..fc3f4145c 100644 --- a/lib-src/libnyquist/nyquist/tran/instrbanded.alg +++ b/lib-src/libnyquist/nyquist/tran/instrbanded.alg @@ -2,7 +2,7 @@ (NAME "bandedwg") (ARGUMENTS ("double" "freq") ("sound_type" "bowpress_env") ("int" "preset") ("rate_type" "sr")) -(STATE ("struct instr *" "mybanded" "initInstrument(BANDEDWG, round(sr)); +(STATE ("struct instr *" "mybanded" "initInstrument(BANDEDWG, ROUND32(sr)); controlChange(susp->mybanded, 16, preset);") ("int" "temp_ret_value" "noteOn(susp->mybanded, freq, 1.0)") ("float" "bowpress_scale" diff --git a/lib-src/libnyquist/nyquist/tran/instrbanded.c b/lib-src/libnyquist/nyquist/tran/instrbanded.c index eeaaedb07..bf8af0e85 100644 --- a/lib-src/libnyquist/nyquist/tran/instrbanded.c +++ b/lib-src/libnyquist/nyquist/tran/instrbanded.c @@ -98,12 +98,12 @@ void bandedwg_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from bowpress_env up to final_time for this block of zeros */ - while ((round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >= + while ((ROUNDBIG((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >= susp->bowpress_env->current) susp_get_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr - + n = ROUNDBIG((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr - (susp->bowpress_env->current - susp->bowpress_env_cnt)); susp->bowpress_env_ptr += n; susp_took(bowpress_env_cnt, n); @@ -145,7 +145,7 @@ sound_type snd_make_bandedwg(double freq, sound_type bowpress_env, int preset, r sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, bandedwg_susp_node, "snd_make_bandedwg"); - susp->mybanded = initInstrument(BANDEDWG, round(sr)); + susp->mybanded = initInstrument(BANDEDWG, ROUND32(sr)); controlChange(susp->mybanded, 16, preset);; susp->temp_ret_value = noteOn(susp->mybanded, freq, 1.0); susp->bowpress_scale = bowpress_env->scale * BANDEDWG_CONTROL_CHANGE_CONST; diff --git a/lib-src/libnyquist/nyquist/tran/instrbow.alg b/lib-src/libnyquist/nyquist/tran/instrbow.alg index 1ddf37bba..1d734afce 100644 --- a/lib-src/libnyquist/nyquist/tran/instrbow.alg +++ b/lib-src/libnyquist/nyquist/tran/instrbow.alg @@ -1,7 +1,7 @@ (INSTRBOW-ALG (NAME "bowed") (ARGUMENTS ("double" "freq") ("sound_type" "bowpress_env") ("rate_type" "sr")) -(STATE ("struct instr *" "mybow" "initInstrument(BOWED, round(sr)); +(STATE ("struct instr *" "mybow" "initInstrument(BOWED, ROUND32(sr)); controlChange(susp->mybow, 1, 0.0);") ("int" "temp_ret_value" "noteOn(susp->mybow, freq, 1.0)") ("float" "bow_scale" "bowpress_env->scale * BOW_CONTROL_CHANGE_CONST")) diff --git a/lib-src/libnyquist/nyquist/tran/instrbow.c b/lib-src/libnyquist/nyquist/tran/instrbow.c index 7672d21bf..dd7b50269 100644 --- a/lib-src/libnyquist/nyquist/tran/instrbow.c +++ b/lib-src/libnyquist/nyquist/tran/instrbow.c @@ -98,12 +98,12 @@ void bowed_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from bowpress_env up to final_time for this block of zeros */ - while ((round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >= + while ((ROUNDBIG((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >= susp->bowpress_env->current) susp_get_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr - + n = ROUNDBIG((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr - (susp->bowpress_env->current - susp->bowpress_env_cnt)); susp->bowpress_env_ptr += n; susp_took(bowpress_env_cnt, n); @@ -145,7 +145,7 @@ sound_type snd_make_bowed(double freq, sound_type bowpress_env, rate_type sr) sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, bowed_susp_node, "snd_make_bowed"); - susp->mybow = initInstrument(BOWED, round(sr)); + susp->mybow = initInstrument(BOWED, ROUND32(sr)); controlChange(susp->mybow, 1, 0.0);; susp->temp_ret_value = noteOn(susp->mybow, freq, 1.0); susp->bow_scale = bowpress_env->scale * BOW_CONTROL_CHANGE_CONST; diff --git a/lib-src/libnyquist/nyquist/tran/instrbowedfreq.alg b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.alg index 57ad0299d..7d624ea7e 100644 --- a/lib-src/libnyquist/nyquist/tran/instrbowedfreq.alg +++ b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.alg @@ -2,7 +2,7 @@ (NAME "bowed_freq") (ARGUMENTS ("double" "freq") ("sound_type" "bowpress_env") ("sound_type" "freq_env") ("rate_type" "sr")) -(STATE ("struct instr *" "mybow" "initInstrument(BOWED, round(sr)); +(STATE ("struct instr *" "mybow" "initInstrument(BOWED, ROUND32(sr)); controlChange(susp->mybow, 1, 0.0);") ("int" "temp_ret_value" "noteOn(susp->mybow, freq, 1.0)") ("float" "bow_scale" "bowpress_env->scale * BOW_CONTROL_CHANGE_CONST") diff --git a/lib-src/libnyquist/nyquist/tran/instrbowedfreq.c b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.c index 178184f07..3580f7bb9 100644 --- a/lib-src/libnyquist/nyquist/tran/instrbowedfreq.c +++ b/lib-src/libnyquist/nyquist/tran/instrbowedfreq.c @@ -115,20 +115,20 @@ void bowed_freq_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from bowpress_env up to final_time for this block of zeros */ - while ((round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >= + while ((ROUNDBIG((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr)) >= susp->bowpress_env->current) susp_get_samples(bowpress_env, bowpress_env_ptr, bowpress_env_cnt); /* fetch samples from freq_env up to final_time for this block of zeros */ - while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= + while ((ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= susp->freq_env->current) susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr - + n = ROUNDBIG((final_time - susp->bowpress_env->t0) * susp->bowpress_env->sr - (susp->bowpress_env->current - susp->bowpress_env_cnt)); susp->bowpress_env_ptr += n; susp_took(bowpress_env_cnt, n); - n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr - + n = ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr - (susp->freq_env->current - susp->freq_env_cnt)); susp->freq_env_ptr += n; susp_took(freq_env_cnt, n); @@ -176,7 +176,7 @@ sound_type snd_make_bowed_freq(double freq, sound_type bowpress_env, sound_type sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, bowed_freq_susp_node, "snd_make_bowed_freq"); - susp->mybow = initInstrument(BOWED, round(sr)); + susp->mybow = initInstrument(BOWED, ROUND32(sr)); controlChange(susp->mybow, 1, 0.0);; susp->temp_ret_value = noteOn(susp->mybow, freq, 1.0); susp->bow_scale = bowpress_env->scale * BOW_CONTROL_CHANGE_CONST; diff --git a/lib-src/libnyquist/nyquist/tran/instrclar.alg b/lib-src/libnyquist/nyquist/tran/instrclar.alg index 60bee5705..17934b763 100644 --- a/lib-src/libnyquist/nyquist/tran/instrclar.alg +++ b/lib-src/libnyquist/nyquist/tran/instrclar.alg @@ -1,7 +1,7 @@ (INSTRCLAR-ALG (NAME "clarinet") (ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("rate_type" "sr")) -(STATE ("struct instr *" "clar" "initInstrument(CLARINET, round(sr)); +(STATE ("struct instr *" "clar" "initInstrument(CLARINET, ROUND32(sr)); controlChange(susp->clar, 1, 0.0);") ("int" "temp_ret_value" "noteOn(susp->clar, freq, 1.0)") ("float" "breath_scale" "breath_env->scale * CLAR_CONTROL_CHANGE_CONST")) diff --git a/lib-src/libnyquist/nyquist/tran/instrclar.c b/lib-src/libnyquist/nyquist/tran/instrclar.c index ac7e10620..67ca8e7ec 100644 --- a/lib-src/libnyquist/nyquist/tran/instrclar.c +++ b/lib-src/libnyquist/nyquist/tran/instrclar.c @@ -98,12 +98,12 @@ void clarinet_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); @@ -145,7 +145,7 @@ sound_type snd_make_clarinet(double freq, sound_type breath_env, rate_type sr) sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, clarinet_susp_node, "snd_make_clarinet"); - susp->clar = initInstrument(CLARINET, round(sr)); + susp->clar = initInstrument(CLARINET, ROUND32(sr)); controlChange(susp->clar, 1, 0.0);; susp->temp_ret_value = noteOn(susp->clar, freq, 1.0); susp->breath_scale = breath_env->scale * CLAR_CONTROL_CHANGE_CONST; diff --git a/lib-src/libnyquist/nyquist/tran/instrclarall.alg b/lib-src/libnyquist/nyquist/tran/instrclarall.alg index 8f89d38d5..a2f5798db 100644 --- a/lib-src/libnyquist/nyquist/tran/instrclarall.alg +++ b/lib-src/libnyquist/nyquist/tran/instrclarall.alg @@ -16,7 +16,7 @@ ("rate_type" "sr")) ;; use a constant rate of 1.0 because it will actually be conrolled ;; by breath_env -(STATE ("struct instr *" "clar" "initInstrument(CLARINET, round(sr)); +(STATE ("struct instr *" "clar" "initInstrument(CLARINET, ROUND32(sr)); noteOn(susp->clar, freq, 1.0); controlChange(susp->clar, 11, CLAR_CONTROL_CHANGE_CONST * vibrato_freq); controlChange(susp->clar, 1, CLAR_CONTROL_CHANGE_CONST * vibrato_gain);") diff --git a/lib-src/libnyquist/nyquist/tran/instrclarall.c b/lib-src/libnyquist/nyquist/tran/instrclarall.c index e929673f2..8c0c1f221 100644 --- a/lib-src/libnyquist/nyquist/tran/instrclarall.c +++ b/lib-src/libnyquist/nyquist/tran/instrclarall.c @@ -146,36 +146,36 @@ void clarinet_all_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* fetch samples from freq_env up to final_time for this block of zeros */ - while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= + while ((ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= susp->freq_env->current) susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt); /* fetch samples from reed_stiffness up to final_time for this block of zeros */ - while ((round((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr)) >= + while ((ROUNDBIG((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr)) >= susp->reed_stiffness->current) susp_get_samples(reed_stiffness, reed_stiffness_ptr, reed_stiffness_cnt); /* fetch samples from noise_env up to final_time for this block of zeros */ - while ((round((final_time - susp->noise_env->t0) * susp->noise_env->sr)) >= + while ((ROUNDBIG((final_time - susp->noise_env->t0) * susp->noise_env->sr)) >= susp->noise_env->current) susp_get_samples(noise_env, noise_env_ptr, noise_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); - n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr - + n = ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr - (susp->freq_env->current - susp->freq_env_cnt)); susp->freq_env_ptr += n; susp_took(freq_env_cnt, n); - n = round((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr - + n = ROUNDBIG((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr - (susp->reed_stiffness->current - susp->reed_stiffness_cnt)); susp->reed_stiffness_ptr += n; susp_took(reed_stiffness_cnt, n); - n = round((final_time - susp->noise_env->t0) * susp->noise_env->sr - + n = ROUNDBIG((final_time - susp->noise_env->t0) * susp->noise_env->sr - (susp->noise_env->current - susp->noise_env_cnt)); susp->noise_env_ptr += n; susp_took(noise_env_cnt, n); @@ -235,7 +235,7 @@ sound_type snd_make_clarinet_all(double freq, sound_type breath_env, sound_type sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, clarinet_all_susp_node, "snd_make_clarinet_all"); - susp->clar = initInstrument(CLARINET, round(sr)); + susp->clar = initInstrument(CLARINET, ROUND32(sr)); noteOn(susp->clar, freq, 1.0); controlChange(susp->clar, 11, CLAR_CONTROL_CHANGE_CONST * vibrato_freq); controlChange(susp->clar, 1, CLAR_CONTROL_CHANGE_CONST * vibrato_gain);; diff --git a/lib-src/libnyquist/nyquist/tran/instrclarfreq.alg b/lib-src/libnyquist/nyquist/tran/instrclarfreq.alg index 79218a458..06e786ed0 100644 --- a/lib-src/libnyquist/nyquist/tran/instrclarfreq.alg +++ b/lib-src/libnyquist/nyquist/tran/instrclarfreq.alg @@ -2,7 +2,7 @@ (NAME "clarinet_freq") (ARGUMENTS ("double" "freq1") ("sound_type" "breath_env") ("sound_type" "freq_env") ("rate_type" "sr")) -(STATE ("struct instr *" "clar" "initInstrument(CLARINET, round(sr)); +(STATE ("struct instr *" "clar" "initInstrument(CLARINET, ROUND32(sr)); controlChange(susp->clar, 1, 0.0);") ("int" "temp_ret_value" "noteOn(susp->clar, freq1, 1.0)") ("double" "frequency" "freq1") diff --git a/lib-src/libnyquist/nyquist/tran/instrclarfreq.c b/lib-src/libnyquist/nyquist/tran/instrclarfreq.c index 51bdaef5c..422b917a9 100644 --- a/lib-src/libnyquist/nyquist/tran/instrclarfreq.c +++ b/lib-src/libnyquist/nyquist/tran/instrclarfreq.c @@ -115,20 +115,20 @@ void clarinet_freq_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* fetch samples from freq_env up to final_time for this block of zeros */ - while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= + while ((ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= susp->freq_env->current) susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); - n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr - + n = ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr - (susp->freq_env->current - susp->freq_env_cnt)); susp->freq_env_ptr += n; susp_took(freq_env_cnt, n); @@ -176,7 +176,7 @@ sound_type snd_make_clarinet_freq(double freq1, sound_type breath_env, sound_typ sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, clarinet_freq_susp_node, "snd_make_clarinet_freq"); - susp->clar = initInstrument(CLARINET, round(sr)); + susp->clar = initInstrument(CLARINET, ROUND32(sr)); controlChange(susp->clar, 1, 0.0);; susp->temp_ret_value = noteOn(susp->clar, freq1, 1.0); susp->frequency = freq1; diff --git a/lib-src/libnyquist/nyquist/tran/instrflute.alg b/lib-src/libnyquist/nyquist/tran/instrflute.alg index 8433138cd..089fe0385 100644 --- a/lib-src/libnyquist/nyquist/tran/instrflute.alg +++ b/lib-src/libnyquist/nyquist/tran/instrflute.alg @@ -1,7 +1,7 @@ (INSTRFLUTE-ALG (NAME "flute") (ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("rate_type" "sr")) -(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, round(sr)); +(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, ROUND32(sr)); controlChange(susp->myflute, 1, 0.0);") ("int" "temp_ret_value" "noteOn(susp->myflute, freq, 1.0)") ("float" "breath_scale" diff --git a/lib-src/libnyquist/nyquist/tran/instrflute.c b/lib-src/libnyquist/nyquist/tran/instrflute.c index 84d21752f..5e0aa2405 100644 --- a/lib-src/libnyquist/nyquist/tran/instrflute.c +++ b/lib-src/libnyquist/nyquist/tran/instrflute.c @@ -98,12 +98,12 @@ void flute_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); @@ -145,7 +145,7 @@ sound_type snd_make_flute(double freq, sound_type breath_env, rate_type sr) sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, flute_susp_node, "snd_make_flute"); - susp->myflute = initInstrument(FLUTE, round(sr)); + susp->myflute = initInstrument(FLUTE, ROUND32(sr)); controlChange(susp->myflute, 1, 0.0);; susp->temp_ret_value = noteOn(susp->myflute, freq, 1.0); susp->breath_scale = breath_env->scale * FLUTE_CONTROL_CHANGE_CONST; diff --git a/lib-src/libnyquist/nyquist/tran/instrfluteall.alg b/lib-src/libnyquist/nyquist/tran/instrfluteall.alg index c44c7e11e..4319f2e40 100644 --- a/lib-src/libnyquist/nyquist/tran/instrfluteall.alg +++ b/lib-src/libnyquist/nyquist/tran/instrfluteall.alg @@ -15,7 +15,7 @@ ("sound_type" "jet_delay") ("sound_type" "noise_env") ("rate_type" "sr")) ;; use a constant rate of 1.0 because it will actually be conrolled ;; by breath_env -(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, round(sr)); +(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, ROUND32(sr)); noteOn(susp->myflute, freq, 1.0); controlChange(susp->myflute, 11, FLUTE_CONTROL_CHANGE_CONST * vibrato_freq); controlChange(susp->myflute, 1, FLUTE_CONTROL_CHANGE_CONST * vibrato_gain);") diff --git a/lib-src/libnyquist/nyquist/tran/instrfluteall.c b/lib-src/libnyquist/nyquist/tran/instrfluteall.c index 49e7c8837..346932144 100644 --- a/lib-src/libnyquist/nyquist/tran/instrfluteall.c +++ b/lib-src/libnyquist/nyquist/tran/instrfluteall.c @@ -146,36 +146,36 @@ void flute_all_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* fetch samples from freq_env up to final_time for this block of zeros */ - while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= + while ((ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= susp->freq_env->current) susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt); /* fetch samples from jet_delay up to final_time for this block of zeros */ - while ((round((final_time - susp->jet_delay->t0) * susp->jet_delay->sr)) >= + while ((ROUNDBIG((final_time - susp->jet_delay->t0) * susp->jet_delay->sr)) >= susp->jet_delay->current) susp_get_samples(jet_delay, jet_delay_ptr, jet_delay_cnt); /* fetch samples from noise_env up to final_time for this block of zeros */ - while ((round((final_time - susp->noise_env->t0) * susp->noise_env->sr)) >= + while ((ROUNDBIG((final_time - susp->noise_env->t0) * susp->noise_env->sr)) >= susp->noise_env->current) susp_get_samples(noise_env, noise_env_ptr, noise_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); - n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr - + n = ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr - (susp->freq_env->current - susp->freq_env_cnt)); susp->freq_env_ptr += n; susp_took(freq_env_cnt, n); - n = round((final_time - susp->jet_delay->t0) * susp->jet_delay->sr - + n = ROUNDBIG((final_time - susp->jet_delay->t0) * susp->jet_delay->sr - (susp->jet_delay->current - susp->jet_delay_cnt)); susp->jet_delay_ptr += n; susp_took(jet_delay_cnt, n); - n = round((final_time - susp->noise_env->t0) * susp->noise_env->sr - + n = ROUNDBIG((final_time - susp->noise_env->t0) * susp->noise_env->sr - (susp->noise_env->current - susp->noise_env_cnt)); susp->noise_env_ptr += n; susp_took(noise_env_cnt, n); @@ -235,7 +235,7 @@ sound_type snd_make_flute_all(double freq, sound_type breath_env, sound_type fre sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, flute_all_susp_node, "snd_make_flute_all"); - susp->myflute = initInstrument(FLUTE, round(sr)); + susp->myflute = initInstrument(FLUTE, ROUND32(sr)); noteOn(susp->myflute, freq, 1.0); controlChange(susp->myflute, 11, FLUTE_CONTROL_CHANGE_CONST * vibrato_freq); controlChange(susp->myflute, 1, FLUTE_CONTROL_CHANGE_CONST * vibrato_gain);; diff --git a/lib-src/libnyquist/nyquist/tran/instrflutefreq.alg b/lib-src/libnyquist/nyquist/tran/instrflutefreq.alg index ba3ed40ed..130f2469e 100644 --- a/lib-src/libnyquist/nyquist/tran/instrflutefreq.alg +++ b/lib-src/libnyquist/nyquist/tran/instrflutefreq.alg @@ -2,7 +2,7 @@ (NAME "flute_freq") (ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("sound_type" "freq_env") ("rate_type" "sr")) -(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, round(sr)); +(STATE ("struct instr *" "myflute" "initInstrument(FLUTE, ROUND32(sr)); controlChange(susp->myflute, 1, 0.0);") ("int" "temp_ret_value" "noteOn(susp->myflute, freq, 1.0)") ("float" "breath_scale" "breath_env->scale * FLUTE_CONTROL_CHANGE_CONST") diff --git a/lib-src/libnyquist/nyquist/tran/instrflutefreq.c b/lib-src/libnyquist/nyquist/tran/instrflutefreq.c index 2c203e16f..03c9d47de 100644 --- a/lib-src/libnyquist/nyquist/tran/instrflutefreq.c +++ b/lib-src/libnyquist/nyquist/tran/instrflutefreq.c @@ -115,20 +115,20 @@ void flute_freq_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* fetch samples from freq_env up to final_time for this block of zeros */ - while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= + while ((ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= susp->freq_env->current) susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); - n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr - + n = ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr - (susp->freq_env->current - susp->freq_env_cnt)); susp->freq_env_ptr += n; susp_took(freq_env_cnt, n); @@ -176,7 +176,7 @@ sound_type snd_make_flute_freq(double freq, sound_type breath_env, sound_type fr sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, flute_freq_susp_node, "snd_make_flute_freq"); - susp->myflute = initInstrument(FLUTE, round(sr)); + susp->myflute = initInstrument(FLUTE, ROUND32(sr)); controlChange(susp->myflute, 1, 0.0);; susp->temp_ret_value = noteOn(susp->myflute, freq, 1.0); susp->breath_scale = breath_env->scale * FLUTE_CONTROL_CHANGE_CONST; diff --git a/lib-src/libnyquist/nyquist/tran/instrmandolin.alg b/lib-src/libnyquist/nyquist/tran/instrmandolin.alg index 5d672f51a..acee824a6 100644 --- a/lib-src/libnyquist/nyquist/tran/instrmandolin.alg +++ b/lib-src/libnyquist/nyquist/tran/instrmandolin.alg @@ -2,7 +2,7 @@ (NAME "mandolin") (ARGUMENTS ("time_type" "t0") ("double" "freq") ("time_type" "d") ("double" "body_size") ("double" "detune") ("rate_type" "sr")) -(STATE ("struct instr *" "mymand" "initInstrument(MANDOLIN, round(sr)); +(STATE ("struct instr *" "mymand" "initInstrument(MANDOLIN, ROUND32(sr)); controlChange(susp->mymand, 1, detune); controlChange(susp->mymand, 2, MAND_CONTROL_CHANGE_CONST * body_size);") ("int" "temp_ret_value" "noteOn(susp->mymand, freq, 1.0)")) diff --git a/lib-src/libnyquist/nyquist/tran/instrmandolin.c b/lib-src/libnyquist/nyquist/tran/instrmandolin.c index accae066f..8f7233e64 100644 --- a/lib-src/libnyquist/nyquist/tran/instrmandolin.c +++ b/lib-src/libnyquist/nyquist/tran/instrmandolin.c @@ -94,13 +94,13 @@ sound_type snd_make_mandolin(time_type t0, double freq, time_type d, double body /* t0 specified as input parameter */ sample_type scale_factor = 1.0F; falloc_generic(susp, mandolin_susp_node, "snd_make_mandolin"); - susp->mymand = initInstrument(MANDOLIN, round(sr)); + susp->mymand = initInstrument(MANDOLIN, ROUND32(sr)); controlChange(susp->mymand, 1, detune); controlChange(susp->mymand, 2, MAND_CONTROL_CHANGE_CONST * body_size);; susp->temp_ret_value = noteOn(susp->mymand, freq, 1.0); susp->susp.fetch = mandolin__fetch; - susp->terminate_cnt = check_terminate_cnt(round((d) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((d) * sr)); /* initialize susp state */ susp->susp.free = mandolin_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/instrmodalbar.alg b/lib-src/libnyquist/nyquist/tran/instrmodalbar.alg index 6b060bd63..82be01f9a 100644 --- a/lib-src/libnyquist/nyquist/tran/instrmodalbar.alg +++ b/lib-src/libnyquist/nyquist/tran/instrmodalbar.alg @@ -1,7 +1,7 @@ (INSTRMODALBAR-ALG (NAME "modalbar") (ARGUMENTS ("time_type" "t0")("double" "freq") ("int" "preset")("time_type" "dur") ("rate_type" "sr")) -(STATE ("struct instr *" "mymbar" "initInstrument(MODALBAR, round(sr)); +(STATE ("struct instr *" "mymbar" "initInstrument(MODALBAR, ROUND32(sr)); controlChange(susp->mymbar, 16, preset);") ("int" "temp_ret_value" "noteOn(susp->mymbar, freq, 1.0);")) (NOT-IN-INNER-LOOP "freq" "temp_ret_value") diff --git a/lib-src/libnyquist/nyquist/tran/instrmodalbar.c b/lib-src/libnyquist/nyquist/tran/instrmodalbar.c index f13fc30be..cec752270 100644 --- a/lib-src/libnyquist/nyquist/tran/instrmodalbar.c +++ b/lib-src/libnyquist/nyquist/tran/instrmodalbar.c @@ -94,12 +94,12 @@ sound_type snd_make_modalbar(time_type t0, double freq, int preset, time_type du /* t0 specified as input parameter */ sample_type scale_factor = 1.0F; falloc_generic(susp, modalbar_susp_node, "snd_make_modalbar"); - susp->mymbar = initInstrument(MODALBAR, round(sr)); + susp->mymbar = initInstrument(MODALBAR, ROUND32(sr)); controlChange(susp->mymbar, 16, preset);; susp->temp_ret_value = noteOn(susp->mymbar, freq, 1.0);; susp->susp.fetch = modalbar__fetch; - susp->terminate_cnt = check_terminate_cnt(round((dur) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((dur) * sr)); /* initialize susp state */ susp->susp.free = modalbar_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/instrsax.alg b/lib-src/libnyquist/nyquist/tran/instrsax.alg index 3fc7b5456..56441da44 100644 --- a/lib-src/libnyquist/nyquist/tran/instrsax.alg +++ b/lib-src/libnyquist/nyquist/tran/instrsax.alg @@ -1,7 +1,7 @@ (INSTRSAX-ALG (NAME "sax") (ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("rate_type" "sr")) -(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, round(sr)); +(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, ROUND32(sr)); controlChange(susp->sax, 1, 0.0);") ("int" "temp_ret_value" "noteOn(susp->sax, freq, 1.0)") ("float" "breath_scale" "breath_env->scale * SAX_CONTROL_CHANGE_CONST")) diff --git a/lib-src/libnyquist/nyquist/tran/instrsax.c b/lib-src/libnyquist/nyquist/tran/instrsax.c index 31bccc08f..97c9cb717 100644 --- a/lib-src/libnyquist/nyquist/tran/instrsax.c +++ b/lib-src/libnyquist/nyquist/tran/instrsax.c @@ -99,12 +99,12 @@ void sax_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); @@ -146,7 +146,7 @@ sound_type snd_make_sax(double freq, sound_type breath_env, rate_type sr) sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, sax_susp_node, "snd_make_sax"); - susp->sax = initInstrument(SAXOFONY, round(sr)); + susp->sax = initInstrument(SAXOFONY, ROUND32(sr)); controlChange(susp->sax, 1, 0.0);; susp->temp_ret_value = noteOn(susp->sax, freq, 1.0); susp->breath_scale = breath_env->scale * SAX_CONTROL_CHANGE_CONST; diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxall.alg b/lib-src/libnyquist/nyquist/tran/instrsaxall.alg index f09d25ac4..d2afe9d42 100644 --- a/lib-src/libnyquist/nyquist/tran/instrsaxall.alg +++ b/lib-src/libnyquist/nyquist/tran/instrsaxall.alg @@ -5,7 +5,7 @@ ("sound_type" "reed_stiffness") ("sound_type" "noise_env") ("sound_type" "blow_pos") ("sound_type" "reed_table_offset") ("rate_type" "sr")) -(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, round(sr)); +(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, ROUND32(sr)); noteOn(susp->sax, freq, 1.0); controlChange(susp->sax, 29, SAX_CONTROL_CHANGE_CONST * vibrato_freq); controlChange(susp->sax, 1, SAX_CONTROL_CHANGE_CONST * vibrato_gain);") diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxall.c b/lib-src/libnyquist/nyquist/tran/instrsaxall.c index b6d5fdc0d..c9d7993f9 100644 --- a/lib-src/libnyquist/nyquist/tran/instrsaxall.c +++ b/lib-src/libnyquist/nyquist/tran/instrsaxall.c @@ -178,52 +178,52 @@ void sax_all_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* fetch samples from freq_env up to final_time for this block of zeros */ - while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= + while ((ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= susp->freq_env->current) susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt); /* fetch samples from reed_stiffness up to final_time for this block of zeros */ - while ((round((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr)) >= + while ((ROUNDBIG((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr)) >= susp->reed_stiffness->current) susp_get_samples(reed_stiffness, reed_stiffness_ptr, reed_stiffness_cnt); /* fetch samples from noise_env up to final_time for this block of zeros */ - while ((round((final_time - susp->noise_env->t0) * susp->noise_env->sr)) >= + while ((ROUNDBIG((final_time - susp->noise_env->t0) * susp->noise_env->sr)) >= susp->noise_env->current) susp_get_samples(noise_env, noise_env_ptr, noise_env_cnt); /* fetch samples from blow_pos up to final_time for this block of zeros */ - while ((round((final_time - susp->blow_pos->t0) * susp->blow_pos->sr)) >= + while ((ROUNDBIG((final_time - susp->blow_pos->t0) * susp->blow_pos->sr)) >= susp->blow_pos->current) susp_get_samples(blow_pos, blow_pos_ptr, blow_pos_cnt); /* fetch samples from reed_table_offset up to final_time for this block of zeros */ - while ((round((final_time - susp->reed_table_offset->t0) * susp->reed_table_offset->sr)) >= + while ((ROUNDBIG((final_time - susp->reed_table_offset->t0) * susp->reed_table_offset->sr)) >= susp->reed_table_offset->current) susp_get_samples(reed_table_offset, reed_table_offset_ptr, reed_table_offset_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); - n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr - + n = ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr - (susp->freq_env->current - susp->freq_env_cnt)); susp->freq_env_ptr += n; susp_took(freq_env_cnt, n); - n = round((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr - + n = ROUNDBIG((final_time - susp->reed_stiffness->t0) * susp->reed_stiffness->sr - (susp->reed_stiffness->current - susp->reed_stiffness_cnt)); susp->reed_stiffness_ptr += n; susp_took(reed_stiffness_cnt, n); - n = round((final_time - susp->noise_env->t0) * susp->noise_env->sr - + n = ROUNDBIG((final_time - susp->noise_env->t0) * susp->noise_env->sr - (susp->noise_env->current - susp->noise_env_cnt)); susp->noise_env_ptr += n; susp_took(noise_env_cnt, n); - n = round((final_time - susp->blow_pos->t0) * susp->blow_pos->sr - + n = ROUNDBIG((final_time - susp->blow_pos->t0) * susp->blow_pos->sr - (susp->blow_pos->current - susp->blow_pos_cnt)); susp->blow_pos_ptr += n; susp_took(blow_pos_cnt, n); - n = round((final_time - susp->reed_table_offset->t0) * susp->reed_table_offset->sr - + n = ROUNDBIG((final_time - susp->reed_table_offset->t0) * susp->reed_table_offset->sr - (susp->reed_table_offset->current - susp->reed_table_offset_cnt)); susp->reed_table_offset_ptr += n; susp_took(reed_table_offset_cnt, n); @@ -295,7 +295,7 @@ sound_type snd_make_sax_all(double freq, sound_type breath_env, sound_type freq_ sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, sax_all_susp_node, "snd_make_sax_all"); - susp->sax = initInstrument(SAXOFONY, round(sr)); + susp->sax = initInstrument(SAXOFONY, ROUND32(sr)); noteOn(susp->sax, freq, 1.0); controlChange(susp->sax, 29, SAX_CONTROL_CHANGE_CONST * vibrato_freq); controlChange(susp->sax, 1, SAX_CONTROL_CHANGE_CONST * vibrato_gain);; diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxfreq.alg b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.alg index 2e40195b5..5747e79d4 100644 --- a/lib-src/libnyquist/nyquist/tran/instrsaxfreq.alg +++ b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.alg @@ -2,7 +2,7 @@ (NAME "sax_freq") (ARGUMENTS ("double" "freq") ("sound_type" "breath_env") ("sound_type" "freq_env") ("rate_type" "sr")) -(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, round(sr)); +(STATE ("struct instr *" "sax" "initInstrument(SAXOFONY, ROUND32(sr)); controlChange(susp->sax, 1, 0.0);") ("int" "temp_ret_value" "noteOn(susp->sax, freq, 1.0)") ("float" "breath_scale" "breath_env->scale * SAX_CONTROL_CHANGE_CONST") diff --git a/lib-src/libnyquist/nyquist/tran/instrsaxfreq.c b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.c index e0124dd26..97b3903fc 100644 --- a/lib-src/libnyquist/nyquist/tran/instrsaxfreq.c +++ b/lib-src/libnyquist/nyquist/tran/instrsaxfreq.c @@ -115,20 +115,20 @@ void sax_freq_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from breath_env up to final_time for this block of zeros */ - while ((round((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= + while ((ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr)) >= susp->breath_env->current) susp_get_samples(breath_env, breath_env_ptr, breath_env_cnt); /* fetch samples from freq_env up to final_time for this block of zeros */ - while ((round((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= + while ((ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr)) >= susp->freq_env->current) susp_get_samples(freq_env, freq_env_ptr, freq_env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->breath_env->t0) * susp->breath_env->sr - + n = ROUNDBIG((final_time - susp->breath_env->t0) * susp->breath_env->sr - (susp->breath_env->current - susp->breath_env_cnt)); susp->breath_env_ptr += n; susp_took(breath_env_cnt, n); - n = round((final_time - susp->freq_env->t0) * susp->freq_env->sr - + n = ROUNDBIG((final_time - susp->freq_env->t0) * susp->freq_env->sr - (susp->freq_env->current - susp->freq_env_cnt)); susp->freq_env_ptr += n; susp_took(freq_env_cnt, n); @@ -176,7 +176,7 @@ sound_type snd_make_sax_freq(double freq, sound_type breath_env, sound_type freq sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, sax_freq_susp_node, "snd_make_sax_freq"); - susp->sax = initInstrument(SAXOFONY, round(sr)); + susp->sax = initInstrument(SAXOFONY, ROUND32(sr)); controlChange(susp->sax, 1, 0.0);; susp->temp_ret_value = noteOn(susp->sax, freq, 1.0); susp->breath_scale = breath_env->scale * SAX_CONTROL_CHANGE_CONST; diff --git a/lib-src/libnyquist/nyquist/tran/instrsitar.alg b/lib-src/libnyquist/nyquist/tran/instrsitar.alg index dc5bd394c..c8e23108b 100644 --- a/lib-src/libnyquist/nyquist/tran/instrsitar.alg +++ b/lib-src/libnyquist/nyquist/tran/instrsitar.alg @@ -2,7 +2,7 @@ (NAME "sitar") (ARGUMENTS ("time_type" "t0") ("double" "freq") ("time_type" "dur") ("rate_type" "sr")) -(STATE ("struct instr *" "mysitar" "initInstrument(SITAR, round(sr))") +(STATE ("struct instr *" "mysitar" "initInstrument(SITAR, ROUND32(sr))") ("int" "temp_ret_value" "noteOn(susp->mysitar, freq, 1.0)")) (NOT-IN-INNER-LOOP "freq" "temp_ret_value") (SAMPLE-RATE "sr") diff --git a/lib-src/libnyquist/nyquist/tran/instrsitar.c b/lib-src/libnyquist/nyquist/tran/instrsitar.c index 2c05d89ea..32fafb9a9 100644 --- a/lib-src/libnyquist/nyquist/tran/instrsitar.c +++ b/lib-src/libnyquist/nyquist/tran/instrsitar.c @@ -94,11 +94,11 @@ sound_type snd_make_sitar(time_type t0, double freq, time_type dur, rate_type sr /* t0 specified as input parameter */ sample_type scale_factor = 1.0F; falloc_generic(susp, sitar_susp_node, "snd_make_sitar"); - susp->mysitar = initInstrument(SITAR, round(sr)); + susp->mysitar = initInstrument(SITAR, ROUND32(sr)); susp->temp_ret_value = noteOn(susp->mysitar, freq, 1.0); susp->susp.fetch = sitar__fetch; - susp->terminate_cnt = check_terminate_cnt(round((dur) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((dur) * sr)); /* initialize susp state */ susp->susp.free = sitar_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/integrate.c b/lib-src/libnyquist/nyquist/tran/integrate.c index 510eda9b4..f55f48b31 100644 --- a/lib-src/libnyquist/nyquist/tran/integrate.c +++ b/lib-src/libnyquist/nyquist/tran/integrate.c @@ -123,12 +123,12 @@ void integrate_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/log.c b/lib-src/libnyquist/nyquist/tran/log.c index 6df2a7fb8..95db96bd5 100644 --- a/lib-src/libnyquist/nyquist/tran/log.c +++ b/lib-src/libnyquist/nyquist/tran/log.c @@ -119,12 +119,12 @@ void log_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/lpreson.c b/lib-src/libnyquist/nyquist/tran/lpreson.c index 318d93bbd..42c8707c7 100644 --- a/lib-src/libnyquist/nyquist/tran/lpreson.c +++ b/lib-src/libnyquist/nyquist/tran/lpreson.c @@ -219,12 +219,12 @@ void lpreson_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from x_snd up to final_time for this block of zeros */ - while ((round((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >= + while ((ROUNDBIG((final_time - susp->x_snd->t0) * susp->x_snd->sr)) >= susp->x_snd->current) susp_get_samples(x_snd, x_snd_ptr, x_snd_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->x_snd->t0) * susp->x_snd->sr - + n = ROUNDBIG((final_time - susp->x_snd->t0) * susp->x_snd->sr - (susp->x_snd->current - susp->x_snd_cnt)); susp->x_snd_ptr += n; susp_took(x_snd_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/maxv.c b/lib-src/libnyquist/nyquist/tran/maxv.c index 6eecd4f29..c3488b437 100644 --- a/lib-src/libnyquist/nyquist/tran/maxv.c +++ b/lib-src/libnyquist/nyquist/tran/maxv.c @@ -849,20 +849,20 @@ void maxv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from s2 up to final_time for this block of zeros */ - while ((round((final_time - susp->s2->t0) * susp->s2->sr)) >= + while ((ROUNDBIG((final_time - susp->s2->t0) * susp->s2->sr)) >= susp->s2->current) susp_get_samples(s2, s2_ptr, s2_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->s2->t0) * susp->s2->sr - + n = ROUNDBIG((final_time - susp->s2->t0) * susp->s2->sr - (susp->s2->current - susp->s2_cnt)); susp->s2_ptr += n; susp_took(s2_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/offset.c b/lib-src/libnyquist/nyquist/tran/offset.c index 4b2d20b65..f7058b4ed 100644 --- a/lib-src/libnyquist/nyquist/tran/offset.c +++ b/lib-src/libnyquist/nyquist/tran/offset.c @@ -214,12 +214,12 @@ void offset_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/oneshot.alg b/lib-src/libnyquist/nyquist/tran/oneshot.alg index bd1bfc9aa..5cbeb0cf0 100644 --- a/lib-src/libnyquist/nyquist/tran/oneshot.alg +++ b/lib-src/libnyquist/nyquist/tran/oneshot.alg @@ -3,7 +3,7 @@ (ARGUMENTS ("sound_type" "input") ("double" "level") ("double" "ontime")) ; (INTERNAL-SCALING input) ; scale factor not handled in level because scale could be negative (STATE ("double" "lev" "level") - ("long" "oncount" "round(ontime * input->sr)") + ("long" "oncount" "ROUNDBIG(ontime * input->sr)") ("long" "cnt" "0")) (START (MIN input)) (INNER-LOOP "double x = input; diff --git a/lib-src/libnyquist/nyquist/tran/oneshot.c b/lib-src/libnyquist/nyquist/tran/oneshot.c index a82ec8b42..28a148a93 100644 --- a/lib-src/libnyquist/nyquist/tran/oneshot.c +++ b/lib-src/libnyquist/nyquist/tran/oneshot.c @@ -232,12 +232,12 @@ void oneshot_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); @@ -280,7 +280,7 @@ sound_type snd_make_oneshot(sound_type input, double level, double ontime) time_type t0_min = t0; falloc_generic(susp, oneshot_susp_node, "snd_make_oneshot"); susp->lev = level; - susp->oncount = round(ontime * input->sr); + susp->oncount = ROUNDBIG(ontime * input->sr); susp->cnt = 0; /* select a susp fn based on sample rates */ diff --git a/lib-src/libnyquist/nyquist/tran/osc.c b/lib-src/libnyquist/nyquist/tran/osc.c index 47c8901a7..8fb059ce2 100644 --- a/lib-src/libnyquist/nyquist/tran/osc.c +++ b/lib-src/libnyquist/nyquist/tran/osc.c @@ -114,7 +114,7 @@ sound_type snd_make_osc(sound_type input, double step, rate_type sr, double hz, input->sr, sr, hz, &susp->ph_incr); susp->susp.fetch = osc__fetch; - susp->terminate_cnt = check_terminate_cnt(round((d) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((d) * sr)); /* initialize susp state */ susp->susp.free = osc_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/partial.alg b/lib-src/libnyquist/nyquist/tran/partial.alg index 45a199958..5af884ef0 100644 --- a/lib-src/libnyquist/nyquist/tran/partial.alg +++ b/lib-src/libnyquist/nyquist/tran/partial.alg @@ -6,7 +6,7 @@ ") (START (MIN env)) (STATE ("long" "phase" "0") - ("long" "ph_incr" "round((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr)")) + ("long" "ph_incr" "ROUND32((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr)")) (TERMINATE (MIN env)) (LOGICAL-STOP (MIN env)) (INNER-LOOP "output = sine_table[phase >> SINE_TABLE_SHIFT] * env; diff --git a/lib-src/libnyquist/nyquist/tran/partial.c b/lib-src/libnyquist/nyquist/tran/partial.c index decbd3ef3..b582f4931 100644 --- a/lib-src/libnyquist/nyquist/tran/partial.c +++ b/lib-src/libnyquist/nyquist/tran/partial.c @@ -474,12 +474,12 @@ void partial_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from env up to final_time for this block of zeros */ - while ((round((final_time - susp->env->t0) * susp->env->sr)) >= + while ((ROUNDBIG((final_time - susp->env->t0) * susp->env->sr)) >= susp->env->current) susp_get_samples(env, env_ptr, env_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->env->t0) * susp->env->sr - + n = ROUNDBIG((final_time - susp->env->t0) * susp->env->sr - (susp->env->current - susp->env_cnt)); susp->env_ptr += n; susp_took(env_cnt, n); @@ -522,7 +522,7 @@ sound_type snd_make_partial(rate_type sr, double hz, sound_type env) time_type t0_min = t0; falloc_generic(susp, partial_susp_node, "snd_make_partial"); susp->phase = 0; - susp->ph_incr = round((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr); + susp->ph_incr = ROUND32((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr); /* make sure no sample rate is too high */ if (env->sr > sr) { diff --git a/lib-src/libnyquist/nyquist/tran/pluck.c b/lib-src/libnyquist/nyquist/tran/pluck.c index 4822a71ee..57aae5003 100644 --- a/lib-src/libnyquist/nyquist/tran/pluck.c +++ b/lib-src/libnyquist/nyquist/tran/pluck.c @@ -238,7 +238,7 @@ sound_type snd_make_pluck(rate_type sr, double hz, time_type t0, time_type d, do susp->len, susp->cons); susp->susp.fetch = pluck__fetch; - susp->terminate_cnt = check_terminate_cnt(round((d) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((d) * sr)); /* initialize susp state */ susp->susp.free = pluck_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/prod.c b/lib-src/libnyquist/nyquist/tran/prod.c index 1e9424dac..2996f7cb9 100644 --- a/lib-src/libnyquist/nyquist/tran/prod.c +++ b/lib-src/libnyquist/nyquist/tran/prod.c @@ -380,20 +380,20 @@ void prod_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from s2 up to final_time for this block of zeros */ - while ((round((final_time - susp->s2->t0) * susp->s2->sr)) >= + while ((ROUNDBIG((final_time - susp->s2->t0) * susp->s2->sr)) >= susp->s2->current) susp_get_samples(s2, s2_ptr, s2_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->s2->t0) * susp->s2->sr - + n = ROUNDBIG((final_time - susp->s2->t0) * susp->s2->sr - (susp->s2->current - susp->s2_cnt)); susp->s2_ptr += n; susp_took(s2_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/pwl.alg b/lib-src/libnyquist/nyquist/tran/pwl.alg index 3f244d833..91f7306e6 100644 --- a/lib-src/libnyquist/nyquist/tran/pwl.alg +++ b/lib-src/libnyquist/nyquist/tran/pwl.alg @@ -14,6 +14,7 @@ * the caller (users should not call this directly). */ +char *pwl_bad_breakpoint_list = \"bad breakpoint list\"; /* compute_lvl -- setup the susp with level, advance bpt_ptr */ /* @@ -28,8 +29,14 @@ */ boolean compute_lvl(pwl_susp_type susp) { - if (!cdr(susp->bpt_ptr)) return true; - susp->lvl = getflonum(car(cdr(susp->bpt_ptr))); + LVAL lval = susp->bpt_ptr; + if (!consp(lval)) xlfail(pwl_bad_breakpoint_list); + lval = cdr(lval); + if (!lval) return true; + if (!consp(lval)) xlfail(pwl_bad_breakpoint_list); + lval = car(lval); + if (!floatp(lval)) xlfail(pwl_bad_breakpoint_list); + susp->lvl = getflonum(lval); susp->bpt_ptr = cdr(cdr(susp->bpt_ptr)); return !susp->bpt_ptr; } @@ -43,11 +50,19 @@ boolean compute_incr(pwl_susp_type susp, long *n, long cur) { double target; while (*n == 0) { - *n = getfixnum(car(susp->bpt_ptr)) - cur; + LVAL lval = susp->bpt_ptr; + if (!consp(lval)) xlfail(pwl_bad_breakpoint_list); + lval = car(lval); + if (!fixp(lval)) xlfail(pwl_bad_breakpoint_list); + *n = getfixnum(lval) - cur; /* if there is a 2nd element of the pair, get the target */ - if (cdr(susp->bpt_ptr)) - target = getflonum(car(cdr(susp->bpt_ptr))); - else target = 0.0; + lval = cdr(susp->bpt_ptr); + if (lval) { + if (!consp(lval)) xlfail(pwl_bad_breakpoint_list); + lval = car(lval); + if (!floatp(lval)) xlfail(pwl_bad_breakpoint_list); + target = getflonum(lval); + } else target = 0.0; if (*n > 0) susp->incr = (target - susp->lvl) / *n; else if (compute_lvl(susp)) return true; } diff --git a/lib-src/libnyquist/nyquist/tran/pwl.c b/lib-src/libnyquist/nyquist/tran/pwl.c index 7546e01f8..d52a8ee2a 100644 --- a/lib-src/libnyquist/nyquist/tran/pwl.c +++ b/lib-src/libnyquist/nyquist/tran/pwl.c @@ -33,6 +33,7 @@ typedef struct pwl_susp_struct { * the caller (users should not call this directly). */ +char *pwl_bad_breakpoint_list = "bad breakpoint list"; /* compute_lvl -- setup the susp with level, advance bpt_ptr */ /* @@ -47,8 +48,14 @@ typedef struct pwl_susp_struct { */ boolean compute_lvl(pwl_susp_type susp) { - if (!cdr(susp->bpt_ptr)) return true; - susp->lvl = getflonum(car(cdr(susp->bpt_ptr))); + LVAL lval = susp->bpt_ptr; + if (!consp(lval)) xlfail(pwl_bad_breakpoint_list); + lval = cdr(lval); + if (!lval) return true; + if (!consp(lval)) xlfail(pwl_bad_breakpoint_list); + lval = car(lval); + if (!floatp(lval)) xlfail(pwl_bad_breakpoint_list); + susp->lvl = getflonum(lval); susp->bpt_ptr = cdr(cdr(susp->bpt_ptr)); return !susp->bpt_ptr; } @@ -62,11 +69,19 @@ boolean compute_incr(pwl_susp_type susp, long *n, long cur) { double target; while (*n == 0) { - *n = getfixnum(car(susp->bpt_ptr)) - cur; + LVAL lval = susp->bpt_ptr; + if (!consp(lval)) xlfail(pwl_bad_breakpoint_list); + lval = car(lval); + if (!fixp(lval)) xlfail(pwl_bad_breakpoint_list); + *n = getfixnum(lval) - cur; /* if there is a 2nd element of the pair, get the target */ - if (cdr(susp->bpt_ptr)) - target = getflonum(car(cdr(susp->bpt_ptr))); - else target = 0.0; + lval = cdr(susp->bpt_ptr); + if (lval) { + if (!consp(lval)) xlfail(pwl_bad_breakpoint_list); + lval = car(lval); + if (!floatp(lval)) xlfail(pwl_bad_breakpoint_list); + target = getflonum(lval); + } else target = 0.0; if (*n > 0) susp->incr = (target - susp->lvl) / *n; else if (compute_lvl(susp)) return true; } diff --git a/lib-src/libnyquist/nyquist/tran/quantize.alg b/lib-src/libnyquist/nyquist/tran/quantize.alg index 51047b2a2..465a648ab 100644 --- a/lib-src/libnyquist/nyquist/tran/quantize.alg +++ b/lib-src/libnyquist/nyquist/tran/quantize.alg @@ -8,7 +8,7 @@ (INNER-LOOP "{ \t\tfloat x = s1 * factor; \t\tlong xx; -\t\tx = (x > 0.0F ? x + 0.5 : x - 0.5); +\t\tx = (x > 0.0F ? x + 0.5F : x - 0.5F); \t\txx = (long) x; \t\toutput = (float) xx; \t }") diff --git a/lib-src/libnyquist/nyquist/tran/quantize.c b/lib-src/libnyquist/nyquist/tran/quantize.c index c7ac6d123..712b48cea 100644 --- a/lib-src/libnyquist/nyquist/tran/quantize.c +++ b/lib-src/libnyquist/nyquist/tran/quantize.c @@ -92,7 +92,7 @@ void quantize_n_fetch(snd_susp_type a_susp, snd_list_type snd_list) { float x = *s1_ptr_reg++ * factor_reg; long xx; - x = (x > 0.0F ? x + 0.5 : x - 0.5); + x = (x > 0.0F ? x + 0.5F : x - 0.5F); xx = (long) x; *out_ptr_reg++ = (float) xx; }; @@ -128,12 +128,12 @@ void quantize_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/recip.c b/lib-src/libnyquist/nyquist/tran/recip.c index 0a826b4b5..93b058b0f 100644 --- a/lib-src/libnyquist/nyquist/tran/recip.c +++ b/lib-src/libnyquist/nyquist/tran/recip.c @@ -122,12 +122,12 @@ void recip_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/reson.c b/lib-src/libnyquist/nyquist/tran/reson.c index 986cd7f50..a49d6ec1b 100644 --- a/lib-src/libnyquist/nyquist/tran/reson.c +++ b/lib-src/libnyquist/nyquist/tran/reson.c @@ -245,12 +245,12 @@ void reson_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s up to final_time for this block of zeros */ - while ((round((final_time - susp->s->t0) * susp->s->sr)) >= + while ((ROUNDBIG((final_time - susp->s->t0) * susp->s->sr)) >= susp->s->current) susp_get_samples(s, s_ptr, s_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s->t0) * susp->s->sr - + n = ROUNDBIG((final_time - susp->s->t0) * susp->s->sr - (susp->s->current - susp->s_cnt)); susp->s_ptr += n; susp_took(s_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/resoncv.c b/lib-src/libnyquist/nyquist/tran/resoncv.c index 8ecc5c1d0..c33b13789 100644 --- a/lib-src/libnyquist/nyquist/tran/resoncv.c +++ b/lib-src/libnyquist/nyquist/tran/resoncv.c @@ -480,20 +480,20 @@ void resoncv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from bw up to final_time for this block of zeros */ - while ((round((final_time - susp->bw->t0) * susp->bw->sr)) >= + while ((ROUNDBIG((final_time - susp->bw->t0) * susp->bw->sr)) >= susp->bw->current) susp_get_samples(bw, bw_ptr, bw_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->bw->t0) * susp->bw->sr - + n = ROUNDBIG((final_time - susp->bw->t0) * susp->bw->sr - (susp->bw->current - susp->bw_cnt)); susp->bw_ptr += n; susp_took(bw_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/resonvc.c b/lib-src/libnyquist/nyquist/tran/resonvc.c index 97e7741ec..5267ee80e 100644 --- a/lib-src/libnyquist/nyquist/tran/resonvc.c +++ b/lib-src/libnyquist/nyquist/tran/resonvc.c @@ -466,20 +466,20 @@ void resonvc_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from hz up to final_time for this block of zeros */ - while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >= + while ((ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr)) >= susp->hz->current) susp_get_samples(hz, hz_ptr, hz_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->hz->t0) * susp->hz->sr - + n = ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr - (susp->hz->current - susp->hz_cnt)); susp->hz_ptr += n; susp_took(hz_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/resonvv.c b/lib-src/libnyquist/nyquist/tran/resonvv.c index 45934152c..e7eb67b25 100644 --- a/lib-src/libnyquist/nyquist/tran/resonvv.c +++ b/lib-src/libnyquist/nyquist/tran/resonvv.c @@ -1591,28 +1591,28 @@ void resonvv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from hz1 up to final_time for this block of zeros */ - while ((round((final_time - susp->hz1->t0) * susp->hz1->sr)) >= + while ((ROUNDBIG((final_time - susp->hz1->t0) * susp->hz1->sr)) >= susp->hz1->current) susp_get_samples(hz1, hz1_ptr, hz1_cnt); /* fetch samples from bw up to final_time for this block of zeros */ - while ((round((final_time - susp->bw->t0) * susp->bw->sr)) >= + while ((ROUNDBIG((final_time - susp->bw->t0) * susp->bw->sr)) >= susp->bw->current) susp_get_samples(bw, bw_ptr, bw_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->hz1->t0) * susp->hz1->sr - + n = ROUNDBIG((final_time - susp->hz1->t0) * susp->hz1->sr - (susp->hz1->current - susp->hz1_cnt)); susp->hz1_ptr += n; susp_took(hz1_cnt, n); - n = round((final_time - susp->bw->t0) * susp->bw->sr - + n = ROUNDBIG((final_time - susp->bw->t0) * susp->bw->sr - (susp->bw->current - susp->bw_cnt)); susp->bw_ptr += n; susp_took(bw_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/sampler.alg b/lib-src/libnyquist/nyquist/tran/sampler.alg index 1ac9469b3..685db149b 100644 --- a/lib-src/libnyquist/nyquist/tran/sampler.alg +++ b/lib-src/libnyquist/nyquist/tran/sampler.alg @@ -24,7 +24,7 @@ if (susp->the_table->length <= 1) { xlfail(\"sampler table length <= 1\"); } - if (index > round(susp->table_len) - 2 || + if (index > ROUND32(susp->table_len) - 2 || index < 0) { xlfail(\"sampler loop start not within samples\"); } @@ -35,7 +35,7 @@ xlfail(\"sampler sample rate <= 0\"); } /* copy interpolated start to last entry */ - susp->table_ptr[round(susp->table_len)] = + susp->table_ptr[ROUND32(susp->table_len)] = (sample_type) (susp->table_ptr[index] * (1.0 - frac) + susp->table_ptr[index + 1] * frac);}") ) diff --git a/lib-src/libnyquist/nyquist/tran/sampler.c b/lib-src/libnyquist/nyquist/tran/sampler.c index 133a652bc..1d4eadcb5 100644 --- a/lib-src/libnyquist/nyquist/tran/sampler.c +++ b/lib-src/libnyquist/nyquist/tran/sampler.c @@ -404,12 +404,12 @@ void sampler_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s_fm up to final_time for this block of zeros */ - while ((round((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >= + while ((ROUNDBIG((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >= susp->s_fm->current) susp_get_samples(s_fm, s_fm_ptr, s_fm_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s_fm->t0) * susp->s_fm->sr - + n = ROUNDBIG((final_time - susp->s_fm->t0) * susp->s_fm->sr - (susp->s_fm->current - susp->s_fm_cnt)); susp->s_fm_ptr += n; susp_took(s_fm_cnt, n); @@ -470,7 +470,7 @@ sound_type snd_make_sampler(sound_type s, double step, double loop_start, rate_t if (susp->the_table->length <= 1) { xlfail("sampler table length <= 1"); } - if (index > round(susp->table_len) - 2 || + if (index > ROUND32(susp->table_len) - 2 || index < 0) { xlfail("sampler loop start not within samples"); } @@ -481,7 +481,7 @@ sound_type snd_make_sampler(sound_type s, double step, double loop_start, rate_t xlfail("sampler sample rate <= 0"); } /* copy interpolated start to last entry */ - susp->table_ptr[round(susp->table_len)] = + susp->table_ptr[ROUND32(susp->table_len)] = (sample_type) (susp->table_ptr[index] * (1.0 - frac) + susp->table_ptr[index + 1] * frac);}; diff --git a/lib-src/libnyquist/nyquist/tran/scale.c b/lib-src/libnyquist/nyquist/tran/scale.c index bd995f780..fbdc4bd52 100644 --- a/lib-src/libnyquist/nyquist/tran/scale.c +++ b/lib-src/libnyquist/nyquist/tran/scale.c @@ -122,12 +122,12 @@ void normalize_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/shape.c b/lib-src/libnyquist/nyquist/tran/shape.c index b2381653c..80334a18b 100644 --- a/lib-src/libnyquist/nyquist/tran/shape.c +++ b/lib-src/libnyquist/nyquist/tran/shape.c @@ -151,12 +151,12 @@ void shape_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from sin up to final_time for this block of zeros */ - while ((round((final_time - susp->sin->t0) * susp->sin->sr)) >= + while ((ROUNDBIG((final_time - susp->sin->t0) * susp->sin->sr)) >= susp->sin->current) susp_get_samples(sin, sin_ptr, sin_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->sin->t0) * susp->sin->sr - + n = ROUNDBIG((final_time - susp->sin->t0) * susp->sin->sr - (susp->sin->current - susp->sin_cnt)); susp->sin_ptr += n; susp_took(sin_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/sine.alg b/lib-src/libnyquist/nyquist/tran/sine.alg index 883c6482c..d3936e2fe 100644 --- a/lib-src/libnyquist/nyquist/tran/sine.alg +++ b/lib-src/libnyquist/nyquist/tran/sine.alg @@ -2,7 +2,7 @@ (NAME "sine") (ARGUMENTS ("time_type" "t0") ("double" "hz") ("rate_type" "sr") ("time_type" "d")) (STATE ("long" "phase" "0") - ("long" "ph_incr" "round(((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr))")) + ("long" "ph_incr" "ROUND32(((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr))")) (TERMINATE (AFTER "d")) (INNER-LOOP "output = sine_table[phase >> SINE_TABLE_SHIFT]; phase += ph_incr; diff --git a/lib-src/libnyquist/nyquist/tran/sine.c b/lib-src/libnyquist/nyquist/tran/sine.c index 993adc5c2..9da29bc9f 100644 --- a/lib-src/libnyquist/nyquist/tran/sine.c +++ b/lib-src/libnyquist/nyquist/tran/sine.c @@ -106,10 +106,10 @@ sound_type snd_make_sine(time_type t0, double hz, rate_type sr, time_type d) sample_type scale_factor = 1.0F; falloc_generic(susp, sine_susp_node, "snd_make_sine"); susp->phase = 0; - susp->ph_incr = round(((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr)); + susp->ph_incr = ROUND32(((hz * SINE_TABLE_LEN) * (1 << SINE_TABLE_SHIFT) / sr)); susp->susp.fetch = sine__fetch; - susp->terminate_cnt = check_terminate_cnt(round((d) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((d) * sr)); /* initialize susp state */ susp->susp.free = sine_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/siosc.alg b/lib-src/libnyquist/nyquist/tran/siosc.alg index bdc262372..ca5a515fa 100644 --- a/lib-src/libnyquist/nyquist/tran/siosc.alg +++ b/lib-src/libnyquist/nyquist/tran/siosc.alg @@ -12,12 +12,15 @@ (ARGUMENTS ("LVAL" "lis") ("rate_type" "sr") ("double" "hz") ("time_type" "t0") ("sound_type" "s_fm")) (SUPPORT-FUNCTIONS " +char *siosc_bad_table_list = \"bad table list in SIOSC\"; + /* sisosc_table_init -- set up first two tables for interpolation */ /**/ void siosc_table_init(siosc_susp_type susp) { sound_type snd; - if (!susp->lis) xlfail(\"bad table list in SIOSC\"); + if (!susp->lis || !consp(susp->lis) || !soundp(car(susp->lis))) + xlfail(siosc_bad_table_list); snd = getsound(car(susp->lis)); susp->table_b_ptr_ptr = sound_to_table(snd); susp->table_b_samps = susp->table_b_ptr_ptr->samples; @@ -46,13 +49,16 @@ long siosc_table_update(siosc_susp_type susp, long cur) sound_type snd; /* compute slope */ + if (!consp(susp->lis) || !fixp(car(susp->lis))) + xlfail(siosc_bad_table_list); susp->next_breakpoint = getfixnum(car(susp->lis)); susp->lis = cdr(susp->lis); n = susp->next_breakpoint - cur; susp->ampslope = 1.0 / n; /* build new table: */ - if (!susp->lis) xlfail(\"bad table list in SIOSC\"); + if (!susp->lis || !consp(susp->lis) || !soundp(car(susp->lis))) + xlfail(\"bad table list in SIOSC\"); snd = getsound(car(susp->lis)); susp->table_b_ptr_ptr = sound_to_table(snd); susp->table_b_samps = susp->table_b_ptr_ptr->samples; diff --git a/lib-src/libnyquist/nyquist/tran/siosc.c b/lib-src/libnyquist/nyquist/tran/siosc.c index 09083f6e0..6a2d6a059 100644 --- a/lib-src/libnyquist/nyquist/tran/siosc.c +++ b/lib-src/libnyquist/nyquist/tran/siosc.c @@ -46,12 +46,15 @@ typedef struct siosc_susp_struct { } siosc_susp_node, *siosc_susp_type; +char *siosc_bad_table_list = "bad table list in SIOSC"; + /* sisosc_table_init -- set up first two tables for interpolation */ /**/ void siosc_table_init(siosc_susp_type susp) { sound_type snd; - if (!susp->lis) xlfail("bad table list in SIOSC"); + if (!susp->lis || !consp(susp->lis) || !soundp(car(susp->lis))) + xlfail(siosc_bad_table_list); snd = getsound(car(susp->lis)); susp->table_b_ptr_ptr = sound_to_table(snd); susp->table_b_samps = susp->table_b_ptr_ptr->samples; @@ -80,13 +83,16 @@ long siosc_table_update(siosc_susp_type susp, long cur) sound_type snd; /* compute slope */ + if (!consp(susp->lis) || !fixp(car(susp->lis))) + xlfail(siosc_bad_table_list); susp->next_breakpoint = getfixnum(car(susp->lis)); susp->lis = cdr(susp->lis); n = susp->next_breakpoint - cur; susp->ampslope = 1.0 / n; /* build new table: */ - if (!susp->lis) xlfail("bad table list in SIOSC"); + if (!susp->lis || !consp(susp->lis) || !soundp(car(susp->lis))) + xlfail("bad table list in SIOSC"); snd = getsound(car(susp->lis)); susp->table_b_ptr_ptr = sound_to_table(snd); susp->table_b_samps = susp->table_b_ptr_ptr->samples; @@ -530,12 +536,12 @@ void siosc_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s_fm up to final_time for this block of zeros */ - while ((round((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >= + while ((ROUNDBIG((final_time - susp->s_fm->t0) * susp->s_fm->sr)) >= susp->s_fm->current) susp_get_samples(s_fm, s_fm_ptr, s_fm_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s_fm->t0) * susp->s_fm->sr - + n = ROUNDBIG((final_time - susp->s_fm->t0) * susp->s_fm->sr - (susp->s_fm->current - susp->s_fm_cnt)); susp->s_fm_ptr += n; susp_took(s_fm_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/slope.c b/lib-src/libnyquist/nyquist/tran/slope.c index 0eec69eda..24f94a872 100644 --- a/lib-src/libnyquist/nyquist/tran/slope.c +++ b/lib-src/libnyquist/nyquist/tran/slope.c @@ -128,12 +128,12 @@ void slope_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/sqrt.c b/lib-src/libnyquist/nyquist/tran/sqrt.c index c15509d23..477fcfc14 100644 --- a/lib-src/libnyquist/nyquist/tran/sqrt.c +++ b/lib-src/libnyquist/nyquist/tran/sqrt.c @@ -121,12 +121,12 @@ void sqrt_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/stkchorus.alg b/lib-src/libnyquist/nyquist/tran/stkchorus.alg index 4a17e8671..e19e367f7 100644 --- a/lib-src/libnyquist/nyquist/tran/stkchorus.alg +++ b/lib-src/libnyquist/nyquist/tran/stkchorus.alg @@ -3,7 +3,7 @@ (ARGUMENTS ("sound_type" "s1") ("double" "baseDelay") ("double" "depth") ("double" "freq") ("double" "mix")) (STATE ("struct stkEffect *" "mych" - "initStkChorus(baseDelay, depth, freq, round(sr)); + "initStkChorus(baseDelay, depth, freq, ROUND32(sr)); stkEffectSetMix(susp->mych, mix)")) (LINEAR s1) (START (MIN s1)) diff --git a/lib-src/libnyquist/nyquist/tran/stkchorus.c b/lib-src/libnyquist/nyquist/tran/stkchorus.c index 3edda5aff..867974616 100644 --- a/lib-src/libnyquist/nyquist/tran/stkchorus.c +++ b/lib-src/libnyquist/nyquist/tran/stkchorus.c @@ -125,12 +125,12 @@ void stkchorus_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); @@ -179,7 +179,7 @@ sound_type snd_make_stkchorus(sound_type s1, double baseDelay, double depth, dou if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; } falloc_generic(susp, stkchorus_susp_node, "snd_make_stkchorus"); - susp->mych = initStkChorus(baseDelay, depth, freq, round(sr)); + susp->mych = initStkChorus(baseDelay, depth, freq, ROUND32(sr)); stkEffectSetMix(susp->mych, mix); susp->susp.fetch = stkchorus_n_fetch; susp->terminate_cnt = UNKNOWN; diff --git a/lib-src/libnyquist/nyquist/tran/stkpitshift.alg b/lib-src/libnyquist/nyquist/tran/stkpitshift.alg index 7b950bf7a..a67409963 100644 --- a/lib-src/libnyquist/nyquist/tran/stkpitshift.alg +++ b/lib-src/libnyquist/nyquist/tran/stkpitshift.alg @@ -1,7 +1,7 @@ (STKPITSHIFT-ALG (NAME "stkpitshift") (ARGUMENTS ("sound_type" "s1") ("double" "shift") ("double" "mix")) -(STATE ("struct stkEffect *" "mych" "initStkPitShift(shift, round(sr)); +(STATE ("struct stkEffect *" "mych" "initStkPitShift(shift, ROUND32(sr)); stkEffectSetMix(susp->mych, mix)")) (ALWAYS-SCALE s1) (START (MIN s1)) diff --git a/lib-src/libnyquist/nyquist/tran/stkpitshift.c b/lib-src/libnyquist/nyquist/tran/stkpitshift.c index 383956e92..75d8c1ef8 100644 --- a/lib-src/libnyquist/nyquist/tran/stkpitshift.c +++ b/lib-src/libnyquist/nyquist/tran/stkpitshift.c @@ -127,12 +127,12 @@ void stkpitshift_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); @@ -174,7 +174,7 @@ sound_type snd_make_stkpitshift(sound_type s1, double shift, double mix) sample_type scale_factor = 1.0F; time_type t0_min = t0; falloc_generic(susp, stkpitshift_susp_node, "snd_make_stkpitshift"); - susp->mych = initStkPitShift(shift, round(sr)); + susp->mych = initStkPitShift(shift, ROUND32(sr)); stkEffectSetMix(susp->mych, mix); susp->susp.fetch = stkpitshift_s_fetch; susp->terminate_cnt = UNKNOWN; diff --git a/lib-src/libnyquist/nyquist/tran/stkrev.alg b/lib-src/libnyquist/nyquist/tran/stkrev.alg index 49f102172..e44a271ab 100644 --- a/lib-src/libnyquist/nyquist/tran/stkrev.alg +++ b/lib-src/libnyquist/nyquist/tran/stkrev.alg @@ -2,7 +2,7 @@ (NAME "stkrev") (ARGUMENTS ("int" "rev_type") ("sound_type" "s1") ("time_type" "trev") ("double" "mix")) -(STATE ("struct stkEffect *" "myrv" "initStkEffect(rev_type, trev, round(sr)); +(STATE ("struct stkEffect *" "myrv" "initStkEffect(rev_type, trev, ROUND32(sr)); stkEffectSetMix(susp->myrv, mix)")) (LINEAR s1) (START (MIN s1)) diff --git a/lib-src/libnyquist/nyquist/tran/stkrev.c b/lib-src/libnyquist/nyquist/tran/stkrev.c index 7537bf86e..3a1379d90 100644 --- a/lib-src/libnyquist/nyquist/tran/stkrev.c +++ b/lib-src/libnyquist/nyquist/tran/stkrev.c @@ -125,12 +125,12 @@ void stkrev_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); @@ -179,7 +179,7 @@ sound_type snd_make_stkrev(int rev_type, sound_type s1, time_type trev, double m if (s1->sr < sr) { s1->scale = scale_factor; scale_factor = 1.0F; } falloc_generic(susp, stkrev_susp_node, "snd_make_stkrev"); - susp->myrv = initStkEffect(rev_type, trev, round(sr)); + susp->myrv = initStkEffect(rev_type, trev, ROUND32(sr)); stkEffectSetMix(susp->myrv, mix); susp->susp.fetch = stkrev_n_fetch; susp->terminate_cnt = UNKNOWN; diff --git a/lib-src/libnyquist/nyquist/tran/tapf.c b/lib-src/libnyquist/nyquist/tran/tapf.c index 365eaba96..489f3c8c8 100644 --- a/lib-src/libnyquist/nyquist/tran/tapf.c +++ b/lib-src/libnyquist/nyquist/tran/tapf.c @@ -950,20 +950,20 @@ void tapf_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from vardelay up to final_time for this block of zeros */ - while ((round((final_time - susp->vardelay->t0) * susp->vardelay->sr)) >= + while ((ROUNDBIG((final_time - susp->vardelay->t0) * susp->vardelay->sr)) >= susp->vardelay->current) susp_get_samples(vardelay, vardelay_ptr, vardelay_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->vardelay->t0) * susp->vardelay->sr - + n = ROUNDBIG((final_time - susp->vardelay->t0) * susp->vardelay->sr - (susp->vardelay->current - susp->vardelay_cnt)); susp->vardelay_ptr += n; susp_took(vardelay_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/tapv.c b/lib-src/libnyquist/nyquist/tran/tapv.c index bb83d7721..ae7582104 100644 --- a/lib-src/libnyquist/nyquist/tran/tapv.c +++ b/lib-src/libnyquist/nyquist/tran/tapv.c @@ -980,20 +980,20 @@ void tapv_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from vardelay up to final_time for this block of zeros */ - while ((round((final_time - susp->vardelay->t0) * susp->vardelay->sr)) >= + while ((ROUNDBIG((final_time - susp->vardelay->t0) * susp->vardelay->sr)) >= susp->vardelay->current) susp_get_samples(vardelay, vardelay_ptr, vardelay_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->vardelay->t0) * susp->vardelay->sr - + n = ROUNDBIG((final_time - susp->vardelay->t0) * susp->vardelay->sr - (susp->vardelay->current - susp->vardelay_cnt)); susp->vardelay_ptr += n; susp_took(vardelay_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/tone.c b/lib-src/libnyquist/nyquist/tran/tone.c index 2dd094e44..de0aaede8 100644 --- a/lib-src/libnyquist/nyquist/tran/tone.c +++ b/lib-src/libnyquist/nyquist/tran/tone.c @@ -129,12 +129,12 @@ void tone_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/tonev.c b/lib-src/libnyquist/nyquist/tran/tonev.c index 990fab16a..f83b10644 100644 --- a/lib-src/libnyquist/nyquist/tran/tonev.c +++ b/lib-src/libnyquist/nyquist/tran/tonev.c @@ -415,20 +415,20 @@ void tonev_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from s1 up to final_time for this block of zeros */ - while ((round((final_time - susp->s1->t0) * susp->s1->sr)) >= + while ((ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr)) >= susp->s1->current) susp_get_samples(s1, s1_ptr, s1_cnt); /* fetch samples from hz up to final_time for this block of zeros */ - while ((round((final_time - susp->hz->t0) * susp->hz->sr)) >= + while ((ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr)) >= susp->hz->current) susp_get_samples(hz, hz_ptr, hz_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->s1->t0) * susp->s1->sr - + n = ROUNDBIG((final_time - susp->s1->t0) * susp->s1->sr - (susp->s1->current - susp->s1_cnt)); susp->s1_ptr += n; susp_took(s1_cnt, n); - n = round((final_time - susp->hz->t0) * susp->hz->sr - + n = ROUNDBIG((final_time - susp->hz->t0) * susp->hz->sr - (susp->hz->current - susp->hz_cnt)); susp->hz_ptr += n; susp_took(hz_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/translate-stk.lsp b/lib-src/libnyquist/nyquist/tran/translate-stk.lsp new file mode 100644 index 000000000..e69de29bb diff --git a/lib-src/libnyquist/nyquist/tran/upsample.c b/lib-src/libnyquist/nyquist/tran/upsample.c index 370735312..68686b802 100644 --- a/lib-src/libnyquist/nyquist/tran/upsample.c +++ b/lib-src/libnyquist/nyquist/tran/upsample.c @@ -350,12 +350,12 @@ void up_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list) long n; /* fetch samples from input up to final_time for this block of zeros */ - while ((round((final_time - susp->input->t0) * susp->input->sr)) >= + while ((ROUNDBIG((final_time - susp->input->t0) * susp->input->sr)) >= susp->input->current) susp_get_samples(input, input_ptr, input_cnt); /* convert to normal processing when we hit final_count */ /* we want each signal positioned at final_time */ - n = round((final_time - susp->input->t0) * susp->input->sr - + n = ROUNDBIG((final_time - susp->input->t0) * susp->input->sr - (susp->input->current - susp->input_cnt)); susp->input_ptr += n; susp_took(input_cnt, n); diff --git a/lib-src/libnyquist/nyquist/tran/white.c b/lib-src/libnyquist/nyquist/tran/white.c index 739450480..fb32a25aa 100644 --- a/lib-src/libnyquist/nyquist/tran/white.c +++ b/lib-src/libnyquist/nyquist/tran/white.c @@ -87,7 +87,7 @@ sound_type snd_make_white(time_type t0, rate_type sr, time_type d) falloc_generic(susp, white_susp_node, "snd_make_white"); susp->susp.fetch = white__fetch; - susp->terminate_cnt = check_terminate_cnt(round((d) * sr)); + susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((d) * sr)); /* initialize susp state */ susp->susp.free = white_free; susp->susp.sr = sr; diff --git a/lib-src/libnyquist/nyquist/tran/writemake.lsp b/lib-src/libnyquist/nyquist/tran/writemake.lsp index 00df735e2..07cb9090f 100644 --- a/lib-src/libnyquist/nyquist/tran/writemake.lsp +++ b/lib-src/libnyquist/nyquist/tran/writemake.lsp @@ -642,18 +642,18 @@ (cond ((eq (car terminate) 'AT) (let ((time-expr (cadr terminate))) ;---------------- - ; susp->terminate_cnt = check_terminate_cnt(round(((TIME-EXPR) - t0) * sr)); + ; susp->terminate_cnt = check_terminate_cnt(ROUNDBIG(((TIME-EXPR) - t0) * sr)); ;---------------- (format stream - " susp->terminate_cnt = check_terminate_cnt(round(((~A) - t0) * sr));~%" + " susp->terminate_cnt = check_terminate_cnt(ROUNDBIG(((~A) - t0) * sr));~%" time-expr))) ((eq (car terminate) 'AFTER) (let ((dur-expr (cadr terminate))) ;---------------- - ; susp->terminate_cnt = check_terminate_cnt(round((DUR-EXPR) * sr)); + ; susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((DUR-EXPR) * sr)); ;---------------- (format stream - " susp->terminate_cnt = check_terminate_cnt(round((~A) * sr));~%" + " susp->terminate_cnt = check_terminate_cnt(ROUNDBIG((~A) * sr));~%" dur-expr))) (t ;---------------- diff --git a/lib-src/libnyquist/nyquist/tran/writetoss.lsp b/lib-src/libnyquist/nyquist/tran/writetoss.lsp index dfcb66e8c..67ebe278f 100644 --- a/lib-src/libnyquist/nyquist/tran/writetoss.lsp +++ b/lib-src/libnyquist/nyquist/tran/writetoss.lsp @@ -47,7 +47,7 @@ ;; for each sound argument: ;; ;; /* fetch samples from NAME up to final_time for this block of zeros */ - ;; while ((round((final_time - susp->NAME->t0) * susp->NAME->sr)) >= + ;; while ((ROUNDBIG((final_time - susp->NAME->t0) * susp->NAME->sr)) >= ;; susp->NAME->current) ;; susp_get_samples(NAME, NAME_ptr, NAME_cnt); ;;------------------------------ @@ -56,7 +56,7 @@ " /* fetch samples from ~A up to final_time for this block of zeros */~%" name) (format stream - " while ((round((final_time - susp->~A->t0) * susp->~A->sr)) >=~%" + " while ((ROUNDBIG((final_time - susp->~A->t0) * susp->~A->sr)) >=~%" name name) (format stream "\t susp->~A->current)~%" name) (format stream "\tsusp_get_samples(~A, ~A_ptr, ~A_cnt);~%" @@ -73,13 +73,13 @@ ;;---------------- ;; for each sound argument: ;; - ;; n = round((final_time - susp->NAME->t0) * susp->NAME->sr - + ;; n = ROUNDBIG((final_time - susp->NAME->t0) * susp->NAME->sr - ;; (susp->NAME->current - susp->NAME_cnt)); ;; susp->NAME_ptr += n; ;; susp_took(NAME_cnt, n); ;;---------------- (dolist (name sound-names) - (format stream " n = round((final_time - susp->~A->t0) * susp->~A->sr -~%" + (format stream " n = ROUNDBIG((final_time - susp->~A->t0) * susp->~A->sr -~%" name name) (format stream " (susp->~A->current - susp->~A_cnt));~%" name name) diff --git a/lib-src/libnyquist/nyquist/xlisp/extern.c b/lib-src/libnyquist/nyquist/xlisp/extern.c index 20d2aaae0..a9a2c8b6f 100644 --- a/lib-src/libnyquist/nyquist/xlisp/extern.c +++ b/lib-src/libnyquist/nyquist/xlisp/extern.c @@ -57,7 +57,7 @@ struct xtype_desc_struct desc_table[NTYPES]; xtype_desc create_desc( char *type_name, /* the type string name */ void (*fm)(void*), /* method to free instances of the type */ - void (*pm)(void*, void*), /* method to print instances of the type */ + void (*pm)(LVAL, void*), /* method to print instances of the type */ void (*sm)(FILE*, void*), /* method to save instances of the type */ unsigned char * (*rm)(FILE*), /* method to restore instances of the type */ void (*mm)(void*)) /* method to mark instances of the type for GC */ diff --git a/lib-src/libnyquist/nyquist/xlisp/extern.h b/lib-src/libnyquist/nyquist/xlisp/extern.h index 42fe8366e..eb9312236 100644 --- a/lib-src/libnyquist/nyquist/xlisp/extern.h +++ b/lib-src/libnyquist/nyquist/xlisp/extern.h @@ -1,6 +1,8 @@ -xtype_desc create_desc(char *type_name, void (*fm)(void*), void (*pm)(void*, void*), - void (*sm)(FILE*, void*), unsigned char * (*rm)(FILE*), void (*mm)(void*)); +xtype_desc create_desc(char *type_name, void (*fm)(void*), + void (*pm)(LVAL, void*), + void (*sm)(FILE*, void*), unsigned char * (*rm)(FILE*), + void (*mm)(void*)); int exttypep(LVAL x, LVAL type_sym); diff --git a/lib-src/libnyquist/nyquist/xlisp/path.c b/lib-src/libnyquist/nyquist/xlisp/path.c index 5497906ca..0b69a3f9e 100644 --- a/lib-src/libnyquist/nyquist/xlisp/path.c +++ b/lib-src/libnyquist/nyquist/xlisp/path.c @@ -19,6 +19,9 @@ * * 9-jan-08 RBD * Added find-in-xlisp-path as XLISP primitive + * + * 22-jun-16 RBD & Paul Licameli + * Added cleanup code to free allocated memory */ #include @@ -26,10 +29,42 @@ #include "switches.h" #include "xlisp.h" +// boolean flag to support one-shot atexit() registration: +static unsigned char registered_path_cleanup = 0; + +// save a copy of xlisp search path for return_xlisp_path(): static char *g_xlisp_path = NULL; +// return value for find_in_xlisp_path(): +static char *g_xlptemp = NULL; + + +// clean up any allocated memory for this module (path.c) +static void path_cleanup(void) +{ + if (g_xlisp_path) { + free(g_xlisp_path); + g_xlisp_path = NULL; + } + + if (g_xlptemp) { + free(g_xlptemp); + g_xlptemp = NULL; + } +} + + +// set_xlisp_path - set the search path +// the caller owns the parameter string, a copy is made +// and freed at program exit void set_xlisp_path(const char *p) { + // one-time register to free any allocated memory at cleanup + if (!registered_path_cleanup) { + atexit(path_cleanup); + registered_path_cleanup = 1; + } + if (g_xlisp_path) { free(g_xlisp_path); g_xlisp_path = NULL; @@ -37,10 +72,13 @@ void set_xlisp_path(const char *p) if (p) { g_xlisp_path = malloc(strlen(p)+1); + // if malloc fails, program will crash here -- maybe that's better + // than setting g_xlisp_path to NULL, masking a critical problem strcpy(g_xlisp_path, p); } } + #ifdef UNIX const char *unix_return_xlisp_path() { @@ -67,7 +105,7 @@ const char *unix_return_xlisp_path() const char *windows_return_xlisp_path() { #define paths_max 1024 - static char paths[paths_max]; + char paths[paths_max]; get_xlisp_path(paths, paths_max); /* make sure we got paths, and the list is not empty */ if (!paths[0]) { @@ -77,8 +115,12 @@ const char *windows_return_xlisp_path() "empty string if you really want no search path."); errputstr(paths); } - - return paths; + set_xlisp_path(paths); + /* for debugging: + errputstr("windows_return_xlisp_path() returns "); + errputstr(paths); + errputstr("\n"); */ + return g_xlisp_path; } #endif @@ -87,7 +129,7 @@ const char *windows_return_xlisp_path() const char *mac_return_xlisp_path() { #define paths_max 1024 - static char paths[paths_max]; + char paths[paths_max]; int prefs_found = false; get_xlisp_path(paths, paths_max, &prefs_found); if (!paths[0]) { @@ -107,10 +149,11 @@ const char *mac_return_xlisp_path() } errputstr(paths); } - - return paths; + set_xlisp_path(paths); + return g_xlisp_path; } + const char *get_user_id() { // not implemented for MACINTOSH (OS 9), just use "nyquist" @@ -118,11 +161,14 @@ const char *get_user_id() } #endif + const char *return_xlisp_path() { if (g_xlisp_path) return g_xlisp_path; + // if g_xlisp_path has not been set, use one of the following + // to get the value, cache it in g_xlisp_path, and return it #ifdef WINDOWS return windows_return_xlisp_path(); #endif @@ -135,8 +181,6 @@ const char *return_xlisp_path() } -char *g_xlptemp = NULL; - // find_in_xlisp_path -- find fname or fname.lsp by searching XLISP_PATH // // NOTE: this module owns the string. The string is valid @@ -148,6 +192,12 @@ const char *find_in_xlisp_path(const char *fname) if (!paths) return NULL; + // one-time register to free any allocated memory at cleanup + if (!registered_path_cleanup) { + atexit(path_cleanup); + registered_path_cleanup = 1; + } + while (paths && *paths) { FILE *fp; const char *start; diff --git a/lib-src/libnyquist/nyquist/xlisp/security.c b/lib-src/libnyquist/nyquist/xlisp/security.c index d9715679c..3e7cc4262 100644 --- a/lib-src/libnyquist/nyquist/xlisp/security.c +++ b/lib-src/libnyquist/nyquist/xlisp/security.c @@ -4,9 +4,12 @@ */ #include -#ifndef WIN32 +#if defined(UNIX) || defined(__APPLE__) #include #endif +#ifdef WIN32 +#include +#endif #include #include diff --git a/lib-src/libnyquist/nyquist/xlisp/xldbug.c b/lib-src/libnyquist/nyquist/xlisp/xldbug.c index 9063d1f88..920c0c237 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xldbug.c +++ b/lib-src/libnyquist/nyquist/xlisp/xldbug.c @@ -85,7 +85,7 @@ void xlcerror(const char *cmsg, const char *emsg, LVAL arg) void xlerrprint(const char *hdr, const char *cmsg, const char *emsg, LVAL arg) { /* print the error message */ - sprintf(buf,"%s: %s",hdr,emsg); + snprintf(buf, STRMAX, "%s: %s", hdr, emsg); errputstr(buf); /* print the argument */ @@ -100,7 +100,7 @@ void xlerrprint(const char *hdr, const char *cmsg, const char *emsg, LVAL arg) /* print the continuation message */ if (cmsg) { - sprintf(buf,"if continued: %s\n",cmsg); + snprintf(buf, STRMAX, "if continued: %s\n", cmsg); errputstr(buf); } } diff --git a/lib-src/libnyquist/nyquist/xlisp/xldmem.c b/lib-src/libnyquist/nyquist/xlisp/xldmem.c index 4656b9aa0..ad0fb3958 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xldmem.c +++ b/lib-src/libnyquist/nyquist/xlisp/xldmem.c @@ -15,6 +15,7 @@ #include "stdlib.h" #include "string.h" +#include "limits.h" #include "xlisp.h" #ifdef WIN32 @@ -51,6 +52,8 @@ FORWARD LOCAL int addseg(void); FORWARD void mark(LVAL ptr); FORWARD LOCAL void sweep(void); +extern void freeimage(void); + #ifdef DEBUG_GC static long dbg_gc_n = 0; /* counts save operations */ long dbg_gc_count = 0; /* says when to stop */ @@ -241,6 +244,9 @@ LVAL newvector(int size) xlsave1(vect); vect = newnode(VECTOR); vect->n_vsize = 0; + if (size < 0) xlfail("negative vector size requested"); + if (size > INT_MAX / sizeof(LVAL)) + xlfail("too large vector size requested"); if ((bsize = size * sizeof(LVAL))) { if ((vect->n_vdata = (LVAL *)calloc(1,bsize)) == NULL) { findmem(); @@ -705,6 +711,9 @@ LVAL xrestore(void) } #endif +static unsigned char registered_xlmshutdown = 0; +static void xlmshutdown(void); + /* xlminit - initialize the dynamic memory module */ void xlminit(void) { @@ -758,5 +767,26 @@ void xlminit(void) xlargstktop = xlargstkbase + ADEPTH; xlfp = xlsp = xlargstkbase; *xlsp++ = NIL; + + /* Guarantee graceful cleanup of memory */ + if (!registered_xlmshutdown) { + atexit(xlmshutdown); + registered_xlmshutdown = 1; + } } +static void xlmshutdown(void) +{ + /* This function deallocates all memory used by xlisp. Should it + become non-static, allowing the client to shut down and init + again for a "hard" restart? */ + + /* Free all lisp objects, and free the free-store */ + freeimage(); + + /* Free the stacks */ + free(xlstkbase); + xlstkbase = NULL; + free(xlargstkbase); + xlargstkbase = NULL; +} diff --git a/lib-src/libnyquist/nyquist/xlisp/xldmem.h b/lib-src/libnyquist/nyquist/xlisp/xldmem.h index 14b0bd651..60cbcaa91 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xldmem.h +++ b/lib-src/libnyquist/nyquist/xlisp/xldmem.h @@ -152,12 +152,14 @@ #define n_desc n_info.n_xextern.xe_desc #define n_inst n_info.n_xextern.xe_inst +struct node; + /* xtype_desc structure */ typedef struct xtype_desc_struct { char *type_name; struct node *type_symbol; void (*free_meth)(void*); - void (*print_meth)(void*, void*); + void (*print_meth)(struct node *, void*); void (*save_meth)(FILE*, void*); unsigned char * (*restore_meth)(FILE*); void (*mark_meth)(void*); @@ -211,9 +213,3 @@ typedef struct segment { struct node sg_nodes[1]; } SEGMENT; -/* initialize a type descriptor */ -extern xtype_desc create_desc(char *type_name, void (*fm)(void*), - void (*pm)(void*, void*), - void (*sm)(FILE*, void*), - unsigned char * (*rm)(FILE*), - void (*mm)(void*)); diff --git a/lib-src/libnyquist/nyquist/xlisp/xleval.c b/lib-src/libnyquist/nyquist/xlisp/xleval.c index f60560f49..5e367bd70 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xleval.c +++ b/lib-src/libnyquist/nyquist/xlisp/xleval.c @@ -45,6 +45,7 @@ LVAL xleval(LVAL expr) /* check for control codes */ if (--xlsample <= 0) { xlsample = SAMPLE; + run_time++; oscheck(); } @@ -818,7 +819,7 @@ LOCAL void doenter(LVAL sym, int argc, LVAL *argv) ++xltrcindent; /* display the function call */ - sprintf(buf,"Entering: %s, Argument list: (",getstring(getpname(sym))); + snprintf(buf, STRMAX, "Entering: %s, Argument list: (", getstring(getpname(sym))); trcputstr(buf); while (--argc >= 0) { trcprin1(*argv++); @@ -839,7 +840,7 @@ LOCAL void doexit(LVAL sym, LVAL val) trcputstr(" "); /* display the function value */ - sprintf(buf,"Exiting: %s, Value: ",getstring(getpname(sym))); + snprintf(buf, STRMAX, "Exiting: %s, Value: ", getstring(getpname(sym))); trcputstr(buf); trcprin1(val); trcputstr("\n"); diff --git a/lib-src/libnyquist/nyquist/xlisp/xlfio.c b/lib-src/libnyquist/nyquist/xlisp/xlfio.c index 086fa3c4b..a98fa137d 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlfio.c +++ b/lib-src/libnyquist/nyquist/xlisp/xlfio.c @@ -242,7 +242,8 @@ LVAL xrdint(void) xllastarg(); for (i = 0; i < n; i++) { int ch = xlgetc(fptr); - if (ch == EOF) return NIL; + if (ch == EOF) + return NIL; b[index] = ch; index += incr; } diff --git a/lib-src/libnyquist/nyquist/xlisp/xlftab.c b/lib-src/libnyquist/nyquist/xlisp/xlftab.c index 4b40961b1..9c7a1e12e 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlftab.c +++ b/lib-src/libnyquist/nyquist/xlisp/xlftab.c @@ -12,7 +12,6 @@ HISTORY */ -#include /* for memcpy */ #include "switches.h" #include "xlisp.h" #ifndef NO_PROTOTYPES_IN_XLISP_H @@ -115,7 +114,7 @@ LVAL xstoprecordio(void); #endif /* the function table */ -FUNDEF init_funtab[] = { +FUNDEF funtab[] = { /* read macro functions */ { NULL, S, rmhash }, /* 0 */ @@ -488,6 +487,7 @@ FUNDEF init_funtab[] = { { "FIND-IN-XLISP-PATH", S, xfind_in_xlisp_path }, /* 307 */ { "GET-ENV", S, xget_env }, /* 308 */ { "GET-RUN-TIME", S, xgetruntime }, /* 309 */ +{ "RANDOM-SEED", S, xsrand }, /* 310 */ #ifdef MACINTOSH #include "macptrs.h" @@ -499,32 +499,7 @@ FUNDEF init_funtab[] = { {0,0,0} /* end of table marker */ -}; - -FUNDEF *funtab = init_funtab; -static size_t szfuntab = sizeof(init_funtab) / sizeof(*init_funtab); - -int xlbindfunctions(const FUNDEF *functions, size_t nfunctions) -{ - /* This is written very generally, imposing no fixed upper limit on the - growth of the table. But perhaps a lightweight alternative with such a - limit could be conditionally compiled. - */ - - /* malloc, not realloc, to leave old table unchanged in case of failure */ - FUNDEF *newfuntab = malloc((szfuntab + nfunctions) * sizeof(FUNDEF)); - if (!newfuntab) - return FALSE; - memcpy(newfuntab, funtab, (szfuntab - 1) * sizeof(FUNDEF)); - memcpy(newfuntab + szfuntab - 1, functions, nfunctions * sizeof(FUNDEF)); - FUNDEF sentinel = { 0, 0, 0 }; - newfuntab[szfuntab + nfunctions - 1] = sentinel; - funtab = newfuntab; - szfuntab += nfunctions; - return TRUE; - - /* To do: deallocate funtab when XLisp runtime shuts down */ -} +}; /* xnotimp does not return anything on purpose, so disable * "no return value" warning diff --git a/lib-src/libnyquist/nyquist/xlisp/xlimage.c b/lib-src/libnyquist/nyquist/xlisp/xlimage.c index a399a2f33..a4e793323 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlimage.c +++ b/lib-src/libnyquist/nyquist/xlisp/xlimage.c @@ -7,13 +7,62 @@ #include "string.h" #include "xlisp.h" +extern struct segment *segs, *lastseg; + +void freeimage(void); + +/* freeimage - free the current memory image */ +void freeimage(void) +{ + SEGMENT *seg,*next; + FILE *fp; + LVAL p; + int n; + + /* free the data portion of SYMBOL/VECTOR/OBJECT/STRING nodes */ + for (seg = segs; seg != NULL; seg = next) { + p = &seg->sg_nodes[0]; + for (n = seg->sg_size; --n >= 0; ++p) + switch (ntype(p)) { + case SYMBOL: + case OBJECT: + case VECTOR: + case CLOSURE: + if (p->n_vsize) + free(p->n_vdata); + break; + case STRING: + if (getslength(p)) + free((void *) getstring(p)); + break; + case STREAM: + if ((fp = getfile(p)) && (fp != stdin && fp != stdout && fp != STDERR)) + osclose(getfile(p)); + break; + case EXTERN: + /* note: currently, there are 2 EXTERN types: SEQ and SOUND */ + if (getdesc(p)) { + (*(getdesc(p)->free_meth))(getinst(p)); + } + break; + default: /* note: SUBR, FSUBR, CONS, SYMBOL, FIXNUM, FLONUM, */ + break; /* CHAR, USTREAM are ignored here because they do not */ + /* point outside of the segments that are being freed */ + } + next = seg->sg_next; + free((void *) seg); + } + segs = lastseg = NULL; +} + + #ifdef SAVERESTORE /* external variables */ extern LVAL obarray,s_gchook,s_gcflag; extern long nnodes,nfree; extern int anodes,nsegs,gccalls; -extern struct segment *segs,*lastseg,*fixseg,*charseg; +extern struct segment *fixseg,*charseg; extern XLCONTEXT *xlcontext; extern LVAL fnodes; extern struct xtype_desc_struct desc_table[NTYPES]; @@ -29,7 +78,6 @@ LOCAL LVAL cviptr(OFFTYPE o); LOCAL void writeptr(OFFTYPE off); LOCAL void setoffset(void); LOCAL void writenode(LVAL node); -LOCAL void freeimage(void); LOCAL void readnode(int type, LVAL node); @@ -134,7 +182,7 @@ int xlisave(const char *fname) /* xlirestore - restore a saved memory image */ int xlirestore(const char *fname) { - extern FUNDEF *funtab; + extern FUNDEF funtab[]; char fullname[STRMAX+1]; unsigned char *cp; int n,i,max,type; @@ -260,40 +308,6 @@ done: return (TRUE); } -/* freeimage - free the current memory image */ -LOCAL void freeimage(void) -{ - SEGMENT *seg,*next; - FILE *fp; - LVAL p; - int n; - - /* free the data portion of SYMBOL/VECTOR/OBJECT/STRING nodes */ - for (seg = segs; seg != NULL; seg = next) { - p = &seg->sg_nodes[0]; - for (n = seg->sg_size; --n >= 0; ++p) - switch (ntype(p)) { - case SYMBOL: - case OBJECT: - case VECTOR: - case CLOSURE: - if (p->n_vsize) - free(p->n_vdata); - break; - case STRING: - if (getslength(p)) - free((void *) getstring(p)); - break; - case STREAM: - if ((fp = getfile(p)) && (fp != stdin && fp != stdout && fp != STDERR)) - osclose(getfile(p)); - break; - } - next = seg->sg_next; - free((void *) seg); - } -} - /* setoffset - output a positioning command if nodes have been skipped */ LOCAL void setoffset(void) { diff --git a/lib-src/libnyquist/nyquist/xlisp/xlinit.c b/lib-src/libnyquist/nyquist/xlisp/xlinit.c index 889f6ef78..eea279989 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlinit.c +++ b/lib-src/libnyquist/nyquist/xlisp/xlinit.c @@ -41,7 +41,7 @@ extern LVAL a_fixnum,a_flonum,a_string,a_stream,a_object; extern LVAL a_vector,a_closure,a_char,a_ustream,a_extern; extern LVAL s_gcflag,s_gchook; extern LVAL s_search_path; -extern FUNDEF *funtab; +extern FUNDEF funtab[]; /* forward declarations */ FORWARD LOCAL void initwks(); diff --git a/lib-src/libnyquist/nyquist/xlisp/xlisp.c b/lib-src/libnyquist/nyquist/xlisp/xlisp.c index cae255fcd..856a74603 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlisp.c +++ b/lib-src/libnyquist/nyquist/xlisp/xlisp.c @@ -85,6 +85,11 @@ long xlrand (long range) { #endif } +long xlsrand(long seed) { + srand(seed); + return seed; +} + /* xlrealrand - return random number in [0, 1] */ double xlrealrand() { /* always use the random generator from the C library, @@ -121,8 +126,8 @@ void xlisp_main_init(int argc, char *argv[]) secure_read_path = &argv[i][2]; break; case 'w': - case 'W': - safe_write_path = &argv[i][2]; + case 'W': + safe_write_path = &argv[i][2]; break; case 'l': case 'L': @@ -159,7 +164,7 @@ void xlisp_main_init(int argc, char *argv[]) /* open the transcript file */ if (transcript && (tfp = osaopen(transcript,"w")) == NULL) { - sprintf(buf,"error: can't open transcript file: %s",transcript); + snprintf(buf, STRMAX, "error: can't open transcript file: %s", transcript); stdputstr(buf); } diff --git a/lib-src/libnyquist/nyquist/xlisp/xlisp.h b/lib-src/libnyquist/nyquist/xlisp/xlisp.h index c92e5b398..d83deb7d7 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlisp.h +++ b/lib-src/libnyquist/nyquist/xlisp/xlisp.h @@ -13,13 +13,6 @@ HISTORY /* system specific definitions */ -#ifndef __XLISP__ -#define __XLISP__ - -#ifdef __cplusplus -extern "C" { -#endif - #include /* needed for getenv(); note that this was a problem for PMAX implementation, but I assume PMAX is obsolete now. - RBD 16apr04 */ @@ -45,9 +38,10 @@ extern "C" { #define NNODES 2000 #define AFMT "%lx" #define OFFTYPE long -#define SAVERESTORE +/* #define SAVERESTORE */ #define XL_LITTLE_ENDIAN #define _longjmp longjmp +#define _setjmp setjmp #endif /* for the Turbo C compiler - MS-DOS, large model */ @@ -55,7 +49,7 @@ extern "C" { #define NNODES 2000 #define AFMT "%lx" #define OFFTYPE long -#define SAVERESTORE +/* #define SAVERESTORE */ #define XL_LITTLE_ENDIAN #endif @@ -67,7 +61,7 @@ extern "C" { #define CVPTR(x) ptrtoabs(x) #define NIL (void *)0 extern long ptrtoabs(); -#define SAVERESTORE +/* #define SAVERESTORE */ #define XL_LITTLE_ENDIAN #endif @@ -166,7 +160,7 @@ extern long ptrtoabs(); #define AFMT "%lx" #define OFFTYPE long #define NIL (void *)0 -#define SAVERESTORE +/* #define SAVERESTORE */ #include /* #if __BYTE_ORDER == __LITTLE_ENDIAN */ #if defined(__LITTLE_ENDIAN__) @@ -198,7 +192,7 @@ extern long ptrtoabs(); #define LOCAL static #endif #ifndef AFMT -#define AFMT "%x" +#define AFMT "%lx" #endif #ifndef FIXTYPE #define FIXTYPE long @@ -373,7 +367,7 @@ void dbg_gc_xlsave(LVAL *n); /* function definition structure */ typedef struct { - const char *fd_name; /* function name */ + char *fd_name; /* function name */ int fd_type; /* function type */ LVAL (*fd_subr)(void); /* function entry point */ } FUNDEF; @@ -678,13 +672,6 @@ void xlinit(void); void xlsymbols(void); -/* xlftab.c */ -/* returns true on success, - false if table limits would be exceeded and the table remains unchanged - Call this, any number of times, before calling xlisp_main_init - */ -int xlbindfunctions(const FUNDEF *functions, size_t nfunctions); - /* xlio.c */ int xlgetc(LVAL fptr); @@ -705,6 +692,7 @@ void trcputstr(const char *str); /* xlisp.c */ +long xlsrand(long seed); long xlrand(long range); double xlrealrand(void); void xlrdsave(LVAL expr); @@ -823,6 +811,7 @@ LVAL xsqrt(void); LVAL xfix(void); LVAL xfloat(void); LVAL xrand(void); +LVAL xsrand(void); LVAL xminusp(void); LVAL xzerop(void); LVAL xplusp(void); @@ -1038,9 +1027,4 @@ void set_xlisp_path(const char *p); void localinit(void); void localsymbols(void); void print_local_gc_info(void); - -#ifdef __cplusplus -} -#endif - -#endif +void local_toplevel(void); diff --git a/lib-src/libnyquist/nyquist/xlisp/xljump.c b/lib-src/libnyquist/nyquist/xlisp/xljump.c index 817305f40..24cc04469 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xljump.c +++ b/lib-src/libnyquist/nyquist/xlisp/xljump.c @@ -100,6 +100,7 @@ void xlsignal(const char *emsg, LVAL arg) void xltoplevel(void) { close_loadingfiles(); + local_toplevel(); stdputstr("[ back to top level ]\n"); findandjump(CF_TOPLEVEL,"no top level"); } diff --git a/lib-src/libnyquist/nyquist/xlisp/xlmath.c b/lib-src/libnyquist/nyquist/xlisp/xlmath.c index 72cf1c195..410bb1143 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlmath.c +++ b/lib-src/libnyquist/nyquist/xlisp/xlmath.c @@ -248,6 +248,7 @@ LVAL xsqrt(void) { return (unary('R')); } /* sqrt */ LVAL xfix(void) { return (unary('I')); } /* truncate */ LVAL xfloat(void) { return (unary('F')); } /* float */ LVAL xrand(void) { return (unary('?')); } /* random */ +LVAL xsrand(void) { return (unary('@')); } /* random seed */ /* unary - handle unary operations */ LOCAL LVAL unary(int fcn) @@ -271,6 +272,7 @@ LOCAL LVAL unary(int fcn) case 'I': break; case 'F': return (cvflonum((FLOTYPE)ival)); case '?': ival = (FIXTYPE)xlrand((int)ival); break; + case '@': ival = (FIXTYPE)xlsrand((int)ival); break; default: badiop(); } return (cvfixnum(ival)); diff --git a/lib-src/libnyquist/nyquist/xlisp/xlobj.c b/lib-src/libnyquist/nyquist/xlisp/xlobj.c index 6713849f3..e5164107f 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlobj.c +++ b/lib-src/libnyquist/nyquist/xlisp/xlobj.c @@ -88,7 +88,7 @@ void xladdivar(LVAL cls, const char *var) /* xladdmsg - add a message to a class */ void xladdmsg(LVAL cls, const char *msg, int offset) { - extern FUNDEF *funtab; + extern FUNDEF funtab[]; LVAL mptr; /* enter the message selector */ diff --git a/lib-src/libnyquist/nyquist/xlisp/xlprin.c b/lib-src/libnyquist/nyquist/xlisp/xlprin.c index 128a7a5ff..181d09164 100644 --- a/lib-src/libnyquist/nyquist/xlisp/xlprin.c +++ b/lib-src/libnyquist/nyquist/xlisp/xlprin.c @@ -21,7 +21,7 @@ /* external variables */ extern LVAL s_printcase,k_downcase,k_const,k_nmacro; extern LVAL s_ifmt,s_ffmt; -extern FUNDEF *funtab; +extern FUNDEF funtab[]; extern char buf[]; LOCAL void putsymbol(LVAL fptr, char *str, int escflag); @@ -209,7 +209,7 @@ LOCAL void putqstring(LVAL fptr, LVAL str) for (p = getstring(str); (ch = *p) != '\0'; ++p) /* check for a control character */ - if (ch < 040 || ch == '\\' || ch > 0176) { + if (ch < 040 || ch == '\\' || ch > 0176 || ch == '"') { xlputc(fptr,'\\'); switch (ch) { case '\011': @@ -227,6 +227,9 @@ LOCAL void putqstring(LVAL fptr, LVAL str) case '\\': xlputc(fptr,'\\'); break; + case '"': + xlputc(fptr, '"'); + break; default: putoct(fptr,ch); break; @@ -244,7 +247,7 @@ LOCAL void putqstring(LVAL fptr, LVAL str) /* putatm - output an atom */ void putatm(LVAL fptr, const char *tag, LVAL val) { - sprintf(buf,"#<%s: #",tag); xlputstr(fptr,buf); + snprintf(buf, STRMAX, "#<%s: #", tag); xlputstr(fptr,buf); sprintf(buf,AFMT,(long unsigned int)val); xlputstr(fptr,buf); xlputc(fptr,'>'); } @@ -252,7 +255,7 @@ void putatm(LVAL fptr, const char *tag, LVAL val) /* putsubr - output a subr/fsubr */ LOCAL void putsubr(LVAL fptr, const char *tag, LVAL val) { - sprintf(buf,"#<%s-%s: #",tag,funtab[getoffset(val)].fd_name); + snprintf(buf, STRMAX, "#<%s-%s: #", tag, funtab[getoffset(val)].fd_name); xlputstr(fptr,buf); sprintf(buf,AFMT,(long unsigned int)val); xlputstr(fptr,buf); xlputc(fptr,'>'); @@ -263,7 +266,7 @@ LOCAL void putclosure(LVAL fptr, LVAL val) { LVAL name; if ((name = getname(val))) - sprintf(buf,"#