Commit d136f8f7 authored by Alessio Treglia's avatar Alessio Treglia

Imported Upstream version 11.3

parent f369f1bd
This diff is collapsed.
Snd change log
11-Feb: Snd 11.3.
9-Feb: removed NLS support (the po directory and so on).
8-Feb: moved sound|channel|mix|mark|edit-property to C.
23-Jan: The rest of the Guile-dependent files have been removed.
This includes pd-*, rt-*, and the --with-snd-as-pd-external
--with-hobbit, and --with-rt configuration switches.
5-Jan: Snd 11.2.
2010 ----------------------------------------------------------------
......
Snd 11.2
Snd 11.3:
added portaudio (version 19) support.
The old functional form of show-listener no longer works:
change (show-listener) to (set! (show-listener) #t).
s7: hash-table-for-each.
in CLM, mus-file-probe et al changed to get bools working across the FFI,
(that is, mus-file-probe now returns either T or NIL, not 1 or 0),
and sound-frames and friends now follow the *clm-seach-list* list.
added tools/sam.c: a Samson box emulator!
The rest of the Guile-dependent files have been removed. As soon as
they are translated to s7, I'll put them back in. This includes the
--with-snd-as-pd-external and --with-rt configuration switches.
some of the more useful extensions were moved to C:
About half of the CL functions have been implemented in s7test.scm (including
CLOS via tiny-clos); they pass the sacla/ansi/clisp tests (also in s7test.scm).
make-current-window-display (draw.*) as with-inset-graph.
flocsig in generators.scm (flanged locsig).
focus-follows-mouse as with-pointer-focus.
moved sound|channel|mix|mark|edit-property to C.
peak-env support, so peak-env.* removed, peak-env-info,
read-peak-env-info-file and write-peak-env-info-file removed,
added peak-env-dir which if not null (the default) turns on the
peak env machinery. smart-line-cursor also moved to C.
removed NLS support (the po directory and so on).
lots of long-delayed cleanups:
checked: gtk 2.19.3|4|5, FC 12, sbcl 1.0.35
removed Guile support.
this includes remove-local-hook! in hooks.scm, use-modules and all
the guile-specific reader/debugger settings ("debug-set!" etc),
--with-guile, --with-modules, and --with-hobbit configuration switches,
snd-out in examp.scm, pd-* and rt-* are currently broken. def-optkey-fun
is now just define*, and def-optkey-instrument is definstrument.
load-from-path is load. shell is system. removed fix-optargs.scm.
removed mus-audio-systems, mus-audio-mixer-read, mus-audio-mixer-write,
and all the associated field and device names (in CLM as well as Snd).
removed mus-audio-report and changed mus-audio-describe to return the
description as a string.
removed sndrecord.c and new-buttons.scm.
removed SGI support.
removed midi.c and the --with-midi configure switch.
in CLM, removed sc.c and clm-snd.lisp (CLM to Snd interjob communication).
removed XmPrint/libXp support (--with-xp configure switch).
versions of Alsa before 1.0 are no longer supported.
mpc versions before 0.8.0 are no longer supported.
checked: autoconf 2.65, sbcl 1.0.33|4, mpfr 2.4.2, gtk 2.19.1|2, mpc 0.8.1
Thanks!: Hermann Beyer, Mike Scholz, Tommy Rushton, Mike Winter, Rick Taube.
Thanks!: Kim Cascone, Mike Scholz, Michael McNabb, Rick Taube, Michael Edwards,
Fernando Lopez-Lezcano, Geoff Lee
......@@ -244,9 +244,6 @@ C, Scheme, Ruby, Forth, m4, Common Lisp, Emacs Lisp, javascript,
Fortran, expect, and postscript (altogether about 710,000 lines).
To get the German version at run-time, (setlocale LC_ALL "de_DE").
----------------------------------------------------------------
If you hit a bug, don't just sit there weeping -- send me
......
......@@ -537,7 +537,7 @@ MUS_EXPORT mus_float_t mus_run_evaluate_ptree_1f1v1b2f(struct ptree *pt, mus_flo
MUS_EXPORT mus_float_t mus_run_evaluate_ptreec(struct ptree *pt, mus_float_t arg, XEN object, bool dir, int type);
MUS_EXPORT int mus_run_xen_to_run_type(XEN val);
#if HAVE_S7
#if HAVE_SCHEME
MUS_EXPORT struct ptree *mus_run_form_to_ptree_1_b_without_env(XEN code);
MUS_EXPORT mus_float_t mus_run_evaluate_ptree_0f2f(struct ptree *pt);
MUS_EXPORT struct ptree *mus_run_form_to_ptree_0_f(XEN code);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -126,21 +126,6 @@ static const char *mus_audio_device_name(int dev)
}
#if (!HAVE_OSS) || (HAVE_ALSA)
static const char *mus_audio_format_names[] = {
"unknown", S_mus_bshort, S_mus_mulaw, S_mus_byte, S_mus_bfloat, S_mus_bint, S_mus_alaw, S_mus_ubyte, S_mus_b24int,
S_mus_bdouble, S_mus_lshort, S_mus_lint, S_mus_lfloat, S_mus_ldouble, S_mus_ubshort, S_mus_ulshort, S_mus_l24int,
S_mus_bintn, S_mus_lintn
};
static const char *mus_audio_format_name(int fr)
{
if (mus_data_format_p(fr))
return(mus_audio_format_names[fr]);
return("invalid format");
}
#endif
static char *audio_strbuf = NULL; /* previous name "strbuf" collides with Mac OSX global! */
static void pprint(const char *str);
......@@ -2405,7 +2390,7 @@ static int alsa_audio_open(int ur_dev, int srate, int chans, int format, int siz
if (alsa_trace)
mus_print("%s: %x rate=%d, chans=%d, format=%d:%s, size=%d",
c__FUNCTION__, ur_dev, srate, chans, format,
mus_audio_format_name(format), size);
mus_data_format_to_string(format), size);
card = MUS_AUDIO_SYSTEM(ur_dev);
device = MUS_AUDIO_DEVICE(ur_dev);
......@@ -2420,7 +2405,7 @@ static int alsa_audio_open(int ur_dev, int srate, int chans, int format, int siz
{
return(alsa_mus_error(MUS_AUDIO_FORMAT_NOT_AVAILABLE,
mus_format("could not change %s<%d> to alsa format",
mus_audio_format_name(format), format)));
mus_data_format_to_string(format), format)));
}
alsa_name = (alsa_stream == SND_PCM_STREAM_PLAYBACK) ? alsa_playback_device_name : alsa_capture_device_name;
......@@ -2984,9 +2969,9 @@ int mus_audio_open_output(int ur_dev, int srate, int chans, int format, int size
{
if (dev == MUS_AUDIO_SPEAKERS)
/* OR may not be available */
info.play.port = AUDIO_SPEAKER | (sun_default_outputs & AUDIO_HEADPHONE);
info.play.port = AUDIO_SPEAKER | AUDIO_HEADPHONE;
else
info.play.port = sun_default_outputs;
info.play.port = AUDIO_SPEAKER;
}
info.play.sample_rate = srate;
info.play.channels = chans;
......@@ -5868,7 +5853,7 @@ static pid_t jack_mus_player_pid;
static pthread_t jack_mus_watchdog_thread;
static void *jack_mus_audio_watchdog(void *arg){
#if HAVE_JACK
#if MUS_JACK
struct sched_param par;
par.sched_priority = sched_get_priority_max(SCHED_RR);
......@@ -6152,7 +6137,7 @@ static void jack_describe_audio_state_1(void) {
int jack_mus_audio_systems(void) {
return(2);
return(1); /* was 2 which causes lots of problems -- Fernando and Bill 27-Jan-10 */
}
char *jack_mus_audio_moniker(void)
......@@ -6224,7 +6209,7 @@ int mus_audio_open_output(int ur_dev, int srate, int chans, int format, int size
else
RETURN_ERROR_EXIT(MUS_AUDIO_FORMAT_NOT_AVAILABLE, fd,
mus_format("can't set output format to %d (%s) for %d (%s)",
format, mus_audio_format_name(format),
format, mus_data_format_to_string(format),
dev,
mus_audio_device_name(dev)));
}
......@@ -6375,7 +6360,7 @@ int mus_audio_open_input(int ur_dev, int srate, int chans, int format, int size)
else
RETURN_ERROR_EXIT(MUS_AUDIO_FORMAT_NOT_AVAILABLE, fd,
mus_format("can't set input format to %d (%s) on %d (%s)",
format, mus_audio_format_name(format),
format, mus_data_format_to_string(format),
dev,
mus_audio_device_name(dev)));
}
......@@ -7156,17 +7141,26 @@ int mus_audio_read_buffers(int port, int frames, int chans, mus_sample_t **bufs,
void mus_audio_alsa_channel_info(int dev, int *info);
void mus_audio_alsa_channel_info(int dev, int *info)
{
#if HAVE_JACK
info[0] = sndjack_num_read_channels_allocated;
#if MUS_JACK
if (api == MUS_JACK_API)
{
info[0] = sndjack_num_channels_allocated;
return;
}
#endif
#if HAVE_ALSA
if (api == MUS_ALSA_API)
{
alsa_chans(dev, info);
return;
}
#endif
#if HAVE_OSS
info[0] = 2;
#endif
#if HAVE_ALSA && (!MUS_JACK)
alsa_chans(dev, info);
#endif
}
......@@ -7240,14 +7234,21 @@ int mus_audio_alsa_device_direction(int dev)
int mus_audio_device_channels(int dev)
{
#if HAVE_ALSA &(!MUS_JACK)
return(alsa_chans(dev, NULL));
#if MUS_JACK
if (api == MUS_JACK_API)
{
return(sndjack_num_channels_allocated);
}
#endif
#if HAVE_JACK
return(sndjack_num_read_channels_allocated);
#if HAVE_ALSA
if (api == MUS_ALSA_API)
{
return(alsa_chans(dev, NULL));
}
#endif
#if MUS_MAC_OSX
return(osx_chans(dev));
#endif
......@@ -7258,33 +7259,39 @@ int mus_audio_device_channels(int dev)
int mus_audio_compatible_format(int dev) /* snd-dac and sndplay */
{
#if HAVE_ALSA && (!MUS_JACK)
#if HAVE_ALSA
int err, i;
int ival[32];
err = alsa_formats(dev, 32, ival);
if (err != MUS_ERROR)
if (api == MUS_ALSA_API)
{
for (i = 1; i <= ival[0]; i++)
if (ival[i] == MUS_AUDIO_COMPATIBLE_FORMAT)
return(MUS_AUDIO_COMPATIBLE_FORMAT);
for (i = 1; i <= ival[0]; i++)
if ((ival[i] == MUS_BINT) || (ival[i] == MUS_LINT) ||
(ival[i] == MUS_BFLOAT) || (ival[i] == MUS_LFLOAT) ||
(ival[i] == MUS_BSHORT) || (ival[i] == MUS_LSHORT))
return(ival[i]);
for (i = 1; i <= ival[0]; i++)
if ((ival[i] == MUS_MULAW) || (ival[i] == MUS_ALAW) ||
(ival[i] == MUS_UBYTE) || (ival[i] == MUS_BYTE))
return(ival[i]);
return(ival[1]);
err = alsa_formats(dev, 32, ival);
if (err != MUS_ERROR)
{
for (i = 1; i <= ival[0]; i++)
if (ival[i] == MUS_AUDIO_COMPATIBLE_FORMAT)
return(MUS_AUDIO_COMPATIBLE_FORMAT);
for (i = 1; i <= ival[0]; i++)
if ((ival[i] == MUS_BINT) || (ival[i] == MUS_LINT) ||
(ival[i] == MUS_BFLOAT) || (ival[i] == MUS_LFLOAT) ||
(ival[i] == MUS_BSHORT) || (ival[i] == MUS_LSHORT))
return(ival[i]);
for (i = 1; i <= ival[0]; i++)
if ((ival[i] == MUS_MULAW) || (ival[i] == MUS_ALAW) ||
(ival[i] == MUS_UBYTE) || (ival[i] == MUS_BYTE))
return(ival[i]);
return(ival[1]);
}
}
#endif
#if MUS_JACK
return(MUS_COMP_FLOAT);
if (api == MUS_JACK_API)
{
return(MUS_COMP_FLOAT);
}
#endif
return(MUS_AUDIO_COMPATIBLE_FORMAT);
......@@ -7307,14 +7314,25 @@ int mus_audio_device_format(int dev) /* snd-dac snd-xrec snd-grec */
int mixer_vals[16];
int format;
/* we return the new format, so mixer_vals is just a local collector of possible formats */
mixer_vals[0] = 0;
#if HAVE_OSS && (!MUS_JACK)
oss_formats(dev, mixer_vals);
#if HAVE_OSS
if (api == MUS_OSS_API)
oss_formats(dev, mixer_vals);
#endif
#if HAVE_ALSA && (!MUS_JACK)
alsa_formats(dev, 16, mixer_vals);
#if HAVE_ALSA
if (api == MUS_ALSA_API)
alsa_formats(dev, 16, mixer_vals);
#endif
#if MUS_JACK
if (api == MUS_JACK_API)
{
mixer_vals[0] = 1;
mixer_vals[1] = MUS_COMP_FLOAT;
}
#endif
#if HAVE_SUN
......@@ -7339,11 +7357,6 @@ int mus_audio_device_format(int dev) /* snd-dac snd-xrec snd-grec */
mixer_vals[3] = MUS_BSHORT;
#endif
#if MUS_JACK
mixer_vals[0] = 1;
mixer_vals[1] = MUS_COMP_FLOAT;
#endif
#if MUS_NETBSD
netbsd_formats(dev, mixer_vals);
#endif
......
......@@ -2,8 +2,6 @@
(provide 'snd-autosave.scm)
(if (not (provided? 'snd-extensions.scm)) (load "extensions.scm"))
(define auto-save-interval 60.0) ;seconds between auto-save checks
(define auto-saving #f)
......
......@@ -31,17 +31,12 @@
#include "clm.h"
#include "clm-strings.h"
#if WITH_RT
#include "rt-various.h"
#define mus_error(...) rt_mus_error(__VA_ARGS__)
#else
#define clm_malloc(Num, What) malloc(Num)
#define clm_malloc_atomic(Num, What) malloc(Num)
#define clm_calloc(Num, Size, What) calloc(Num, Size)
#define clm_calloc_atomic(Num, Size, What) calloc(Num, Size)
#define clm_realloc(Old, NewSize) realloc(Old, NewSize)
#define clm_free(Ptr) free(Ptr)
#endif
#define clm_malloc(Num, What) malloc(Num)
#define clm_malloc_atomic(Num, What) malloc(Num)
#define clm_calloc(Num, Size, What) calloc(Num, Size)
#define clm_calloc_atomic(Num, Size, What) calloc(Num, Size)
#define clm_realloc(Old, NewSize) realloc(Old, NewSize)
#define clm_free(Ptr) free(Ptr)
#if HAVE_GSL
#include <gsl/gsl_complex.h>
......@@ -7839,6 +7834,8 @@ static void flush_buffers(rdout *gen)
if (allocation_failed)
{
mus_long_t old_file_buffer_size = 0;
/* first clean up the mess we made */
for (i = 0; i < gen->chans; i++)
if (addbufs[i])
......@@ -7852,7 +7849,14 @@ static void flush_buffers(rdout *gen)
* and it might fail on the next call (if more chans), so we'll throw an error. We could get
* say 1024 samps per chan, then run through a loop outputting the current buffer, but geez...
*/
mus_error(MUS_MEMORY_ALLOCATION_FAILED, S_mus_file_buffer_size " (" MUS_LD ") is too large: we can't allocate the output buffers!", clm_file_buffer_size);
/* but... if we hit this in with-sound, mus_error calls (eventually) s7_error which sees the
* dynamic-wind and tries to call mus-close, which tries to flush the buffers and we have
* an infinite loop. So, we need to clean up right now.
*/
mus_sound_close_input(fd);
old_file_buffer_size = clm_file_buffer_size;
clm_file_buffer_size = MUS_DEFAULT_FILE_BUFFER_SIZE;
mus_error(MUS_MEMORY_ALLOCATION_FAILED, S_mus_file_buffer_size " (" MUS_LD ") is too large: we can't allocate the output buffers!", old_file_buffer_size);
return;
}
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
# Author: Michael Scholz <mi-scholz@users.sourceforge.net>
# Created: Wed Oct 14 23:02:57 CEST 2009
# Changed: Tue Dec 08 17:35:05 CET 2009
# Changed: Tue Jan 12 00:12:48 CET 2010
# Commentary:
#
......@@ -2054,7 +2054,7 @@ def install_eval_hooks(file, retval, input, hook, &reset_cursor)
reset_cursor.nil? or reset_cursor.call
$exit_hook.add_hook!(file) do | | prompt.reset end
hook.add_hook!(file) do |line|
eval_line << line << "\n"
eval_line = eval_line + line + "\n"
eval_level += Snd_eval.count_level(line)
if eval_level.negative?
eval_level = 0
......@@ -2291,16 +2291,17 @@ end
def verbose_message_string(stack_p, remark, *args)
fmt_remark = format("\n%s", remark)
args.to_a.car = String(args.to_a.car)
str = if args.length < 2
args.car
str = if args.null?
""
elsif args.length == 1
String(args.car)
else
format(*args)
end
str = if str.split(/\n/).length > 1
str.split(/\n/).join(fmt_remark)
else
format("%s%s", remark, args.car)
format("%s%s", remark, str)
end
if $!
str += format("[%s] %s (%s)", rb_error_to_mus_tag.inspect, snd_error_to_message, $!.class)
......@@ -2344,11 +2345,13 @@ def clm_message(*args)
else
format(*args)
end
if provided?(:snd)
clm_print("\n%s", msg)
unless provided?(:snd_nogui)
$stdout.print(msg, "\n")
end
if provided? :snd
if provided? :snd_nogui
clm_print("%s\n", msg)
else
clm_print("\n%s", msg)
end
nil
else
$stdout.print(msg, "\n")
end
......@@ -2357,14 +2360,7 @@ end
# like clm_print(*args), in emacs it prepends msg with a comment sign
def message(*args)
msg = if args.null?
""
elsif args.length == 1
String(args.car)
else
format(*args)
end
clm_message(verbose_message_string(false, "# ", msg))
clm_message(verbose_message_string(false, "# ", *args))
end
# debug(var1, var2) --> #<DEBUG: ClassName: value1, ClassName: value2>
......@@ -2383,7 +2379,7 @@ def debug_trace(*args)
clm_message(verbose_message_string(true, "# "))
end
if provided? :snd then set_snd_input(:snd) end
if provided?(:snd) then set_snd_input(:snd) end
class Snd
class << Snd
......@@ -2428,6 +2424,10 @@ class Snd
end
def message(*args)
clm_message(verbose_message_string(false, "# ", *args))
end
def display(*args)
msg = if args.null?
""
elsif args.length == 1
......@@ -2435,15 +2435,12 @@ class Snd
else
format(*args)
end
clm_message(verbose_message_string(false, "# ", msg))
end
def display(*args)
args[0] = String(args[0])
msg = format(*args)
if snd_input == :snd
snd_print("\n" + msg)
if $VERBOSE then $stdout.print(msg, "\n") end
if provided? :snd_nogui
clm_print("%s\n", msg)
else
clm_print("\n%s", msg)
end
nil
else
$stdout.print(msg, "\n")
......@@ -2470,12 +2467,13 @@ class Snd
end
def debug(*args)
fmt = ""
args.each do |arg|
fmt += format("%s: %s", arg.class, arg.inspect)
fmt += ", "
if args.null?
Snd.message("#<DEBUG>")
elsif args.length == 1
Snd.message("#<DEBUG: %s>", String(args.car))
else
Snd.message("#<DEBUG: %s>", format(*args))
end
Snd.message("#<DEBUG: %s>", fmt.chomp(", "))
end
def debug_trace(*args)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
;;; examples of extensions to Snd's graphics
(provide 'snd-draw.scm)
(if (not (provided? 'snd-extensions.scm)) (load "extensions.scm"))
(define (overlay-rms-env snd chn)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
(pd-inlet 0 'any
(lambda x
(pd-display "Got " x " to inlet 0")))
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.