anchor.diff:  ;; #endif
   
   ;; #endif
  -
  -
  -;; /* Change log.
  -;;  *
  -;;  * 1-Sep:      mus_type.
  -;;  * 20-Aug:     changed type of mus_locsig to void, added mus_locsig_function_reset.
  -;;  *             removed function-as-output-location from locsig et al.
  -;;  * 14-Jul-11:  removed pthread stuff.
  -;;  * --------
  -;;  * 7-Mar-10:   protect in-any and out-any from sample numbers less than 0.
  -;;  * --------
  -;;  * 14-Oct:     sine-summation, sum-of-sines, sum-of-cosines removed.
  -;;  * 28-Aug:     changed some fft-related sizes from int to mus_long_t.
  -;;  * 17-Aug:     mus_frame|mixer_copy|fill.
  -;;  * 27-Jul:     mus_float_t for Float, and mus_long_t for off_t.
  -;;  * 15-Jun:     mus_rectangular_to_magnitudes (polar, but ignore phases).
  -;;  * 11-Jun:     mus_cepstrum.
  -;;  * 11-May:     MUS_ENV_LINEAR and friends, also mus_env_linear|exponential.
  -;;  *             mus_frame_to_frame_mono|stereo.
  -;;  * 12-Mar:     sinc, papoulis and dpss (slepian windows).
  -;;  * 1-Jan-09:   added MUS_EXPORT.
  -;;  * --------
  -;;  * 11-Dec:     deprecated the sine-summation, sum-of-cosines, and sum-of-sines generators.
  -;;  * 30-Oct:     mus_sample_to_file_add.
  -;;  *             mus_describe once again allocates a fresh output string.
  -;;  *             finally removed sine-bank.
  -;;  * 9-Oct:      various thread-related internal changes.
  -;;  * 14-Jul:     mus_data_format_zero.
  -;;  * 12-Jul:     mus_interp_type_p and mus_fft_window_p for C++'s benefit.
  -;;  * 1-July:     mus-safety and various ints changed to mus_long_t.
  -;;  * 20-Jun:     support for pthreads.
  -;;  * 16-Jun:     changed init_mus_module to mus_initialize.
  -;;  * 30-May:     changed polyshape to use cos and added cheby_choice arg to mus_make_polyshape.
  -;;  * 27-May:     mus_waveshape retired -- generators.scm has a wrapper for it.
  -;;  *             clm_free, clm_realloc etc for rt work.
  -;;  *             mus_chebyshev_tu_sum.
  -;;  * 25-May:     mus_polywave algorithm changed.
  -;;  * 17-May:     mus_normalize_partials.
  -;;  * 12-Apr:     added choice arg to mus_make_polywave.
  -;;  * 8-Apr:      polywave uses sine-bank if highest harmonic out of Chebyshev range.
  -;;  * 1-Mar:      mus_set_name.
  -;;  * 26-Feb:     removed mus_cosines (use mus_length)
  -;;  * 24-Feb:     removed mus_make_env_with_start, added mus_make_env_with_length
  -;;  * 20-Feb:     clm 4:
  -;;  *             polywave for polyshape and waveshape.  
  -;;  *             mus_formant_with_frequency. 
  -;;  *             firmant generator.
  -;;  *             removed mus_formant_radius and mus_set_formant_radius.
  -;;  *             removed "gain" arg from mus_make_formant.
  -;;  *             reversed the order of the arguments to mus_make_formant.
  -;;  *             fixed long-standing bug in gain calculation in mus_formant.
  -;;  *             mus_env_any for arbitrary connecting functions.
  -;;  * 15-Feb:     nrxysin and nrxycos for sine-summation.
  -;;  * 12-Feb:     nsin for sum_of_sines, ncos for sum_of_cosines.
  -;;  * 4-Feb:      clm_default_frequency (clm2xen) and *clm-default-frequency* (ws.scm).
  -;;  * 7-Jan-08:   :dur replaced by :length in make-env.
  -;;  * --------
  -;;  * 19-Oct:     all *_0 *_1 *_2 names now use _fm|_pm|_unmodulated|_no_input.
  -;;  * 17-Oct:     replace some method macros with functions (def-clm-struct local methods need true names).
  -;;  * 15-Oct:     mus_oscil_1 -> _fm, _2->_pm.
  -;;  *             mus_phase_vocoder_outctr accessors changed to use mus_location.
  -;;  * 11-Oct:     changed default srate to 44100.
  -;;  * 5-Oct:      mus_oscil_2.
  -;;  * 6-Sep:      changed asymmetric-fm to use cos(sin) and added amplitude normalization.
  -;;  * 6-Aug:      mus_autocorrelate, mus_correlate.
  -;;  * 3-Aug:      blackman5..10 and Rife-Vincent (RV2..4 fft), mlt-sine windows.
  -;;  * 16-July:    removed start arg from mus_make_env (see mus_make_env_with_start).
  -;;  * 5-July:     changed some mus_float_ts to doubles in env funcs.
  -;;  *               exp envs now use repeated multiplies rather than direct exp call.
  -;;  * 19-June:    mus-increment on gens with a notion of frequency (phase increment); 
  -;;  *               to make room for this, asymmetric-fm ratio and sine-summation b moved to mus-offset.
  -;;  * 22-Feb:     mus_big_fft and mus_spectrum_t.
  -;;  * 21-Feb:     mus_fft_window_name.
  -;;  * 14-Feb-07:  three more fft window choices.
  -;;  * --------
  -;;  * 27-Nov:     move-sound array access parallel to locsig.
  -;;  * 22-Nov:     had to add non-backwards-compatible reverb chans arg to mus_make_locsig.
  -;;  * 21-Nov:     mus_float_equal_fudge_factor, mus_arrays_are_equal.
  -;;  * 30-July:    renamed average to moving_average.
  -;;  * 28-July:    renamed make_ppolar and make_zpolar to make_two_pole|zero_from_radius_and_frequency.
  -;;  *             added mus_scaler and mus_frequency methods for two_pole and two_zero.
  -;;  * 21-July:    removed mus_wrapper field -- old way can't work since we need the original XEN object.
  -;;  * 3-July:     mus_move_sound (dlocsig) generator.
  -;;  *             changed return type of mus_locsig to float.
  -;;  * 28-June:    mus_filtered_comb generator.
  -;;  * 8-May:      mus_apply now takes 3 args: gen, two doubles (rather than bug-prone varargs).
  -;;  * 1-Mar-06:   granulate now has a local random number seed (settable via the mus-location method).
  -;;  * --------
  -;;  * 20-Dec:     samaraki and ultraspherical windows.
  -;;  *               this required a non-backwards-compatible additional argument in mus_make_fft_window_with_window.
  -;;  * 1-Nov:      mus_filter_set_x|ycoeffs, mus_filter_set_order (needed by Snd).
  -;;  * 1-May:      mus-scaler|feedback ok with delay and average.
  -;;  * 18-Apr:     mus_set_environ.
  -;;  * 11-Apr:     mus_mixer|frame_offset, mus_frame_scale (for higher level generic functions).
  -;;  * 23-Mar:     frame_to_frame arg interpretation changed.
  -;;  * 21-Mar:     mus_make_readin|file_to_sample|file_to_frame_with_buffer_size.
  -;;  * 16-Mar:     polyshape generator (waveshaper as polynomial + oscil)
  -;;  *             mus_chebyshev_first|second_kind.
  -;;  *             mus_partials_to_waveshape no longer normalizes the partials.
  -;;  * 18-Feb:     mus_interpolate.
  -;;  * 14-Feb:     deprecated mus_restart_env and mus_clear_filter_state.
  -;;  * 7-Feb-05:   mus_reset method, replaces mus_restart_env and mus_clear_filter_state.
  -;;  * --------
  -;;  * 20-Dec:     changed "jitter" handling if hop < .05 in granulate.
  -;;  * 15-Dec:     mus_generator? for type checks (clm2xen).
  -;;  * 11-Sep:     removed buffer generator.
  -;;  * 6-Sep:      removed mus_oscil_bank, mus_bank.
  -;;  * 24-Aug:     removed mus_inspect method -- overlaps mus_describe and is useless given gdb capabilities.
  -;;  * 27-July:    mus_granulate_with_editor and mus_phase_vocoder_with_editors.
  -;;  * 21-July:    edit-func as run-time arg to granulate (for CL/clm compatibility)
  -;;  * 19-July:    clm 3:
  -;;  *             deprecated mus_ina|b, mus-outa|b|c|d.
  -;;  *             mus_make_frame_to_file_with_comment, mus_mixer_scale, mus_make_frame|mixer_with_data.
  -;;  *             mus_make_scalar_mixer, mus_mixer_add, mus_continue_frame_to_file.
  -;;  *             changed pv_* to phase_vocoder_*
  -;;  * 28-June:    ssb_am + added fm arg (ssb_am_1 is the previous form).
  -;;  * 21-June:    wrapper method.
  -;;  * 14-June:    ssb_am generator.
  -;;  *             deprecated mus-a*|b*, replaced by mus-x|ycoeff.
  -;;  * 9-June:     mus_edot_product.
  -;;  * 7-June:     removed mus-x*|y* generic functions.
  -;;  * 24-May:     distribution arg to make-rand, make-rand-interp.
  -;;  * 11-May:     type arg to mus_make_table_lookup|wave_train, MUS_INTERP_NONE, MUS_INTERP_HERMITE.
  -;;  *             mus-interp-type.
  -;;  * 10-May:     changed MUS_LINEAR and MUS_SINUSOIDAL to MUS_INTERP_LINEAR and MUS_INTERP_SINUSOIDAL.
  -;;  *             mus-linear renamed mus-interp-linear, mus-sinusoidal renamed mus-interp-sinusoidal.
  -;;  *             added type arg to mus_make_delay|all_pass|comb|notch.
  -;;  *             added mus_delay_tick, all-pass delay line interpolation.
  -;;  * 3-May:      envelope arg to make-rand and make-rand-interp to give any arbitrary random number distribution.
  -;;  *             added mus_make_rand_with_distribution and mus_make_rand_interp_with_distribution.
  -;;  *             rand/rand-interp mus-data returns distribution (weight) function, mus-length its length.
  -;;  *             locsig mus-data returns output scalers, mus-xcoeffs returns reverb scalers
  -;;  * 26-Apr:     mus_sum_of_sines changed to mus_sine_bank.
  -;;  *             new mus_sum_of_sines parallels mus_sum_of_cosines.
  -;;  *             deprecated mus_sin.
  -;;  * 14-Apr:     changed "2" to "_to_" in several function names.
  -;;  * 12-Apr:     mus_average, mus_average_p, mus_make_average.
  -;;  * 17-Mar:     edit function added to mus_granulate.
  -;;  *             replaced MUS_DATA_POSITION with MUS_DATA_WRAPPER.
  -;;  * 22-Jan:     various "environ" variables renamed for Windows' benefit.
  -;;  * 5-Jan-04:   env_interp bugfix.
  -;;  * --------
  -;;  * 29-Sep:     removed length arg from spectrum in clm2xen.
  -;;  * 24-Aug:     changed mus_length|ramp|hop type to mus_long_t.
  -;;  * 21-Aug:     export MUS_INPUT and friends (needed for specialized INA handlers).
  -;;  * 11-Aug:     int -> bool.
  -;;  * 7-Aug:      removed mus_type.
  -;;  * 20-July:    more run methods.
  -;;  * 15-July:    linear->dB check for 0.0 arg.
  -;;  * 27-June:    mus_samples_to_seconds and mus_seconds_to_samples.
  -;;  * 9-June:     mus_mix_with_reader_and_writer.
  -;;  * 27-May:     bugfix: interpolating all-pass ("zall-pass") had an extra delay.
  -;;  * 25-Apr:     mus_spectrum and mus_convolution now return mus_float_t*.
  -;;  * 9-Apr:      removed MUS_HANNING_WINDOW (use MUS_HANN_WINDOW).
  -;;  * 3-Mar:      mus_delay_line_p for tap error checking.
  -;;  * 27-Feb:     mus_length for env -> original duration in samples.
  -;;  * 21-Feb:     mus_set_cosines added, mus_cosines moved to hop slot.
  -;;  *             mus_[set_]x1/x2/y1/y2.
  -;;  * 10-Feb:     mus_file_name moved into the mus_input|output structs.
  -;;  *             folded mus_input|output into mus_any.
  -;;  *             moved mus_frame|mixer declarations into clm.c.
  -;;  *             all mus_input|output|frame|mixer pointers->mus_any.
  -;;  *             all method void pointers->mus_any.
  -;;  * 7-Feb:      split strings out of clm2xen.c into clm-strings.h.
  -;;  * 3-Feb:      mus_offset for envs, mus_width for square_wave et al.
  -;;  *             new core class fields(10) for various methods.
  -;;  * 7-Jan-03:   mus_src with very large sr_change segfault bugfix.
  -;;  * --------
  -;;  * 17-Dec:     mus_env_offset|initial_power for Snd exp env optimizations.
  -;;  * 13-Sep:     mus_frandom and mus_irandom(for Snd optimizer).
  -;;  * 19-Aug:     changed internal phase-vocoder array accessor names
  -;;  * 13-Aug:     set!(*-ref) for frame, locsig, mixer, locsig-reverb.
  -;;  * 29-Jul:     various *_1 cases for the optimizer.
  -;;  * 15-Jul:     mus_continue_sample2file.
  -;;  * 10-Jul:     mus_file_name.
  -;;  * 7-Jun:      fftw support added.
  -;;  * 31-May:     changed mus_any_class.
  -;;  * 3-May:      many int->mus_long_t changes for large files.
  -;;  * 8-Apr:      off-by-1 env bug(Lisp/C are now identical), env_interp of exp env beyond end bugfix.
  -;;  * 1-Apr:      sine-summation n=0 bugfix.
  -;;  * 27-Mar:     negative degree locsig bugfix.
  -;;  * 18-Mar:     mus_move_locsig.
  -;;  * 15-Mar:     n-chan locsig(and reverb scalers), 'type' arg to mus_make_locsig.
  -;;  * 6-Mar:      mus_scaler in asymmetric-fm now refers to the "r" parameter, "a" in sine-summation.
  -;;  * 5-Mar:      dumb typo in asymmetric-fm generator fixed.
  -;;  * 19-Feb:     buffer reallocation redundant free bugfix.
  -;;  * 25-Jan-02:  mus_increment of env returns base.
  -;;  * --------
  -;;  * 10-Dec:     add outctr calls, phase-vocoder bugfixes, thanks to Scott Wilson.
  -;;  * 21-Oct:     fill in some set-data methods.
  -;;  * 1-Sep:      mus_polar2rectangular.
  -;;  * 6-July:     scm -> xen.
  -;;  * 26-May:     mus_rand_seed.
  -;;  * 22-May:     locsig reverb distance calc was upside down.
  -;;  * 18-May:     mus_describe and mus_inspect returned string should not be freed any more.
  -;;  * 7-May:      filled in some leftover equal_p methods.
  -;;  * 1-Apr:      mus_make_file2sample_with_comment and mus_length for file->sample/sample->file.
  -;;  *             mus_file_buffer_size.
  -;;  * 26-Mar:     extended_type field added to mus_any_class for more robust type checking.
  -;;  * 16-Mar:     mus_phase of env -> current_value.
  -;;  * 28-Feb:     added mus_position(currently only for envs).
  -;;  * 8-Feb:      clm2scm.h.
  -;;  * 24-Jan:     mus-bank in clm2scm.
  -;;  * 5-Jan:      clm2scm gens are applicable.
  -;;  * 4-Jan:      mus_bank.
  -;;  * 2-Jan-01:   mus_run method.
  -;;  * --------
  -;;  * 28-Dec:     mus_clear_filter_state and other minor tweaks for Snd.
  -;;  * 28-Nov:     Dolph-Chebyshev window(under HAVE_GSL flag -- needs complex trig support).
  -;;  * 8-Nov:      mus_clear_sinc_tables.
  -;;  * 12-Oct:     mus_formant_bank takes one input(can't remember why I had an array here)
  -;;  * 27-Sep:     mus_array_interp bugfix(imitates mus.lisp now).
  -;;  * 18-Sep:     clm now assumes it's used as a part of sndlib.
  -;;  * 11-Sep:     generalized set! to generic functions in clm2scm.c.
  -;;  * 31-Aug:     changed formant field setters(thanks to Anders Vinjar).
  -;;  * 10-Aug:     removed built-in setf support(clm2scm.c).
  -;;  * 31-Jul:     mus_granulate tries to protect against illegal length and ramp values.
  -;;  * 24-Jul:     mus_make_fir_coeffs.
  -;;  * 20-Jul:     sum_of_sines, atan2 to rectangular->polar, phase_vocoder gen.
  -;;  * 22-June:    made mus_bessi0 local again.
  -;;  * 1-June:     bugfixes for linuxppc 2000.
  -;;  * 19-May:     mus_apply.
  -;;  * 8-May:      added "const" and XEN_PROCEDURE_CAST(for c++), made mus_bessi0 global.
  -;;  * 24-Apr:     changed formant radius to match lisp version(it's now 1-old_radius)
  -;;  * 20-Apr:     mus_convolve_files
  -;;  * 7-Apr:      src width bug fixed
  -;;  * 31-Mar:     finally implemented set-location for envs.
  -;;  * 14-Feb:     buffer-full?.
  -;;  * 1-Feb:      removed mus_phasepartials2waveshape.
  -;;  * 3-Jan-00:   format and type args added to make_sample2file, 
  -;;  *             mus_file_close. 
  -;;  *             removed make_file_input and make_file_output.
  -;;  * --------
  -;;  * 29-Dec:     various bugfixes especially in envelope handlers.
  -;;  * 19-Nov:     mus_oscil_bank and mus_formant_bank.
  -;;  * 5-Nov:      mus_sin exported.
  -;;  * 4-Oct:(scm) make-env arg order changed to reflect mus.lisp.
  -;;  * 29-Sep:     implemented mus-increment and mus-frequency for granulate(as in mus.lisp).
  -;;  *             clm's fft renamed mus-fft to avoid collision with snd's version.
  -;;  *             added max_size arg to make_granulate(to reflect mus.lisp).
  -;;  * 25-Sep-99:  added width arg to make_src -- forgot this somehow in first pass.
  -;;  *             decided to make mus_inspect return char* like mus_describe.
  -;;  */
  
positive.code: ;; } mus_any_class;
  
  
  ;; typedef enum {MUS_INTERP_NONE, MUS_INTERP_LINEAR, MUS_INTERP_SINUSOIDAL, MUS_INTERP_ALL_PASS, 
  ;; 	      MUS_INTERP_LAGRANGE, MUS_INTERP_BEZIER, MUS_INTERP_HERMITE, MUS_NUM_INTERPS} mus_interp_t;
  ;; typedef enum {MUS_ENV_LINEAR, MUS_ENV_EXPONENTIAL, MUS_ENV_STEP} mus_env_t;
  
  ;; typedef enum {MUS_RECTANGULAR_WINDOW, MUS_HANN_WINDOW, MUS_WELCH_WINDOW, MUS_PARZEN_WINDOW, MUS_BARTLETT_WINDOW,
  
negative.code: 
  ;; /* -------- generators -------- */
  
  (defcfun ("mus_oscil" mus-oscil) :double (o :pointer) (fm :double) (pm :double))
  (defcfun ("mus_oscil_unmodulated" mus-oscil-unmodulated) :double (ptr :pointer))
  (defcfun ("mus_oscil_fm" mus-oscil-fm) :double (ptr :pointer) (fm :double))
  (defcfun ("mus_oscil_pm" mus-oscil-pm) :double (ptr :pointer) (pm :double))
  (defcfun ("mus_oscil_p" mus-oscil-p) :boolean (ptr :pointer))
  (defcfun ("mus_make_oscil" mus-make-oscil) :pointer (freq :double) (phase :double))
  
  (defcfun ("mus_make_ncos" mus-make-ncos) :pointer (freq :double) (n :int))
  (defcfun ("mus_ncos" mus-ncos) :double (ptr :pointer) (fm :double))
  (defcfun ("mus_ncos_p" mus-ncso-p) :boolean (ptr :pointer))
  
  (defcfun ("mus_make_nsin" mus-make-nsin) :pointer (freq :double) (n :int))
  (defcfun ("mus_nsin" mus-nsin) :double (ptr :pointer) (fm :double))
  (defcfun ("mus_nsin_p" mus-nsin-p) :boolean (ptr :pointer))
  
  (defcfun ("mus_make_nrxysin" mus-make-nrxysin) :pointer (frequency :double) (y_over_x :double) (n :int) (r :double))
  (defcfun ("mus_nrxysin" mus-nrxysin) :double (ptr :pointer) (fm :double))
  (defcfun ("mus_nrxysin_p" mus-nrxysin-p) :boolean (ptr :pointer))
  
  (defcfun ("mus_make_nrxycos" mus-make-nrxycos) :pointer (frequency :double) (y_over_x :double) (n :int) (r :double))
  (defcfun ("mus_nrxycos" mus-nrxycos) :double (ptr :pointer) (fm :double))
  (defcfun ("mus_nrxycos_p" mus-nrxycos-p) :boolean (ptr :pointer))
  
  (defcfun ("mus_delay" mus-delay) :double (gen :pointer) (input :double) (pm :double))
  (defcfun ("mus_delay_unmodulated" mus-delay-unmodulated) :double (ptr :pointer) (input :double))
  (defcfun ("mus_tap" mus-tap) :double (gen :pointer) (loc :double))
  (defcfun ("mus_tap_unmodulated" mus-tap-unmodulated) :double (gen :pointer))
  (defcfun ("mus_make_delay" mus-make-delay) :pointer (size :int) (line (:pointer :double)) (line-size :int) (type mus-interp))
  (defcfun ("mus_delay_p" mus-delay-p) :boolean (ptr :pointer))
  (defcfun ("mus_delay_line_p" mus-delay-line-p) :boolean (gen :pointer))
  (defcfun ("mus_delay_tick" mus-delay-tick) :double (ptr :pointer) (input :double))
  (defcfun ("mus_delay_tick_noz" mus-delay-tick-noz) :double (ptr :pointer) (input :double))
  (defcfun ("mus_delay_unmodulated_noz" mus-delay-unmodulated-noz) :double (ptr :pointer) (input :double))
  
  (defcfun ("mus_comb" mus-comb) :double (gen :pointer) (input :double) (pm :double))
  (defcfun ("mus_comb_unmodulated" mus-comb-unmodulated) :double (gen :pointer) (input :double))
  (defcfun ("mus_make_comb" mus-make-comb) :pointer (scaler :double) (size :int) (line (:pointer :double)) (line-size :int) (type mus-interp))
  (defcfun ("mus_comb_p" mus-comb-p) :boolean (ptr :pointer))
  (defcfun ("mus_comb_unmodulated_noz" mus-comb-unmodulated-noz) :double (ptr :pointer) (input :double))
  
  (defcfun ("mus_notch" mus-notch) :double (gen :pointer) (input :double) (pm :double))
  (defcfun ("mus_notch_unmodulated" mus-notch-unmodulated) :double (gen :pointer) (input :double))
  (defcfun ("mus_make_notch" mus-make-notch) :pointer (scaler :double) (size :int) (line :pointer :double) (line-size :int) (type mus-interp))
  (defcfun ("mus_notch_p" mus-notch-p) :boolean (ptr :pointer))
  (defcfun ("mus_notch_unmodulated_noz" mus-notch-unmodulated-noze) :double (ptr :pointer) (input :double))
  
  (defcfun ("mus_all_pass" mus-all-pass) :double (gen :pointer) (input :double) (pm :double))
  (defcfun ("mus_all_pass_unmodulated" mus-all-pass-unmodulated) :double (gen :pointer) (input :double))
  (defcfun ("mus_make_all_pass" mus-make-all-pass) :pointer (backward :double) (forward :double) (size :int) (line (:pointer :double)) (line-size :int) (type mus-interp))
  (defcfun ("mus_all_pass_p" mus-all-pass-p) :boolean (ptr :pointer))
  (defcfun ("mus_all_pass_unmodulated_noz" mus-all-pass-unmodulated-noz) :double (ptr :pointer) (input :double))
  
  ;; MUS_EXPORT mus_any *mus_make_moving_average(int size, mus_float_t *line);
  ;; MUS_EXPORT bool mus_moving_average_p(mus_any *ptr);
  