[CM] Snd 21.9

2021-11-16 Thread bil
Snd 21.9 s7: mainly work on error handling checked: Ubuntu 21.10, notcurses 2.4.5|7|8, sbcl 2.1.10, Fedora 35 Thanks!: Christos Vagias, Woody Douglass ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmd

Re: [CM] *s7* 'cpu-time

2021-11-19 Thread bil
The manpage claims clock is implemented on top of clock_gettime, so I wouldn't expect them to be very different. clock is very slow for some reason, so I went down a level in my_clock (using clock_gettime) mainly for the profiler. I'll use my_clock in the cpu-time calc. _

Re: [CM] Probably a bug with call/cc

2021-12-05 Thread bil
I think this is more a matter of where the repl loop happens. If (main) is not commented out, the next thing is the repl loop waiting for input; if you type Ctrl-D, you get the rest of the continuation stuff: ;; (main) commented out: /home/bil/test/callcc/ asdf hi from c (main) () foo is

Re: [CM] Possible bug in `member`

2021-12-08 Thread bil
Thanks for the bug report! This is an inadvertent shared list -- an over-eager optimizer basically. I'll have to trace it back to where the optimizer made its mistake, but in the meantime, change line 38562 (or thereabouts) in g_member from y = list_1(sc, args); to: y = list_1(sc, copy_proper_

Re: [CM] Possible bug with c-object & openlet

2021-12-20 Thread bil
You need to gc protect the methods -- c_object_set_let does not do that. This is partly for speed and to save space in the gc-protected-objects list, and also because you might create the let holding the methods, then any amount of time might go by before you make an object, so the let has to be

Re: [CM] Installation problem version 22 (21.9?)

2021-12-20 Thread bil
The no-gui Snd tries to load repl.scm for its repl unless you pass -noinit (with -noinit you'll get the world's more annoying repl). To load repl.scm you need to be in a directory with s7.h and maybe some other such files -- I forget what's needed. To get a GUI, you need Motif. Snd used to work

Re: [CM] Installation problem version 22 (21.9?)

2021-12-20 Thread bil
Another possibility is notcurses (which is also changing rapidly, but the changes don't impact Snd or s7 as much). For that you need the notcurses-core library (the full notcurses library requires more than a GByte of ancillary libraries, overkill for a simple repl). Use the configuration switch

Re: [CM] Installation problem version 22 (21.9?)

2021-12-21 Thread bil
Thanks for the info. I'll change --with-gui to be the same as --with-motif. Motif doesn't have pkg-config support, so it's hard to tell whether Motif is available in advance. But --with-gui is going to be confusing in either case. (I was looking for a Gtk replacement for awhile, then other thi

Re: [CM] Reducing S7 'real' precision

2021-12-22 Thread bil
It might work -- I just tried it and got the sorts of errors from s7test.scm that you'd expect, but nothing horrifying. I haven't changed those typedefs in a very long time -- I think s7_int has to be 64 bits. ___ Cmdist mailing list Cmdist@ccrma.stanf

Re: [CM] Bug regarding hooks

2021-12-30 Thread bil
Thanks for the very clear bug report! I don't immediately see what's causing it -- will poke at it tomorrow. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Bug regarding hooks

2021-12-31 Thread bil
Here's a change that might be interesting. Change call_setter (ca line 46598) to: static s7_pointer call_setter(s7_scheme *sc, s7_pointer slot, s7_pointer new_value) { s7_pointer func = slot_setter(slot); if (!is_any_procedure(func)) return(new_value); if (is_c_function(func))

[CM] Snd 22.0

2022-01-01 Thread bil
Snd 22.0: The spectrogram now notices dont-normalize. checked: notcurses 2.4.9|3.0.0 (the latter is needed for nrepl.scm), sbcl 2.1.11 Thanks!: Tito Latini, Chris Chafe, Kjetil Matheussen, Woody Douglass, Christos Vagias ___ Cmdist mailing

Re: [CM] s7_load_c_string_with_environment & windows

2022-01-01 Thread bil
s7_load_c_string_with_environment behaves well in MSVC Thanks for the info! I'll uncomment that procedure in the MSVC case. Another thing that seems like it ought to work in Windows is the dynamic loader, but I don't know what is required. ___ Cmdis

Re: [CM] question about pretty-print and object serialization

2022-01-15 Thread bil
I think the "..." truncation of vectors depends on the (*s7* 'print-length) setting. It's 12 for historical reasons. I think the :readable argument to object->string (and the `W format option) came after write.scm and pretty-print, so pretty-print might not be as complete in that regard. __

Re: [CM] R7RS support

2022-01-17 Thread bil
The with-exception definition in r7rs.scm probably should be (define (with-exception-handler handler thunk) (catch #t thunk (lambda args (apply handler args The define-library code dates from the days (years ago) when s7's define-macro returned the symbol rather than the value. Also, I ap

Re: [CM] TeXmacs & S7

2022-01-17 Thread bil
Thanks for the observations -- I'm glad s7 has worked out reasonably well. On your questions: 1) would it be possible to have lookup_from implemented via some hash table...? Alternatively, can our patch be made into the official version? Currently, s7's optimizer sometimes depends on the

Re: [CM] TeXmacs & S7

2022-01-17 Thread bil
Why not maintain a hash table whose values are offsets into the flat environment? Then it's a cheap branch or two on lookup to see: 1) is there a hash table; 2) should I build one (is the env big enough, and have there been enough lookups). I call that serious overhead. Environments come and

Re: [CM] TeXmacs & S7

2022-01-17 Thread bil
Another idea is inline caching... And probably better than a hash-table, but it's yet another layer in an already complicated process. I might try that just to see what happens -- thanks for the suggestion! ___ Cmdist mailing list Cmdist@ccrma.stanfor

Re: [CM] TeXmacs & S7

2022-01-17 Thread bil
Do I understand you correclty that the patch I implemented break some assumption of your code In general, yes. I'd have to read through the code -- I glanced at it a few months ago, but can't remember any details, except that it struck me as written for Guile 1.8? and perhaps awkward for s7 (so

Re: [CM] TeXmacs & S7

2022-01-18 Thread bil
It's not the size of the environment that matters; look at libgsl.scm (or the timing test tools/tgsl.scm) -- it creates the *libgsl* environment that has about 2600 entries, but lookup_from takes up maybe 2% of the total time). Or tools/tlet.scm which creates an environment with 100 entries,

Re: [CM] R7RS support

2022-01-18 Thread bil
As a beginner, I ask: Do you approve? Yes. (It also made me scared to use the R7RS features!) Do you know if there is a test suite for the r7rs additions? To finish the job, I made the libraries load *implicitly* with … Oh, I assumed the libraries were already loaded -- could you send me

Re: [CM] R7RS support

2022-01-19 Thread bil
Thanks! I'll merge those changes into my version. r7rs.scm can almost pass the chibi r7rs tests -- if I had 2 minutes of uninterrupted time, I'd be done. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmd

Re: [CM] R7RS support

2022-01-21 Thread bil
Thanks. (*s7* 'filenames) should be (*s7* 'file-names). If you don't want the libc stuff, just comment out the (require libc.scm) at the top of the file. I didn't realize that r7rs thinks current-output-port is a built-in parameter object. It isn't in s7 -- sorry.

Re: [CM] Bug in read

2022-01-21 Thread bil
I need to look at this more closely, but at least in this case, you can fix it by changing lines 28669: #if 0 if (*str != 0) port_position(pt) += (k - 1); else port_position(pt) += k; #else port_position(pt) += (k - 1); #endif This passes s7test.scm, but I'm currently s

Re: [CM] Fastest way to copy scheme variables into a shared buffer?

2022-01-22 Thread bil
I'm just wondering what the recommended way would be to store scheme variables in some C memory I'm not sure what you want to do -- could you send me a more detailed description? As Elijah mentions, s7 c-objects are aimed at this, I think, (and c-pointer is the inverse). __

Re: [CM] Fastest way to copy scheme variables into a shared buffer?

2022-01-22 Thread bil
any chance we can get more than a single word of data for c objects? Yes, but I don't see the need. If the s7_cell space is made available to the user, I lose any flexibility in using that space later, and I'll need to add a half-dozen more procedures to the c-object interface: s7_c_object_valu

Re: [CM] Fastest way to copy scheme variables into a shared buffer?

2022-01-22 Thread bil
If the numbers are just integers or just floats, you could use float-vectors or int-vectors (or byte-vector) in s7, and use memcpy to copy the data from the C int64_t or double array (or actually share the data: see s7_float_vector_elements and s7_int_vector_elements). If the inner vectors are all

Re: [CM] R7RS support

2022-01-25 Thread bil
On the guile library filename handling, does any other scheme treat the names that way? I have added the rest of the built-in libaries to r7rs.scm: eval, process-context, case-lambda, lazy, load, and repl. s7 ignores these import statements. (display "hi" (current-error-port)) works for me.

Re: [CM] snd-22.0 won't run on cygwin

2022-01-25 Thread bil
You can run snd -noinit to get around the use of repl.scm, but the error is puzzling -- did you make libc_s7.so on cygwin? Is fileno available in cygwin? I see others asking about it online: maybe use -std=gnu99? ___ Cmdist mailing list Cmdist@ccrma.s

Re: [CM] R7RS support

2022-01-25 Thread bil
Thanks for all that info! I'll fix the r7rs.scm file name stuff, probably tomorrow. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

[CM] Snd 22.1

2022-02-07 Thread bil
Snd 22.1: no major changes checked: notcurses 3.0.2|3|4|5, Ubuntu 22.04 Thanks!: Christos Vagias, Iain Duncan, Rudolf Adamkovic, Woody Douglass ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Bug in (apply set! ..)

2022-02-21 Thread bil
I don't immediately see the bug. apply evaluates all its arguments, and set! evaluates its second argument, so (define x 'foo) (apply set! 'x 'bar ()) becomes (#_set! x bar), but bar is not defined when evaluated by set! Similarly (define bar 'the-bar) (apply set! 'x bar ()) ; bar is n

Re: [CM] Bug in (apply set! ..)

2022-02-21 Thread bil
Maybe it's inconsistent with (apply + a b) where there's only one evaluation of a and b? Hmmm. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] reader macro vector peculiarities

2022-02-22 Thread bil
The #(0 0) business returns a read-time vector That means when you assign it to x, x is now exactly the same vector as is in the reset body, so when you set some element of it via (set! (x...)...) you are changing the vector sitting in the reset function. To avoid this, use (vector 0 0) in reset

Re: [CM] reader macro vector peculiarities

2022-02-22 Thread bil
I forgot to mention that if you set (*s7* 'safety) to 2 or more, these constants are marked as immutable, so you'll get an error if you try to set some element of it. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman

[CM] Snd 22.2

2022-03-11 Thread bil
Snd 22.2: moved s7_apply_* from s7.h to xen.h if DISABLE_DEPRECATED. checked: sbcl 2.2.1|2, notcurses 3.0.6|7 Thanks!: Mike Scholz ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Lint suggests do

2022-03-16 Thread bil
It's mostly stylistic -- I hate named let. But I think a do-loop is nearly always faster in s7 due to its roots in Snd. I can add a flag to control that report if you like. Please let me know of any stupidities in lint -- I use it a lot, but I am set in my ways. ___

Re: [CM] pre-parsing scheme code

2022-03-21 Thread bil
I didn't realize there was such a difference in speed: #include #include #include #include "s7.h" int main(int argc, char **argv) { s7_scheme *s; int i; s = s7_init(); #if 1 for (i = 0; i < 200; i++) s7_eval_c_string(s, "(list 1 2 3)"); #else for (i = 0; i < 200; i++)

Re: [CM] pre-parsing scheme code

2022-03-21 Thread bil
Gah -- I forgot to eval the expression in the second case -- then it's 1600, which is more what I expected. for (i = 0; i < 200; i++) s7_eval(s, s7_list_nl(s, 4, s7_make_symbol(s, "list"),\ s7_make_integer(s, 1), \ s7_make_integer(s, 2),

Re: [CM] pre-parsing scheme code

2022-03-21 Thread bil
Sorry about that repetition -- I seem to have a flakey net connection today -- can't see any squirrels chewing on the cable. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] pre-parsing scheme code

2022-03-21 Thread bil
If you're running the same code many times, it might be worth it to call s7_optimize, save the function it returns, then call that function rather than eval+expression-writing code. There's an example in snd-sig.c. The idea there is that you're running a function over every sample of some sound,

Re: [CM] pre-parsing scheme code

2022-03-21 Thread bil
Here's an example: #include #include #include #include "s7.h" int main(int argc, char **argv) { s7_scheme *s; s7_pfunc f; s7_pointer body; int i; s = s7_init(); body = s7_list_nl(s, 4, s7_make_symbol(s, "list"), \ s7_make_integer(s, 1), \ s

Re: [CM] pre-parsing scheme code

2022-03-22 Thread bil
I added that example to s7.html, and added GC protection for "body". I didn't advertise s7_optimize in the past because I was fiddling with it for a long time. There is also s7_float_optimize which is probably not documented, and others like it in s7.c. If s7_optimize returns NULL, you can fall

Re: [CM] s7_call_with_location

2022-03-22 Thread bil
What are the rules RE: s7_call_with_location? does it work with any applicable object? conversely, how difficult would it be to implement s7_eval_with_location? Yes, it should work with any applicable object. To implement s7_eval_with_location, use the location wrapper code in s7_call_with_loca

Re: [CM] s7_call_with_location

2022-03-22 Thread bil
seems to work so far good -- I'll add it to my version, but I think I'll include the environment argument. Thanks! ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Identify binary plugins

2022-03-23 Thread bil
Thanks, but isn't ELF format specific to Linux? My *.so files on a Mac appear to be something else. Also, can't an ELF file be an executable? ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Identify binary plugins

2022-03-23 Thread bil
I'll add dylib as an acceptable extension. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Identify binary plugins

2022-03-24 Thread bil
Thanks again, but I am not comfortable with this. It means building in magic numbers and assuming that everyone uses them, but I'd like s7 to work anywhere there's a C compiler and (in this context) dlopen, and be able to handle changes in the future without maintaining an ever-growing list of mag

Re: [CM] most efficient way to map over a vector?

2022-04-03 Thread bil
Is there a speed advantage to using float-vector-set! over plain old set! ? Set! as in (set! (v It depends on the context. I think in the loop Elijah posted, there's not much difference. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mai

Re: [CM] loading libc_s7.so

2022-04-12 Thread bil
There has been a response to this issue (noticed in July): https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1409#note_1336015 (I hope I got that right -- issue 1409 at pipewire). ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-ma

Re: [CM] portamento

2022-04-19 Thread bil
I think in the context of sound synthesis, portamento is a glissando between two notes. It would be interesting to get a vocal or violin recording of someone using portamento, and try to imitate it -- I think you'll also need an amplitude envelope. Seashore wrote about it, saying something like

Re: [CM] Possible bug in s7_values

2022-04-21 Thread bil
The printer includes "values" when it is asked to print a list of values that was not spliced into a caller's argument list. It is just trying to be helpful. In the second ("v") case, it gets the values list unhandled by anything, so it includes "values" as a sort of warning. s7_values gives a w

Re: [CM] Possible bug in s7_values

2022-04-21 Thread bil
It would be nice if there was an interface to see if a procedure returned more then one value when called from C. It would be easy to add s7_is_multiple_value, equivalent to s7's internal is_multiple_value macro -- is that what you need? ___ Cmdist ma

[CM] Snd 22.3

2022-04-23 Thread bil
Snd 22.3: s7_eval_with_location s7_apply_n* removed (now in xen.c|h) s7_is_multiple_value checked: notcurses 3.0.8 Thanks!: Daniel Hensel, Woody Douglass, johnm ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/li

Re: [CM] Unicode support

2022-05-04 Thread bil
Currently you need to do the unicode encoding of the bytes by hand, and send them to the terminal: (format *stderr* (string #\xe2 #\x96 #\xa0)) ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Unicode support

2022-05-04 Thread bil
I think in s7.html I was referring to libutf8proc.scm, but I have never actually used that code. There are a few tests of it in s7test.scm. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] S7 questions and libc issue

2022-05-11 Thread bil
That's an interesting project! To answer some of your questions: I think tcc can build s7 statically in linux. Here's an example in Ubuntu: tcc -o s7 s7.c -I. -lm -DWITH_MAIN s7 s7: 9-May-2022 (+ 1 2) 3 The -DWITH_MAIN switch includes a minimal repl, so you don't need repl.c or libc_s7.so.

Re: [CM] S7 questions and libc issue

2022-05-11 Thread bil
By support for types, are you referring to srfi-9 or srfi-99? That stuff is trivial; I'd use lets + methods in s7, but r7rs.scm also has an implementation using vectors. I thought you were referring to typed variables like saying "int i" in C. You'd use a setter for that in s7. __

Re: [CM] portamento

2022-05-11 Thread bil
I wouldn't use a linear envelope for the amplitude and frequency. There are some examples online, but I would get a recording that has the effect you want, and try to mimic it -- that process makes you focus on the details (like is the sweep continuous, is it changing in speed, etc). ___

Re: [CM] S7 questions and libc issue

2022-05-12 Thread bil
Are setters portable? Probably not -- I don't know of any other scheme that has them. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Test coverage

2022-05-12 Thread bil
It may not be quite what you want, but there is the profiler in s7 (profile.scm writes out the data), or the trace code in debug.scm. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] S7 questions and libc issue

2022-05-12 Thread bil
For gcc, use gcc -o s7 s7.c -I. -lm -DWITH_MAIN -DWITH_C_LOADER=0 -pthread -static libc_s7.so gives FFI bindings for a large portion of libc. repl.scm needs it to get raw terminal handlers. The WITH_C_LOADER switch is what you needed, I think. ___ C

Re: [CM] S7 questions and libc issue

2022-05-12 Thread bil
;unbound variable (symbol "\x7f;ELF\x02;\x01;\x01;") This happens if you try to dynamically load an object file but don't have the dynamic loading functions -- when you build it without libdl (WITH_C_LOADER=0 probably). It treats libc_s7.so as a scheme (text) file. r7rs.scm needs the libc stuf

Re: [CM] S7 questions and libc issue

2022-05-14 Thread bil
gcc -o s7 s7.c -I. -lm -DWITH_MAIN -ldl -pthread I sent this is a previous message: gcc -o s7 s7.c -I. -lm -DWITH_MAIN -DWITH_C_LOADER=0 -pthread -static ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinf

Re: [CM] S7 questions and libc issue

2022-05-14 Thread bil
gcc s7.c -o repl -DWITH_MAIN -I. -O2 -g -ldl -lm -Wl,-export-dynamic -Wno-stringop-overflow fernando@linux:~/Builds/S7-scheme/s7> ./s7 r7rs.scm You built the program "repl", then ran "s7". Try running repl. ___ Cmdist mailing list Cmdist@ccrma.stanf

Re: [CM] S7 questions and libc issue

2022-05-14 Thread bil
For tcc, I think you need the -rdynamic and -DWITH_C_LOADER flags: /home/bil/snd-22/ tcc -o s7 s7.c -I. -lm -DWITH_MAIN -ldl -rdynamic -DWITH_C_LOADER /home/bil/snd-22/ s7 s7: 13-May-2022 load /home/bil/snd-22/libc_s7.so failed: /home/bil/snd-22/libc_s7.so: cannot open shared object file: No

Re: [CM] Unexpected behavior of record types in lists

2022-05-17 Thread bil
Thanks for the bug report. I think that was an overlooked name collision in the macro. I haven't tested this much, but here's a possible new version: (define-macro (define-record-type type make ? . fields) (let ((obj (gensym)) (typ (gensym)) (args (map (lambda (field)

Re: [CM] Strange display behavior

2022-05-23 Thread bil
Thanks for the bug report. The display and equal? results come from quasiquote's internal use of append; a couple weeks ago I changed generic append to handle sequences more consistently, and overlooked that problem -- s7test.scm has similar tests, but none that caught that particular case. I'll

Re: [CM] Unicode support

2022-05-23 Thread bil
We just need to send a Unicode string across, from s7 to C to Swift. I thought from your example that you wanted to see a filled square. If you want to encode a sequence of utf8 codepoints (if that is the correct terminology), I think you can use utf8proc_map or maybe utf8proc_encode_char (on e

Re: [CM] Strange display behavior

2022-05-26 Thread bil
(display `(foo . ,(string-append "hello " "there"))) Thanks. This is the other append in g_quasiquote_1 which I meant to check, but got sidetracked -- ca line 67688. I'll put up the fixed version tomorrow. In s7 it displays as (foo . "hello there"). ___

[CM] Snd 22.4

2022-05-29 Thread bil
Snd 22.4: in Snd, johnm got the pulseaudio playback to work. in s7: defined? changed slightly; you may want to add #t=locally defined generic append changed to make sequence handling more consistent, see s7test.scm ca line 10989 for examples checked: Fedora 36 (gcc 12.0), openbsd 7.1 Thank

Re: [CM] (*s7* 'stack)

2022-06-07 Thread bil
Thanks for the very clear test program! I'll check it out. Two things that might help you debug these sorts of bugs: there's a macro SHOW_EVAL_OPS in s7.c -- if it is 1, s7 prints out a ton of detail about what it's doing; and there's a function s7_show_stack that is not static, but also not in

Re: [CM] (*s7* 'stack)

2022-06-07 Thread bil
In normal use, the s7 evaluator pops off irrelevant entries as it calls functions and whatnot, but here everything is happening in C, so, as you suggested, I think s7_call_with_catch does need to pop the stack if it hasn't already been popped; something like: s7.c ca line 50611 else

Re: [CM] possible bug in hook invocation

2022-06-08 Thread bil
This could be a GC problem, but it's a circuitous path if so. Can you send me enough code to try to recreate the segfault? On the other question, a lambda form is only deemed safe if its body is safe. If you hit the segfault in gdb, a stacktrace would be helpful. To see if the GC is the problem,

Re: [CM] possible bug in hook invocation

2022-06-09 Thread bil
It's saying it got a pair (type=1) when it expected a function, and that the cell in question has never been touched by the GC (gc_func=null). Also that the pair in question is straight from the reader (the location business), so this almost has to be an optimizer problem. __

Re: [CM] 22.4: Issues building with pulseaudio

2022-06-11 Thread bil
As you can see from your diff file, pulseaudio_sample_types is in audio.c. I can't tell what configuration switches you use, but as your log shows, you got alsa+jack, and somehow pulseaudio as well -- I don't think this combination will work. Use just --with-pulseaudio. Your mus_config.h file mi

Re: [CM] Suggested r7rs.scm change for get-environment-variable

2022-06-11 Thread bil
Thanks -- I have made that change to my versions. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] Readably printing circular closures

2022-06-11 Thread bil
I think I can distinguish that from (let ((f (lambda () f))) f), and in any case the empty "let" is inelegant. I'll poke at it. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] 22.4: Issues building with pulseaudio

2022-06-11 Thread bil
Choose one. I test a ton of configurations (see tools/testsnd). I don't care what "scales well", and I don't know what "CI" stands for. You were probably getting alsa+jack before -- run snd --version. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu

Re: [CM] out

2022-06-16 Thread bil
When you call (outa i (* 0.5 (oscil gen))) (outb i (* 0.5 (oscil gen))) you're calling the "gen" oscillator twice so you get one sample in outa, then its next sample in outb, etc -- from the channel's point of view it's seeing an oscillator running twice as fast (880 Hz). __

Re: [CM] make-bandpass xcoeffs

2022-06-29 Thread bil
make-bandpass is a wrapper around make-fir-filter, returning an fir-filter generator, so mus-xcoeffs does work with it; there's an example in snd-test.scm around line 7706. make-bandpass is not itself a generator; it returns one. If you look at the code in dsp.scm you'll see (define bandpass fir-f

Re: [CM] make-bandpass

2022-07-01 Thread bil
If the bandpass generator is getting no input, it returns 0.0. Otherwise it returns the output of the bandpass filter (normally audio samples). mus-xcoeffs is an array of filter coefficients -- these are convolved with the input to produce the output, so ;(float-vector-set! v l (bandpass b l))

[CM] Snd 22.5

2022-07-03 Thread bil
Snd 22.5: s7: add vector-typer to return or set the type checking part of the vector element setter, and similarly hash-table-key-typer and hash-table-value-typer checked: sbcl 2.2.5|6 new ghostscript is unhappy with cmn eps files; version 9.55 is unhappy, 9.52 is happy. I think this

Re: [CM] Snd 22.5

2022-07-03 Thread bil
the gs problem is the (atend) indication used with %%BoundingBox -- surely a bug? ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] GC Called recursively

2022-07-11 Thread bil
___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Re: [CM] GC Called recursively

2022-07-11 Thread bil
Are there rules about what can and can't be done in a 'mark' function? Sorry about the empty message -- the cancel button is right next to the send button in raoundcube -- pessimal UI. On the original question -- don't allocate anything in s7 in the mark function -- that could trigger a recursi

Re: [CM] TRACE facility seems broken in 22.5

2022-07-12 Thread bil
It seems to work for me (except for a function with just a rest arg, but that never worked). What was the context? (I think this macro is found only in a couple test files -- the new trace is in debug.scm). ___ Cmdist mailing list Cmdist@ccrma.stanford

Re: [CM] TRACE facility seems broken in 22.5

2022-07-12 Thread bil
save-sound-as: /tmp/snd_34010_7648.snd () why these guessing games? Give me some context, and why you think there's a problem. Are you tracing this function? ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/list

Re: [CM] TRACE facility seems broken in 22.5

2022-07-12 Thread bil
It looks like some-sound is () which will cause save-sound-as to raise an error. If the error isn't caught, it will cause the loop to stop and will return to the top level. I'm guessing the output is from trace as the function is entered, then you hit the error, and the current evaluation is stop

Re: [CM] sandboxing

2022-07-28 Thread bil
Interesting question. My first thought is that you could undefine procedure-source, object->let, funclet, object->string with :readable, rootlet, outlet (in the untrusted environment, like sandbox in stuff.scm), but the list seems to keep getting longer, and blocking format with ~W seems to req

[CM] Snd 22.6

2022-08-08 Thread bil
Snd 22.6 Mostly fixing bugs and making minor optimizations. s7: (random-state) returns the current random-state object. copy can handle random-state objects (but in s7/gmp it's a no-op) checked: sbcl 2.2.7 Thanks!: Anders Vinjar ___ Cmdist mail

Re: [CM] snd on s390x (probably a BigEndian issue)

2022-08-16 Thread bil
Thanks for the bug report. Is this segfault new in version 22.6? Wikipedia says the system/390 was a 32-bit machine, and it's possible s7 doesn't notice -- I depend on compiler macros like SIZEOF_VOID_P. It might help to see the configure output or mus-config.h or a stacktrace at the error.

Re: [CM] snd on s390x (probably a BigEndian issue)

2022-08-16 Thread bil
The error is hit in init_rootlet before the error_hook is set up, so it segfaults when it tries to call the error_hook. The line number given in init_roolet is bogus, so I can't tell where it is. Actually a lot of stuff is messed up. I guess we'll just have to disappoint the IBM mainframe guys.

Re: [CM] fn defined in C returns to wrong place

2022-08-26 Thread bil
*error-hook* is only called if there is no catch; it resets the s7 stack when it returns, so you're back at the top level. My first thought is that you need a catch in convert.scm where you do the s7_call. Maybe I have the wrong model of what's happening. The s7 stack can be viewed via (*s7* 's

Re: [CM] fn defined in C returns to wrong place

2022-08-26 Thread bil
I think where you call s7_read, you want to wrap that in a catch, probably using s7_call_with_catch. There are examples of it in ffitest.c. The only tricky part (I hope) is passing the "port" argument into the thing called by the catch -- the catch "body" function takes no arguments, as in schem

Re: [CM] snd command line

2022-09-01 Thread bil
The workaround for the pipewire problem in Snd (or repl.scm in s7) is to (define stderr-buffered #t) in your Snd init file, or if you're not using one, put that line at the top of repl.scm. I run the no-gui Snd in Ubuntu 22.04, and I think it is using pipewire (/usr/bin/pipewire is reported in

Re: [CM] snd: mouse scroll up/down - zoom in/out (in gnome/gtk?)

2022-09-07 Thread bil
I can only find 5 buttons in gdk-enums.h, and I can't remember what those 5 mean. I'd try googling "gtk scroll wheel" and see if anything useful is out there. "GdkScrollDirection" for example. Good luck. ___ Cmdist mailing list Cmdist@ccrma.stanford.e

Re: [CM] Load S7 source code from `char *`?

2022-09-10 Thread bil
If you have more than one expression, you can use begin. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist

[CM] Snd 22.7

2022-09-13 Thread bil
Snd 22.7 s7: (*s7* 'number-separator) and heap-analyze|scan and stomping on bugs, of course checked: sbcl 2.2.8 Thanks!: Tito Latini, IOhannes Zmoelnig ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinf

Re: [CM] Idea: using handles instead of pointers, s7_clone

2022-09-23 Thread bil
To expand a bit on Elijah's note: I don't think this will reduce cache misses or make objects smaller. To evaluate anything, you have to access the things being evaluated. Most of the points in the article you mention do not apply to s7 -- s7 manages its own memory, the cells are already packed t

<    1   2   3   4   5   6   7   >