argh I clicked the wrong damn button
(define (jiffies-per-second) 10)
(define (current-jiffy)
(with-let *libc*
(let ((res (clock_gettime CLOCK_MONOTONIC)))
(+ (* 10 (cadr res)) (caddr res)
(define (current-second) (* 1.0 ((*libc* 'time) (c-pointer 0
'time_t*
For awhile the thing currently called (*s7* 'cpu-time)
was returning the wall clock time by accident. I
think the r7rs.scm functions should be:
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
Thanks very much! I'll merge those changes into my version.
(It may take a day or two).
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
That was the way Rick Taube wanted it back around 2010 (he
was writing Grace, a GUI version of his CommonMusic). I
can probably add a string output choice -- will look at it
later.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
Thanks very much for the bug report. If this is a recent
version of s7 (see S7_DATE in s7.h), I think the problem is
that the MSVC version of the code calls unbound_variable
where everyone else returns NULL. I don't have access to
a machine running MSVC, and I can't remember now why the
two
Wow! That's a lot of work! What would be the best way to include this
in sndlib? I don't have a git site for that library -- just the
libraries
at the ccrma ftp site. I don't often change the sndlib files (except
the s7 files).
___
Cmdist mailing
Sounds good -- whenever you're ready, let me know
what files to include in sndlib, or whatever you want.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
I think some of the newer Motif packages (like post-2012)
need both /usr/include/X11/extensions/Print.h and
/usr/include/X11/bitmaps/gray -- in the latter case I
sometimes have to create the bitmaps directory.
I can send you copies of these files if needed.
There was a time when everyone was
Snd 23.2
the usual minor bugfixes and whatnot.
checked: sbcl 2.3.2
Thanks!: Woody Douglass
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
I think s7_call_with_catch needs to set a jump point for the
sc->longjmp_ok case, but I haven't figured out yet how to
capture the error handler result in all cases.
Here's what I have now:
(ca line 51216)
else
{
declare_jump_info();
TRACK(sc);
store_jump_info(sc);
Snd 23.3
s7: autoload bugfix
checked: sbcl 2.3.3
Thanks!: john M693, Todd Ingalls
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
To keep an environment from the being garbage collected,
assign it to a global variable -- as long as the variable
holds the environment, it will be safe. This won't speed
up the GC. It's possible to make s7 strings that are not
seen at all by the GC (make_permament_string), but it's much
Do you have any suggestions for what one can do to cut GC times down
on a code level when there is a lot of code going?
Avoid creating things unnecessarily, and don't keep large structures
around when they're no longer needed. The (*s7* 'memory-usage)
function can show how many objects of each
Do you need to disallow reading a file? If it's just
creating or altering a file that needs to be blocked,
you could redirect fopen and fwrite (in s7.c) to
functions that raise an error. I don't think s7 uses
creat, open (except with O_RDONLY), or write. Also
build it with WITH_C_LOADER=0 (to
Here's a first stab at it -- put this code at line 1430 or thereabouts
in s7.c (after the error_nr forward declaration), then build s7 with
-DDISABLE_FILE_OUTPUT=1:
#ifndef DISABLE_FILE_OUTPUT
#define DISABLE_FILE_OUTPUT 0
#endif
#if DISABLE_FILE_OUTPUT
static FILE *old_fopen(const char
Original Message
Subject: Re: [CM] S7 integrated in TIC-80, and bug reports
Date: 2023-02-03 10:52
From: b...@ccrma.stanford.edu
To: David St-Hilaire
Would there be a way to give a better error message?
The error message is the third argument to error_nr.
One simple
(sorry about the chaotic state of cmdist -- all my fault).
Original Message
Subject: Re: [CM] S7 integrated in TIC-80, and bug reports
Date: 2023-02-03 10:10
From: David St-Hilaire
To: b...@ccrma.stanford.edu
Hi bil! I implemented your changes and it's working very well. I
Thanks for the info and bug reports. Are you catching
scheme errors or using a repl? In the repl, I get:
(define-macro (test x . args) (list ,@(map car args)))
(test 10 ('x 1) ('y 2))
;unquote (',') occurred outside quasiquote: (test 10 ('x 1) ('y 2))
;(test 10 ('x 1) ('y 2))
; test:
I don't think standard scheme allows set! with a target that is a pair,
or at least I can't find anything about it in r7rs.pdf. In s7,
the target needs a setter.
The jmp_bufs are needed to unwind the C stack if an error is raised.
It might work to make longjmp a no-op -- the stack will grow as
On the first issue, it looks to me like you have
your own map function -- scheme_map is not an s7
function. It is passing a null pointer to s7_integer.
As s7.html explains (under "FFI notes"), the C-side
functions do very little error checking.
___
I forgot to say that I get this from the repl:
(define-macro (test x . args) `(list ,@(map car args)))
(test 10 ('x 1) ('y 2))
'(x y)
On the noreturn problem, I'm using this:
#ifdef _MSC_VER
#define noreturn _Noreturn /* deprecated in C23 */
...
which I got from somewhere online. I wonder
Defining noreturn to nothing is fine; in gcc it makes a
measurable difference in speed, but it's just a minor
optimization. I can't find a compiler feature macro
to tell me I'm running C23.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
Snd 23.1:
clm: Michael Edwards fixed a bug in scentroid.ins.
s7: David St-Hilaire integrated s7 into tic-80.
checked: FC 37, sbcl 2.3.1
Thanks!: David St-Hilaire, Michael Edwards
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
Everything seems to work for me. I'm running on Ubuntu,
using X, not Wayland I think (but I hope that doesn't
matter). I built snd --with-motif --with-gl, opened
a file (oboe.snd), clicked 'f' (for fft) and unclicked
'w' (for time domain wave), went to the Options:Transform options
dialog, set
It works both directions and in both the Motif and
terminal versions for me (I tried it with a terminal
and emacs). The notcurses repl may not work in
this regard -- I'll check later today.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
To get all the current names, use (symbol-table)
in scheme, or s7_symbol_table and s7_for_each_symbol
in C. I can send you the output of
(format #f "~W" (symbol-table))
It's too long to include here (4266 names, 57k bytes).
I guess you already know this, but snd-completion.c
and snd-help.c
I was using mouse selection to test it. I might not
say anything in the Snd docs because it's an X/Motif
thing (i.e. the "clipboard" I think it's called.
Look for "interclient communication" in the X docs,
and XA_PRIMARY). It doesn't work for me on a Mac.
Dave Phillips wrote a tutorial for Snd a long time
ago -- for Snd 6.0 (2003), I think. It eventually got
out of sync with the program, but I still have
a copy -- I can send it to you if you like.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
Snd 23.4
fixed a move-formants bug which also affected bullfrog and leopard-frog
in animals.scm.
checked: FC 38, Ubuntu 23.04, sbcl 2.3.4
Thanks!: johnm, Todd Ingalls
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
One way is to call snd-spectrum using channel->float-vector
to get the data. If you already have the fft data in snd,
you can use the peaks function to write it either to the
listener or a text file.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
I changed this to use default-output-header-type. Snd
used mus-next because it stores data as doubles, and it's
simpler to write/read double samples, but mus-riff does not
support that sample type (or didn't the last time I looked).
So you'll need to use:
(save-region r (format #f
Snd 23.6:
various small improvements and bugfixes in Snd and s7.
checked: sbcl 2.3.7
Thanks!: Kenneth Flak
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
One way is to loop through the channels calling save-sound-as on each,
something like:
(do ((i 0 (+ i 1)))
((= i (channels snd)))
(save-sound-as filename snd :channel i))
where filename needs to be different for each channel.
___
Snd no longer has any recording ability. Originally
there was a simple recorder (although it had great VU
meters), and I could maintain it. But at that time audio
hardware was changing rapidly, especially adding many
more channels. I got many requests for support for
new devices which I did not
In new-effects.scm the only font mentioned that might
be a problem is the "built-in" X font (for stuff like
XC_crosshair). In snd-motif.scm, there are two uses
of the font "9x15" -- this is a very old (but very good)
fixed width font that may now be relegated to the
X miscellaneous fonts
[I forgot to "reply all"]:
In the motif version, XtAppAddInput in snd-motif.c sets get_stdin_string
as the function to call when input is available on stdin. That function
tries to get a full string, then evals it. It doesn't return the value
of the incoming expression -- you have to use the
Snd 23.5
s7: various small bugs and optimizations.
checked: sbcl 2.3.5|6
Thanks!: Anders Vinjar, Todd Ingalls, johnm, Kjetil Matheussen
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
This appears to be some pipe issue with stdin -- if
you run Snd from a terminal, then type expressions
in that terminal, get_stdin_string is called and
the expressions are evaluated, etc. If you call
Snd as a target of a pipe (or whatever the correct
terminology is), it works once, but then
0x76e5bc0f in __GI___poll (fds=0x7fffd790, nfds=1,
timeout=5)
at ../sysdeps/unix/sysv/linux/poll.c:29
I think that you're in XtAppMainLoop waiting for an event;
that is, snd is waiting for you to send input etc.
___
Cmdist mailing
No, I don't know how emacs does it. It used to be going
through the emacs file comint.el, if I remember right.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
Does snd spit out anything like a prefix or exit code or
something through stdout when evaluating an expression,
in addition to the return value?
I don't think so. Is snd still running after you get that
value? Currently snd blocks SIGTTIN and SIGTTOU.
I'm glad you found that -- I was puzzling my way through the
conjure docs -- I know nothing about conjure or neovim.
Another possible problem might be which snd repl you're
using. If you're running the no-gui snd, it's the code
in repl.scm, but I'm not sure which repl is running in
this case --
I just tried it with a file 80 seconds long, and it
worked fine. If you want to use it with a multichannel
file, set channel layout to "separate" -- you can use
the channel layout item in the view menu, or
(set! (channel-style) channels-separate) in the
listener. Or maybe uncheck the "unite"
The short answer is that it's an historical artifact, and
I try not to change s7.h unless it's absolutely necessary.
The long form: the s7_p_* procedures came first when I was
developing the second level of the optimizer, and at that
time I thought I'd always need the s7_scheme* argument, so
That's very impressive! I'll add a pointer to it to s7's README.md.
Thanks!
(The libarb support in s7 was really just for my amusement -- I wanted
to play with the Bessel functions).
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
Ouch! I optimized formant-bank at some point, and broke
that instrument. I think this slower version works:
(definstrument (move-formants start file amp radius move-env
num-formants)
(let* ((frms (make-vector num-formants))
(beg (seconds->samples start))
(dur
I think this is the same problem that Kenneth Flak
reported in July. Here's a portion of my reply:
"... In snd-motif.scm, there are two uses
of the font "9x15" -- this is a very old (but very good)
fixed width font that may now be relegated to the
X miscellaneous fonts package. You may have
to
Snd 24.0:
in s7, fixed various bugs, made a few more optimizations.
checked: sbcl 2.3.11, sbcl 2.4.0
Thanks!: Norman Gray, James Hearon
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
Thanks for the bug report. I have fixed extsnd.html.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
I do not know what the problem is; that code has not
changed in many years. Perhaps you're running Wayland
and it is mixing colors (via a sort of transparency
effect I guess, like happens on a Mac).
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
Snd 23.9:
s7: added optional let argument to immutable? and immutable!
finally added error checks to the tree-* functions
see lint.scm for the previous versions
s7_make_c_pointer_wrapper_with_type
' (apostrophe) now is (#_quote ...) and similarly
for the quasiquote
I'd need to see you sampler code to see what the problem
is, but this sequence works:
;; write a square-wave to test.snd
(with-sound (:output "test.snd" :to-snd #f)
(let ((g (make-square-wave 440.0)))
(do ((i 0 (+ i 1)))
((= i 44100))
(outa i (square-wave g)
;; read it
Is that chdir (haven't had my coffee yet) -- if so,
maybe ((*libc* 'chdir) "new-dir")?
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
Snd 24.1
More optimizations, minor bug fixes, and rewrites.
checked: sbcl 2.4.1
Thanks!: Norman Gray, Andreas Enge
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
Thanks! I added that to the s7 README.md file,
and also added a short section to s7.html.
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
Snd 24.2
mostly work on optimizations in s7
checked: sbcl 2.4.2
Thanks!: James Hearon
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
Snd 24.3:
s7: format now always returns a string (where it used to return #f it
now returns "")
sam.c: bugfixes and improvements thanks to David Jaffe
checked: sbcl 2.4.3
Thanks!: Michael Edwards, Norman Gray, David Jaffe
___
Cmdist mailing list
501 - 557 of 557 matches
Mail list logo