Commit 75bedf41 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig

New upstream version 17.6

parent 5a088b89
Snd change log
2-Aug: Snd 17.6.
16-Jun: Snd 17.5.
6-May: Snd 17.4. New clm optimizer.
28-Mar: Snd 17.3.
......
Snd 17.5:
Snd 17.6.
s7: s7_history and s7_add_to_history (Kjetil's suggestion).
(*s7* 'history) for non-error scheme-side access to the history info
lambda* keyword argument handling changed slightly.
multithread sanity-checks thanks to Kjetil.
Kjetil also ported s7 to mingw.
s7: (*s7* 'heap-size) is settable
added s7_define_typed_function_star to s7.h
changed to the new (c99?) int64_t style int types.
added two optional args to c-pointer: type, info
and added s7_is_c_pointer_of_type.
libgtk_s7.c (in-progress)
checked: gtk 3.91.0, sbcl 1.3.18, FC 26 (gcc 7.1.1)
clm: removed clm-default-frequency
object->let support for generators
Thanks!: Kjetil Matheussen, Rick Taube
checked: sbcl 1.3.19|20, gtk 3.91.1
Thanks!: Mike Scholz, James Hearon
......@@ -21,29 +21,6 @@
#define is_power_of_2(x) ((((x) - 1) & (x)) == 0)
#if 0
#define clear_floats(Arr, Len) memset((void *)(Arr), 0, (Len) * sizeof(mus_float_t))
#define copy_floats(Dst, Src, Len) memcpy((void *)(Dst), (void *)(Src), (Len) * sizeof(mus_float_t))
#else
#define clear_floats(Arr, Len) \
do { \
mus_long_t K; \
mus_float_t *dst; \
dst = Arr; \
for (K = Len; K > 0; K--) \
*dst++ = 0.0; \
} while (0)
#define copy_floats(Dst, Src, Len) \
do { \
mus_long_t K; \
mus_float_t *dst, *src; \
dst = Dst; \
src = Src; \
for (K = Len; K > 0; K--) \
*dst++ = *src++; \
} while (0)
#endif
#define MUS_MAX_MALLOC_DEFAULT (1 << 26)
#define MUS_MAX_TABLE_SIZE_DEFAULT (1024 * 1024 * 20) /* delay line allocation etc */
......
......@@ -232,8 +232,6 @@
(require snd-ws.scm)
(require sndlib-ws.scm))
(set! *clm-default-frequency* 0.0)
(define-macro (define-animal args . body)
(let ((name (car args))
(targs (cdr args)))
......
......@@ -268,7 +268,7 @@
(let ((col (XColor))
(cmap (DefaultColormap dpy (DefaultScreen dpy))))
(if (= (XAllocNamedColor dpy cmap color col col) 0)
(error (format #f "can't allocate ~A" color))
(error 'no-memory "can't allocate ~A" color)
(.pixel col))))
(XtSetValues shell (list XmNtitle "FM Forever!"))
......
......@@ -121,7 +121,7 @@
(defgenerator (big-oscil
:make-wrapper
(lambda (g) (set! (g 'frequency) (big-hz->radians (g 'frequency))) g))
(frequency *clm-default-frequency*)
(frequency 0.0)
(angle 0.0))
(define* (big-oscil gen (fm 0.0) (pm 0.0))
......@@ -149,7 +149,7 @@
(set! (g 'r) (/ (g 'n)))
(set! (g 'frequency) (big-hz->radians (g 'frequency)))
g))
(frequency *clm-default-frequency*)
(frequency 0.0)
(n 1)
(angle 0.0)
(r 1.0))
......@@ -200,7 +200,7 @@
(set! (g 'r) (/ 1.0 (find-scaler (g 'n) 0.0 (/ pi (+ (g 'n) 1/2)))))
(set! (g 'frequency) (big-hz->radians (g 'frequency)))
g)))
(frequency *clm-default-frequency*)
(frequency 0.0)
(n 1)
(angle 0.0)
(r 1.0))
......@@ -236,7 +236,7 @@
(set! (g 'frequency) (/ (* (g 'frequency) (g 'size)) *clm-srate*))
(set! (g 'angle) (/ (* (g 'angle) (g 'size)) (* 2 pi)))
g))
(frequency *clm-default-frequency*)
(frequency 0.0)
(angle 0.0)
(wave #f)
(size *clm-table-size*))
......
......@@ -26,7 +26,6 @@
#define S_bohman_window "bohman-window"
#define S_cauchy_window "cauchy-window"
#define S_clear_sincs "clear-sincs"
#define S_clm_default_frequency "clm-default-frequency"
#define S_clm_table_size "clm-table-size"
#define S_comb "comb"
#define S_is_comb "comb?"
......
This diff is collapsed.
......@@ -2,8 +2,8 @@
#define CLM_H
#define MUS_VERSION 6
#define MUS_REVISION 13
#define MUS_DATE "5-Aug-15"
#define MUS_REVISION 16
#define MUS_DATE "18-Jul-17"
/* isn't mus_env_interp backwards? */
......@@ -108,6 +108,7 @@ MUS_EXPORT mus_float_t mus_odd_multiple(mus_float_t x, mus_float_t y);
MUS_EXPORT mus_float_t mus_even_multiple(mus_float_t x, mus_float_t y);
MUS_EXPORT mus_float_t mus_odd_weight(mus_float_t x);
MUS_EXPORT mus_float_t mus_even_weight(mus_float_t x);
MUS_EXPORT const char *mus_interp_type_to_string(int type);
MUS_EXPORT mus_float_t mus_srate(void);
MUS_EXPORT mus_float_t mus_set_srate(mus_float_t val);
......@@ -139,6 +140,7 @@ MUS_EXPORT bool mus_is_fft_window(int val);
MUS_EXPORT int mus_sample_type_zero(mus_sample_t samp_type);
MUS_EXPORT mus_float_t (*mus_run_function(mus_any *g))(mus_any *gen, mus_float_t arg1, mus_float_t arg2);
MUS_EXPORT mus_float_t (*mus_run1_function(mus_any *g))(mus_any *gen, mus_float_t arg);
/* -------- generic functions -------- */
......@@ -190,6 +192,29 @@ MUS_EXPORT mus_float_t mus_set_feedforward(mus_any *gen, mus_float_t val);
MUS_EXPORT mus_float_t mus_feedback(mus_any *rd);
MUS_EXPORT mus_float_t mus_set_feedback(mus_any *rd, mus_float_t dir);
MUS_EXPORT bool mus_phase_exists(mus_any *gen);
MUS_EXPORT bool mus_frequency_exists(mus_any *gen);
MUS_EXPORT bool mus_length_exists(mus_any *gen);
MUS_EXPORT bool mus_order_exists(mus_any *gen);
MUS_EXPORT bool mus_data_exists(mus_any *gen);
MUS_EXPORT bool mus_name_exists(mus_any *gen);
MUS_EXPORT bool mus_scaler_exists(mus_any *gen);
MUS_EXPORT bool mus_offset_exists(mus_any *gen);
MUS_EXPORT bool mus_width_exists(mus_any *gen);
MUS_EXPORT bool mus_file_name_exists(mus_any *gen);
MUS_EXPORT bool mus_xcoeffs_exists(mus_any *gen);
MUS_EXPORT bool mus_ycoeffs_exists(mus_any *gen);
MUS_EXPORT bool mus_increment_exists(mus_any *gen);
MUS_EXPORT bool mus_location_exists(mus_any *gen);
MUS_EXPORT bool mus_channel_exists(mus_any *gen);
MUS_EXPORT bool mus_channels_exists(mus_any *gen);
MUS_EXPORT bool mus_position_exists(mus_any *gen);
MUS_EXPORT bool mus_interp_type_exists(mus_any *gen);
MUS_EXPORT bool mus_ramp_exists(mus_any *gen);
MUS_EXPORT bool mus_hop_exists(mus_any *gen);
MUS_EXPORT bool mus_feedforward_exists(mus_any *gen);
MUS_EXPORT bool mus_feedback_exists(mus_any *gen);
/* -------- generators -------- */
......@@ -591,6 +616,10 @@ MUS_EXPORT mus_any *mus_bank_generator(mus_any *g, int i);
/* Change log.
*
* 18-Jul: mus_<method>_exists.
* 13-Jul: mus_run1_function.
* 11-Jul-17: removed *clm-default-frequency*.
* --------
* 5-Aug: removed some now-obsolete mus_locsig functions.
* 5-Jul: added stable arg to mus_make_oscil_bank.
* 15-Feb: removed mus_set_name, changed mus_free to void.
......
This diff is collapsed.
......@@ -8,7 +8,6 @@ typedef struct mus_xen mus_xen;
#define Xen_to_mus_xen(arg) ((mus_xen *)Xen_object_ref(arg))
#define Xen_to_mus_any(obj) mus_xen_gen(Xen_to_mus_xen(obj))
#define MUS_CLM_DEFAULT_TABLE_SIZE 512
#define MUS_CLM_DEFAULT_FREQUENCY 0.0
#ifdef __cplusplus
extern "C" {
......@@ -24,7 +23,7 @@ MUS_EXPORT const char *mus_fft_window_xen_name(mus_fft_window_t i);
MUS_EXPORT Xen mus_xen_to_object(mus_xen *gn);
MUS_EXPORT Xen mus_xen_to_object_with_vct(mus_xen *gn, Xen v);
MUS_EXPORT mus_any *mus_optkey_to_mus_any(Xen key, const char *caller, int n, mus_any *def);
MUS_EXPORT int mus_optkey_unscramble(const char *caller, int nkeys, Xen *keys, Xen *args, int *orig);
MUS_EXPORT int mus_optkey_unscramble(const char *caller, int num_args, int nkeys, Xen *keys, Xen *args, int *orig);
MUS_EXPORT mus_float_t mus_optkey_to_float(Xen key, const char *caller, int n, mus_float_t def);
MUS_EXPORT int mus_optkey_to_int(Xen key, const char *caller, int n, int def);
MUS_EXPORT bool mus_optkey_to_bool(Xen key, const char *caller, int n, bool def);
......
......@@ -136,7 +136,7 @@
'(string s7_is_string s7_string s7_make_string char*)
(list 'character 's7_is_character 's7_character 's7_make_character (symbol "unsigned char"))
'(c_pointer s7_is_c_pointer s7_c_pointer s7_make_c_pointer void*)
'(c_pointer s7_is_c_pointer s7_c_pointer s7_make_c_pointer_with_type void*)
'(s7_pointer #f #f #f s7_pointer)
))
......@@ -302,17 +302,17 @@
(eq? (car arg-types) 'void))
(set! num-args 0))
(format p "~%/* -------- ~A -------- */~%" func-name)
(format p "static s7_pointer ~A(s7_scheme *sc, s7_pointer args)~%" base-name)
(format p "static s7_pointer ~A(s7_scheme *sc, s7_pointer ~A)~%" base-name (if (= num-args 1) 'arg 'args))
(format p "{~%")
;; get the Scheme args, check their types, assign to local C variables
(when (positive? num-args)
(format p " s7_pointer arg;~%")
(if (not (= num-args 1)) (format p " s7_pointer arg;~%"))
(do ((i 0 (+ i 1))
(type arg-types (cdr type)))
((= i num-args))
(format p " ~A ~A_~D;~%" ((if (pair? (car type)) caar car) type) base-name i))
(format p " arg = args;~%")
(if (not (= num-args 1)) (format p " arg = args;~%"))
(do ((i 0 (+ i 1))
(type arg-types (cdr type)))
((= i num-args))
......@@ -320,22 +320,29 @@
(let* ((nominal-type ((if (pair? (car type)) caar car) type)) ; double in the example
(true-type ((if (pair? (car type)) cadar car) type))
(s7-type (C-type->s7-type true-type))) ; real
;(format *stderr* "~A(~D): ~A ~A ~A~%" func-name i nominal-type true-type s7-type)
(if (eq? true-type 's7_pointer)
(format p " ~A_~D = s7_car(arg);~%" base-name i)
(begin
(format p " if (~A(s7_car(arg)))~%" (checker true-type))
(format p " ~A_~D = (~A)~A(~As7_car(arg));~%"
base-name i
nominal-type
(s7->C true-type) ; s7_number_to_real which requires
(if (memq s7-type '(boolean real)) ; the extra sc arg
"sc, " ""))
(format p " else return(s7_wrong_type_arg_error(sc, ~S, ~D, s7_car(arg), ~S));~%"
func-name
(if (= num-args 1) 0 (+ i 1))
(if (symbol? s7-type)
(symbol->string s7-type)
(error 'bad-arg (format #f "in ~S, ~S is not a symbol~%" name s7-type))))))
(if (eq? s7-type 'c_pointer)
(begin
(format p " if (s7_is_c_pointer_of_type(s7_car(arg), s7_make_symbol(sc, ~S)))~%" (symbol->string nominal-type))
(format p " ~A_~D = (~A)s7_c_pointer(s7_car(arg));~%" base-name i nominal-type)
(format p " else return(s7_wrong_type_arg_error(sc, ~S, ~D, s7_car(arg), ~S));~%"
func-name (if (= num-args 1) 0 (+ i 1)) (symbol->string nominal-type)))
(begin
(format p " if (~A(s7_car(arg)))~%" (checker true-type))
(format p " ~A_~D = (~A)~A(~As7_car(arg));~%"
base-name i
nominal-type
(s7->C true-type) ; s7_number_to_real which requires
(if (memq s7-type '(boolean real)) ; the extra sc arg
"sc, " ""))
(format p " else return(s7_wrong_type_arg_error(sc, ~S, ~D, s7_car(arg), ~S));~%"
func-name
(if (= num-args 1) 0 (+ i 1))
(if (symbol? s7-type)
(symbol->string s7-type)
(error 'bad-arg (format #f "in ~S, ~S is not a symbol~%" name s7-type)))))))
(if (< i (- num-args 1))
(format p " arg = s7_cdr(arg);~%")))))
......@@ -343,6 +350,7 @@
(if (pair? return-type)
(set! return-type (cadr return-type)))
(let ((return-translator (C->s7 return-type)))
;(format *stderr* "return ~A ~A~%" return-type return-translator)
(format p " ")
(if (not (eq? return-translator #t))
(format p "return("))
......@@ -355,8 +363,11 @@
(if (positive? num-args)
(format p "~A_~D" base-name (- num-args 1)))
(format p ")")
(if (symbol? return-translator)
(format p ")"))
(if (eq? return-translator 's7_make_c_pointer_with_type)
(format p ", s7_make_symbol(sc, ~S), s7_f(sc))" (symbol->string return-type))
(if (symbol? return-translator)
(format p ")")))
(format p (if (not (eq? return-translator #t))
");~%"
";~% return(s7_unspecified(sc));~%"))
......@@ -486,12 +497,20 @@
(lambda (c)
(let* ((type (c 0))
(c-name (c 1))
(scheme-name (string-append prefix (if (> (length prefix) 0) ":" "") c-name)))
(format p " s7_define(sc, cur_env, s7_make_symbol(sc, ~S), ~A(sc, (~A)~A));~%"
scheme-name
(C->s7 type)
(C->s7-cast type)
c-name)))
(scheme-name (string-append prefix (if (> (length prefix) 0) ":" "") c-name))
(trans (C->s7 type)))
(if (eq? trans 's7_make_c_pointer_with_type)
(format p " s7_define(sc, cur_env, s7_make_symbol(sc, ~S), ~A(sc, (~A)~A, s7_make_symbol(sc, ~S), s7_f(sc)));~%"
scheme-name
trans
(C->s7-cast type)
c-name
(if (eq? type 'c-pointer) "void*" (symbol->string type)))
(format p " s7_define(sc, cur_env, s7_make_symbol(sc, ~S), ~A(sc, (~A)~A));~%"
scheme-name
trans
(C->s7-cast type)
c-name))))
constants)))
;; C macros -- need #ifdef name #endif wrapper
......@@ -502,13 +521,19 @@
(lambda (c)
(let* ((type (c 0))
(c-name (c 1))
(scheme-name (string-append prefix (if (> (length prefix) 0) ":" "") c-name)))
(scheme-name (string-append prefix (if (> (length prefix) 0) ":" "") c-name))
(trans (C->s7 type)))
(format p "#ifdef ~A~%" c-name)
(format p " s7_define(sc, cur_env, s7_make_symbol(sc, ~S), ~A(sc, (~A)~A));~%"
scheme-name
(C->s7 type)
(C->s7-cast type)
c-name)
(if (eq? trans 's7_make_c_pointer_with_type)
(format p " s7_define(sc, cur_env, s7_make_symbol(sc, ~S), s7_make_c_pointer(sc, (~A)~A));~%"
scheme-name
(C->s7-cast type)
c-name)
(format p " s7_define(sc, cur_env, s7_make_symbol(sc, ~S), ~A(sc, (~A)~A));~%"
scheme-name
trans
(C->s7-cast type)
c-name))
(format p "#endif~%")))
macros)))
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for snd 17.5.
# Generated by GNU Autoconf 2.69 for snd 17.6.
#
# Report bugs to <bil@ccrma.stanford.edu>.
#
......@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='snd'
PACKAGE_TARNAME='ftp://ccrma-ftp.stanford.edu/pub/Lisp/snd-17.tar.gz'
PACKAGE_VERSION='17.5'
PACKAGE_STRING='snd 17.5'
PACKAGE_VERSION='17.6'
PACKAGE_STRING='snd 17.6'
PACKAGE_BUGREPORT='bil@ccrma.stanford.edu'
PACKAGE_URL=''
......@@ -1321,7 +1321,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures snd 17.5 to adapt to many kinds of systems.
\`configure' configures snd 17.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1392,7 +1392,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of snd 17.5:";;
short | recursive ) echo "Configuration of snd 17.6:";;
esac
cat <<\_ACEOF
......@@ -1508,7 +1508,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
snd configure 17.5
snd configure 17.6
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1969,7 +1969,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by snd $as_me 17.5, which was
It was created by snd $as_me 17.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -3316,7 +3316,7 @@ LOCAL_LANGUAGE="None"
GRAPHICS_TOOLKIT="None"
PACKAGE=Snd
VERSION=17.5
VERSION=17.6
#--------------------------------------------------------------------------------
# configuration options
......@@ -6703,7 +6703,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by snd $as_me 17.5, which was
This file was extended by snd $as_me 17.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -6765,7 +6765,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
snd config.status 17.5
snd config.status 17.6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -5,7 +5,7 @@
# gmp, mpfr, and mpc deliberately have none!
AC_INIT(snd, 17.5, bil@ccrma.stanford.edu, ftp://ccrma-ftp.stanford.edu/pub/Lisp/snd-17.tar.gz)
AC_INIT(snd, 17.6, bil@ccrma.stanford.edu, ftp://ccrma-ftp.stanford.edu/pub/Lisp/snd-17.tar.gz)
AC_CONFIG_SRCDIR(snd.c)
AC_CANONICAL_HOST # needed by case $host below
......@@ -24,7 +24,7 @@ LOCAL_LANGUAGE="None"
GRAPHICS_TOOLKIT="None"
PACKAGE=Snd
VERSION=17.5
VERSION=17.6
#--------------------------------------------------------------------------------
# configuration options
......
......@@ -2491,7 +2491,13 @@ is assumed to be outside -1.0 to 1.0."))
;;; -------- parallel FM spectrum calculator
;;;
;;; outside Snd, jn can be accessed via:
;;; (require libgsl.scm)
;;; (define jn (*libgsl* 'gsl_sf_bessel_Jn))
;;; or:
;;; (require libm.scm)
;;; (define jn (*libm* 'jn))
;(fm-parallel-component 200 2000.0 (list 2000.0 200.0) (list 0.5 1.0) () () #t)
(define fm-parallel-component
......
......@@ -1559,7 +1559,8 @@ as env moves to 0.0, low-pass gets more intense; amplitude and low-pass amount m
(samp0 0.0)
(samp1 0.0)
(samp2 0.0)
(len (framples)))
(len (framples))
(local-max 0.0))
(call-with-exit
(lambda (return)
(do ((ctr loc (+ ctr 1)))
......@@ -1567,11 +1568,11 @@ as env moves to 0.0, low-pass gets more intense; amplitude and low-pass amount m
(set! samp0 samp1)
(set! samp1 samp2)
(set! samp2 (next-sample reader))
(let ((local-max (max .1 (moving-max mmax samp0))))
(if (and (> (abs (- samp0 samp1)) local-max)
(> (abs (- samp1 samp2)) local-max)
(< (abs (- samp0 samp2)) (/ local-max 2)))
(return (- ctr 1)))))))))))
(set! local-max (max .1 (moving-max mmax samp0)))
(if (and (> (abs (- samp0 samp1)) local-max)
(> (abs (- samp1 samp2)) local-max)
(< (abs (- samp0 samp2)) (/ local-max 2)))
(return (- ctr 1))))))))))
(define remove-clicks
(let ((documentation "(remove-clicks) tries to find and smooth-over clicks"))
......@@ -1593,15 +1594,16 @@ as env moves to 0.0, low-pass gets more intense; amplitude and low-pass amount m
(let ((samp0 0.0)
(samp1 0.0)
(samp2 0.0)
(mmax (make-moving-max 10)))
(mmax (make-moving-max 10))
(local-max 0.0))
(lambda (val)
(set! samp0 samp1)
(set! samp1 samp2)
(set! samp2 val)
(let ((local-max (max .1 (moving-max mmax samp0))))
(and (>= (abs (- samp0 samp1)) local-max)
(>= (abs (- samp1 samp2)) local-max)
(<= (abs (- samp0 samp2)) (/ local-max 2)))))))))
(set! local-max (max .1 (moving-max mmax samp0)))
(and (>= (abs (- samp0 samp1)) local-max)
(>= (abs (- samp1 samp2)) local-max)
(<= (abs (- samp0 samp2)) (/ local-max 2))))))))
(define zero+
......
......@@ -4153,8 +4153,6 @@ on a good day.
<p>mus-clipping is the default low-level clipping choice while accessing sound data.
Its default is #f which makes clipping very obvious (it will cause wrap-around).
If you're using the standard Snd file accessors, you probably want to use <a href="#clipping">clipping</a>, not this function.
This function refers to <a href="#mussoundopenoutput">mus-sound-open-output</a> and friends; the file-local version
is <a href="#musfileclipping">mus-file-clipping</a> &mdash; surely we could make this more confusing!
See also <a href="#cliphook">clip-hook</a>.
</p>
<div class="spacer"></div>
......@@ -4193,8 +4191,7 @@ and whatever else seems appropriate.
<em class=def id="musfileclipping">mus-file-clipping</em> fd
</pre>
<p>This is the clipping choice for the file referred to by 'fd'
(a file identifier as returned by <a href="#mussoundopeninput">mus-sound-open-input</a>).
<p>This is the clipping choice for the file referred to by 'fd.
The default is #f which makes clipping very obvious (it will cause wrap-around).
See also <a href="#cliphook">clip-hook</a>.
</p>
......@@ -4324,34 +4321,6 @@ whose header claims it has 43 channels, but we know it only has 2:
<div class="spacer"></div>
<!-- mus-sound-close-input -->
<pre class="indented">
<em class=def id="mussoundcloseinput">mus-sound-close-input</em> fd
</pre>
<p>This closes the sound file referred to by 'fd'; 'fd' is an integer returned by <a href="#mussoundopeninput">mus-sound-open-input</a>.
These mus-sound-* file functions refer to a direct path to read and write sound files. Any such operation is beneath the
notice, so to speak, of Snd.
</p>
<div class="spacer"></div>
<!-- mus-sound-close-output -->
<pre class="indented">
<em class=def id="mussoundcloseoutput">mus-sound-close-output</em> fd bytes
</pre>
<p>This function closes the sound file 'fd', and updates its length indication, if any to be 'bytes' bytes.
If you didn't specify a sample-type to <a href="#mussoundopenoutput">mus-sound-open-output</a>,
it defaulted to mus-out-format.
mus-out-format can
currently be either ints, floats, or doubles, depending on how you've configured Snd, so it's safest
to use (<a href="#musbytespersample">mus-bytes-per-sample</a> mus-out-format)
for the number of bytes per sample.
</p>
<div class="spacer"></div>
<!-- mus-sound-comment -->
<pre class="indented">
<em class=def id="mussoundcomment">mus-sound-comment</em> filename
......@@ -4537,28 +4506,6 @@ in the sound cache; if it isn't, a call on mus-sound-maxamp has to open and read
<div class="spacer"></div>
<!-- mus-sound-open-input -->
<pre class="indented">
<em class=def id="mussoundopeninput">mus-sound-open-input</em> filename
</pre>
<p>mus-sound-open-input opens the sound file 'filename' and returns an integer for use with
<a href="#mussoundread">mus-sound-read</a> and <a href="#mussoundcloseinput">mus-sound-close-input</a>.
</p>
<div class="spacer"></div>
<!-- mus-sound-open-output -->
<pre class="indented">
<em class=def id="mussoundopenoutput">mus-sound-open-output</em> filename (srate 44100) (chans 1) sample-type header-type comment
</pre>
<p>mus-sound-open-output creates a new sound file with the indicated attributes, and returns an integer
for use with <a href="#mussoundwrite">mus-sound-write</a> and <a href="#mussoundcloseoutput">mus-sound-close-output</a>.
</p>
<div class="spacer"></div>
<!-- mus-sound-preload -->
<pre class="indented">
<em class=def id="mussoundpreload">mus-sound-preload</em> filename
......@@ -4580,27 +4527,6 @@ stored in some odd format, and you use that file a lot, this can save some time.
<div class="spacer"></div>
<!-- mus-sound-read -->
<pre class="indented">
<em class=def id="mussoundread">mus-sound-read</em> fd beg-in-file num-to-read chans sd
</pre>
<p>mus-sound-read reads data from the sound file 'fd', starting at frample 'beg-in-file' (frample 0 is the first),
loading num-to-read samples into the float-vector 'sd' starting from 0 in that vector.
</p>
<div class="spacer"></div>
<!-- mus-sound-reopen-output -->
<pre class="indented">
<em class=def id="mussoundreopenoutput">mus-sound-reopen-output</em> filename (chans 1) sample-type header-type data-location
</pre>
<p>mus-sound-reopen-output reopens the sound file 'filename', ready to continue writing output.
</p>
<div class="spacer"></div>
<!-- mus-sound-report-cache -->
<pre class="indented">
<em class=def id="mussoundreportcache">mus-sound-report-cache</em> file
......@@ -4641,16 +4567,6 @@ loading num-to-read samples into the float-vector 'sd' starting from 0 in that v
<div class="spacer"></div>
<!-- mus-sound-seek-frample -->
<pre class="indented">
<em class=def id="mussoundseekframple">mus-sound-seek-frample</em> fd frample
</pre>
<p>mus-sound-seek-frample moves the input or output reading point to 'frample' in the sound file 'fd'.
</p>
<div class="spacer"></div>
<!-- mus-sound-srate -->
<pre class="indented">
<em class=def id="mussoundsrate">mus-sound-srate</em> filename
......@@ -4671,16 +4587,6 @@ loading num-to-read samples into the float-vector 'sd' starting from 0 in that v
<div class="spacer"></div>
<!-- mus-sound-write -->
<pre class="indented">
<em class=def id="mussoundwrite">mus-sound-write</em> fd beg end chans sd
</pre>
<p>mus-sound-write writes data from the float-vector 'sd' to the sound file 'fd'.
</p>
<div class="spacer"></div>
<!-- mus-sound-write-date -->
<pre class="indented">
<em class=def id="mussoundwritedate">mus-sound-write-date</em> filename
......@@ -8185,8 +8091,7 @@ file ok:
<p>There are
other ways to get at sound file data: <a class=quiet href="#makesampler">make-sampler</a> can be given a filename,
rather than a sound; file-&gt;float-vector in examp.scm;
<a class=quiet href="#mussoundopeninput">mus-sound-open-input</a> and
there are a variety of CLM-based functions such as
and a variety of CLM-based functions such as
<a class=quiet href="sndclm.html#filetosample">file-&gt;sample</a> and
<a class=quiet href="sndclm.html#filetoarray">file-&gt;array</a>.
</p>
......
This diff is collapsed.
......@@ -5723,15 +5723,20 @@ static void define_integers(void)
static bool gl_already_inited = false;
#if HAVE_SCHEME
void Init_libgl(s7_scheme *sc);
void Init_libgl(s7_scheme *sc)
#else
void Init_libgl(void);
void Init_libgl(void)
#endif
{
if (!gl_already_inited)
{
define_integers();
define_functions();
Xen_provide_feature("gl");
Xen_define("gl-version", C_string_to_Xen_string("25-Jun-17"));
Xen_define("gl-version", C_string_to_Xen_string("27-Jul-17"));
gl_already_inited = true;
}
}
......
......@@ -577,6 +577,10 @@ static bool is_prompt_end(glistener *g, int end_pos)
/* ---------------- listener text ---------------- */
GtkWidget *glistener_text_widget(glistener *g) {return(g->text);}
GtkTextBuffer *glistener_text_buffer(glistener *g) {return(g->buffer);}
static void remember_listener_string(glistener *g, const char *str)
{
int i, top, len;
......@@ -2875,6 +2879,8 @@ glistener *glistener_new(GtkWidget *parent, void (*initializations)(glistener *g
}
/* changes:
* 31-Jul-17: added access to text and buffer.
* --------
* 19-Mar-15: changed strcopy macro.
* 7-June: added keyer function.
* 4-June: added colorizer function.
......
......@@ -82,6 +82,10 @@ char *glistener_evaluate (glistener *g);
char *glistener_complete (glistener *g);