From da at liii.pro Wed Jan 1 21:35:28 2025 From: da at liii.pro (Da Shen) Date: Thu, 02 Jan 2025 13:35:28 +0800 Subject: [CM] [SPAM:####] Failed to disable HAVE_OVERFLOW_CHECKS Message-ID: <541f57f8-ba49-4bc0-bbc9-b63e41cd876b.da@liii.pro> In the previous discussion, I tried to enable HAVE_OVERFLOW_CHECKS on msvc but failed. https://cm-mail.stanford.edu/pipermail/cmdist/2024-December/009360.html Since I have found that enable HAVE_OVERFLOW_CHECKS is expensive on MSVC, I decide to disable HAVE_OVERFLOW_CHECKS on Linux and macOS. And currently, it is not possible to disable HAVE_OVERFLOW_CHECKS: #ifndef HAVE_OVERFLOW_CHECKS #if ((defined(__clang__) && (!POINTER_32) && ((__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ >= 4))) || (defined(__GNUC__) && (__GNUC__ >= 5))) #define HAVE_OVERFLOW_CHECKS 1 #else #define HAVE_OVERFLOW_CHECKS 0 #pragma message("no arithmetic overflow checks in this version of s7") /* these are untested */ static bool add_overflow(s7_int A, s7_int B, s7_int *C) {*C = A + B; return(false);} /* #define add_overflow(A, B, C) 0 */ static bool subtract_overflow(s7_int A, s7_int B, s7_int *C) {*C = A - B; return(false);} /* #define subtract_overflow(A, B, C) 0 */ static bool multiply_overflow(s7_int A, s7_int B, s7_int *C) {*C = A * B; return(false);} /* #define multiply_overflow(A, B, C) 0 */ #endif #endif Because it is actually controlled by the compiler and there is no way to disable the compiler flag without patching s7.c. Here is my suggestion: #ifndef HAVE_OVERFLOW_CHECKS // define HAVE_OVERFLOW_CHECKS to 0 or 1 according to compilers #endif #if HAVE_OVERFLOW_CHECKS == 0 static bool add_overflow(s7_int A, s7_int B, s7_int *C) {*C = A + B; return(false);} /* #define add_overflow(A, B, C) 0 */ static bool subtract_overflow(s7_int A, s7_int B, s7_int *C) {*C = A - B; return(false);} /* #define subtract_overflow(A, B, C) 0 */ static bool multiply_overflow(s7_int A, s7_int B, s7_int *C) {*C = A * B; return(false);} /* #define multiply_overflow(A, B, C) 0 */ #endif -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Thu Jan 2 05:44:51 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Thu, 02 Jan 2025 05:44:51 -0800 Subject: [CM] =?utf-8?b?W1NQQU06IyMjI10gRmFpbGVkIHRvIGRpc2FibGUgSEFWRV9P?= =?utf-8?q?VERFLOW=5FCHECKS?= In-Reply-To: <541f57f8-ba49-4bc0-bbc9-b63e41cd876b.da@liii.pro> References: <541f57f8-ba49-4bc0-bbc9-b63e41cd876b.da@liii.pro> Message-ID: HAVE_OVERFLOW_CHECKS is not defined by the compilers. You can see what is defined by touch foo.h cpp -dM foo.h where foo.h should be empty. To build s7 without overflow checks in gcc/linux: gcc s7.c -c -I. -DHAVE_OVERFLOW_CHECKS=0 -ldl -lm -Wl,-export-dynamic Then, (using the repl based on that s7): <1> (+ 9223372036854775807 1) -9223372036854775808 whereas with those checks: <1> (+ 9223372036854775807 1) 9223372036854776000.0 s7test.scm will also show many other differences. From da at liii.pro Thu Jan 2 07:45:01 2025 From: da at liii.pro (Da Shen) Date: Thu, 02 Jan 2025 23:45:01 +0800 Subject: [CM] =?utf-8?q?Share_the_snippets_for_setting_the_code_page_to_UT?= =?utf-8?q?F-8_on_Windows?= Message-ID: Here are the snippets: #ifdef _MSC_VER #include SetConsoleOutputCP(65001); // Set console output code page to UTF-8 #endif Currently, the console output code page has not been set to UTF-8 for S7 on Windows. If you want to make the following code display as expected in the windows console: (display "??") You will have to SetConsoleOutputCP in your S7 based application. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Fri Jan 3 05:56:23 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Fri, 03 Jan 2025 05:56:23 -0800 Subject: [CM] Snd 25.0 Message-ID: Snd 25.0 s7: added s7_function_let as an experiment checked: sbcl 2.4.11 Thanks!: Da Shen, Robert Clausecker, chrg From da at liii.pro Tue Jan 7 00:10:52 2025 From: da at liii.pro (Da Shen) Date: Tue, 07 Jan 2025 16:10:52 +0800 Subject: [CM] =?utf-8?q?Share_the_define-macro_implementation_of_typed-def?= =?utf-8?q?ine?= Message-ID: <07424f1b-4848-4669-ae7e-ee632a876cd7.da@liii.pro> Inspired by typed-lambda in S7 Scheme stuff.scm I just implemented typed-define. It is licensed in Apache License by the Goldfish Scheme authors and it is ok for the author to adopt it and re-distribute it in 0 clause BSD license. Here is the code snippets ( it is based on define*, and predicates-based type checking is mandatory ): (define-macro (typed-define name-and-params x . xs) (let* ((name (car name-and-params)) (params (cdr name-and-params))) `(define* (,name ,@(map (lambda (param) (let ((param-name (car param)) (type-pred (cadr param)) (default-value (cddr param))) (if (null? default-value) param-name `(,param-name ,(car default-value))))) params)) ,@(map (lambda (param) (let ((param-name (car param)) (type-pred (cadr param))) `(unless (,type-pred ,param-name) (error 'type-error (string-append "Invalid type for " (symbol->string ',param-name)))))) params) ,x , at xs))) -------------- next part -------------- An HTML attachment was scrubbed... URL: From da at liii.pro Tue Jan 7 00:17:13 2025 From: da at liii.pro (Da Shen) Date: Tue, 07 Jan 2025 16:17:13 +0800 Subject: [CM] =?utf-8?q?Would_you_like_to_use_define-case-class=3F?= Message-ID: <2c720a09-cf18-4a4a-b94a-711cca084c40.da@liii.pro> I was a Scala programmer before. In Scala, case class is widely adopted for data processing. I just implemented the equiv of case class in Goldfish Scheme and packaged it in the (liii case) R7RS library: https://github.com/LiiiLabs/goldfish/blob/main/goldfish/liii/case.scm Here are sample usages of define-case-class. Sample code 1: simplest use case ---------------------------------------------------------- (define-case-class person ((name string? "Bob") (age integer?))) (let1 bob (person :name "Bob" :age 21) (check (bob 'name) => "Bob") (check (bob 'age) => 21) (check ((bob :name "hello") 'name) => "hello") (check-catch 'value-error (bob 'sex)) (check-true (person? bob))) (check-true (person=? (person "Bob" 21) (person "Bob" 21))) (check-false (person=? (person "Bob" 21) (person "Bob" 20))) (check-catch 'type-error (person 1 21)) -------------------------------------------------------------------------- Note: let1 is the simplified version of let in the (liii base) library Sample code 2: Use case class with pattern matching --------------------------------------------------------------------------------- (let ((bob (person "Bob" 21)) (get-name (lambda (x) (case* x ((#) (x 'name)) (else (???)))))) (check (get-name bob) => "Bob") (check-catch 'not-implemented-error (get-name 1))) ------------------------------------------------------------------------------------ Note: (???) means (error 'not-implemented-error), it comes for Scala Sample code 3: Use case class with companion functions ------------------------------------------------------------------------------------ (define-case-class jerson ((name string?) (age integer?)) (define (to-string) (string-append "I am " name " " (number->string age) " years old!")) (define (greet x) (string-append "Hi " x ", " (to-string))) ) ----------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From HerbertGrimsby at protonmail.com Mon Jan 6 12:25:55 2025 From: HerbertGrimsby at protonmail.com (Jenweil) Date: Mon, 06 Jan 2025 20:25:55 +0000 Subject: [CM] 2 Qs: snd playing sound serially, and also terminal output suppression Message-ID: I'm trying to drive IBM Selectric sounds using emacs with snd. I have a working prototype, but 1. Sounds are playing sequentially using (play "file.wav"), but I'd like the audio to be able to "overlap". 2. I'd like the ability to toggle terminal output interactively (or noninteractively works too). Behavior is different from the binary from my package manager, and the sources. I thought my question would make a lot more sense visually: https://youtu.be/plO-r4NhCOc In the video I show how I'm using comint, but the issues are the same when running snd through terminal. My package archive binary on arch does let audio mix when using (play "file.wav"). Thanks so much! Sent with [Proton Mail](https://proton.me/mail/home) secure email. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Tue Jan 7 13:19:27 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 07 Jan 2025 13:19:27 -0800 Subject: [CM] Share the define-macro implementation of typed-define In-Reply-To: <07424f1b-4848-4669-ae7e-ee632a876cd7.da@liii.pro> References: <07424f1b-4848-4669-ae7e-ee632a876cd7.da@liii.pro> Message-ID: <36185cb0d4d9cbb2fa323f3f87efdbf6@ccrma.stanford.edu> Thanks very much for the macro! I'm not sure whether to include it in the s7 tarball. In CL's "the" special form, the type precedes the value (as in your macro), but in typed-let it follows the value. I was thinking that the type is optional in scheme, so it should not be required. Having two ways to do it seems like it will invite confusion. From bil at ccrma.Stanford.EDU Tue Jan 7 13:41:47 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 07 Jan 2025 13:41:47 -0800 Subject: [CM] 2 Qs: snd playing sound serially, and also terminal output suppression In-Reply-To: References: Message-ID: <65af7c3225bf8d2e0a4a8ef33760d9fb@ccrma.stanford.edu> To answer your question in the video about a community: I don't think there is one. Can you tell what configuration options arch used to build snd? Perhaps run snd, and look at the *features* variable, but I think not all configuration info gets included there. (I'm thinking maybe you need Jack or Alsa to get it to mix). Now I've forgotten the other question. Or maybe they're using the scheme repl (repl.scm) rather than the "dumb" built-in repl. From bil at ccrma.Stanford.EDU Tue Jan 7 13:47:45 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 07 Jan 2025 13:47:45 -0800 Subject: [CM] 2 Qs: snd playing sound serially, and also terminal output suppression In-Reply-To: References: Message-ID: <77f5447af814c49de93cd0adf900b73d@ccrma.stanford.edu> I think they're using --with-jack (and --with-gmp which makes little sense for Snd). From bil at ccrma.Stanford.EDU Tue Jan 7 13:51:43 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 07 Jan 2025 13:51:43 -0800 Subject: [CM] 2 Qs: snd playing sound serially, and also terminal output suppression In-Reply-To: References: Message-ID: <231ed833cdde0ef8a916339dc9a8a97e@ccrma.stanford.edu> On the question, how do people search the cmdist archives? They don't -- we use mailman or something, and the only way to search is to get the monthly tarballs and search them! From zmoelnig at iem.at Tue Jan 7 22:56:28 2025 From: zmoelnig at iem.at (=?ISO-8859-1?Q?IOhannes_m_zm=F6lnig?=) Date: Wed, 08 Jan 2025 07:56:28 +0100 Subject: [CM] Useful options for packaging and (Re: 2 Qs: snd playing sound serially, and also terminal output suppression) In-Reply-To: <77f5447af814c49de93cd0adf900b73d@ccrma.stanford.edu> References: <77f5447af814c49de93cd0adf900b73d@ccrma.stanford.edu> Message-ID: <977BE911-A91B-4F98-A17E-EE7D38064BD6@iem.at> Am 6. J?nner 2025 21:25:55 MEZ schrieb Jenweil : > >Behavior is different from the binary from my package manager, and the sources. > and then Am 7. J?nner 2025 22:47:45 MEZ schrieb bil at ccrma.Stanford.EDU: >I think they're using --with-jack (and --with-gmp >which makes little sense for Snd). > As the main maintainer of the 'snd' packages for the Debian ecosystem, I guess this is directed at me. Personally I have to admit that I am not an avid 'snd' user, so I might miss what makes sense and what does not. In general, I try to make packages maximally useful, by enabling as many build options as possible. For snd, we made out three different usecases: - casual desktop users trying out snd (using pulse audio and a gui) - power desktop users (using JACK and a gui) - headless users (using JACK, but without X) all flavours have flac/speex/ogg/mpg321/timidity and ladspa enabled. All have GMP enabled, as it seemed like a good idea (possibly useful for advanced users) and no harm done. (If it doesn't make sense for snd, I wonder why there is an option to support it in the first place). So i would be very thankful for advice on how to improve the set of "maximally useful" *packaged* snd variants mfg.sfg.jfd IOhannes From bil at ccrma.Stanford.EDU Wed Jan 8 05:50:52 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Wed, 08 Jan 2025 05:50:52 -0800 Subject: [CM] Useful options for packaging and (Re: 2 Qs: snd playing sound serially, and also terminal output suppression) In-Reply-To: <977BE911-A91B-4F98-A17E-EE7D38064BD6@iem.at> References: <77f5447af814c49de93cd0adf900b73d@ccrma.stanford.edu> <977BE911-A91B-4F98-A17E-EE7D38064BD6@iem.at> Message-ID: <8dfeb7c7362439abbe82d681f8a0d2af@ccrma.stanford.edu> > If it doesn't make sense for snd, I wonder why there is > an option to support it Many years ago I got interested in using multiprecision floats in sound synthesis, one of those "what if?" questions that constantly assail me like a cloud of mosquitoes. Rather than think hard and do some arithmetic which was completely out of the question, I implemented it. In the 45 years of Snd's existence (counting its predecessor I wrote in Sail at SAIL), only one other person has expressed even a vague interest in the idea. But that's ok. Maybe someday some lonely soul will wander by, seeking multiprecision enlightenment, and there will be Snd, smiling. From chris.actondev at gmail.com Thu Jan 9 03:16:32 2025 From: chris.actondev at gmail.com (Christos Vagias) Date: Thu, 9 Jan 2025 12:16:32 +0100 Subject: [CM] 2 Qs: snd playing sound serially, and also terminal output suppression In-Reply-To: <231ed833cdde0ef8a916339dc9a8a97e@ccrma.stanford.edu> References: <231ed833cdde0ef8a916339dc9a8a97e@ccrma.stanford.edu> Message-ID: About searching the cmdist archives, I've used https://www.mail-archive.com/cmdist at ccrma.stanford.edu/ plenty of times On Tue, 7 Jan 2025, 22:51 , wrote: > On the question, how do people search the cmdist archives? > They don't -- we use mailman or something, and the only > way to search is to get the monthly tarballs and search them! > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Thu Jan 9 06:00:09 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Thu, 09 Jan 2025 06:00:09 -0800 Subject: [CM] 2 Qs: snd playing sound serially, and also terminal output suppression In-Reply-To: References: <231ed833cdde0ef8a916339dc9a8a97e@ccrma.stanford.edu> Message-ID: <66d5dfa76b900df9dbb5461593cd8aad@ccrma.stanford.edu> I didn't know about that! It seems to go back to Aug 2023. Thanks! From chrghrc at protonmail.com Sat Jan 11 09:09:53 2025 From: chrghrc at protonmail.com (chrg) Date: Sat, 11 Jan 2025 17:09:53 +0000 Subject: [CM] s7 C functions and environments In-Reply-To: References: <9GBhyzUUx4TmGLdi5HKlVQ3Bq2VLxZRxR6hOYitb_vcw_Qh-fGdwyQDW105ahEt96bzcyKHD6weJofmmgNEuGHwgOVLS0ve6HjoMMb_oLgw=@protonmail.com> Message-ID: <1IUtcBM4DcniQ7rSWWF-fAIoZ3vfrr_hIn-3TkbyV4fdP92V4llA41nyXD-A7XoruqsOnKoiR6d2bVJStLQFuIPRpJSQCzAwAHR2rdHASMc=@protonmail.com> > Here's an idea: > > /* tfunc.c */ > #include > > #include > > #include > > #include "s7.h" > > s7_pointer g_f(s7_scheme sc, s7_pointer args) / (f f 12) */ > { > s7_pointer let = s7_function_let(sc, s7_car(args)); > s7_pointer x = s7_symbol_local_value(sc, s7_make_symbol(sc, "x"), > let); > return(s7_make_integer(sc, s7_integer(x) + > s7_integer(s7_cadr(args)))); > } > > s7_pointer make_f(s7_scheme sc, s7_pointer args) / (make-f 1) */ > { > s7_pointer let = s7_sublet(sc, s7_curlet(sc), s7_nil(sc)); > s7_pointer old_curlet = s7_set_curlet(sc, let); > s7_define(sc, let, s7_make_symbol(sc, "x"), s7_car(args)); > s7_pointer f = s7_make_typed_function_with_environment(sc, NULL, g_f, > 2, 0, false, "f", NULL, let); > s7_set_curlet(sc, old_curlet); > return(f); > } > > int main(int argc, char **argv) > { > char buffer[512]; > char response[1024]; > s7_scheme *s7 = s7_init(); > s7_define_function(s7, "make-f", make_f, 1, 0, false, NULL); > while (1) > { > fprintf(stdout, "\n> "); > > fgets(buffer, 512, stdin); > if ((buffer[0] != '\n') || > (strlen(buffer) > 1)) > > { > sprintf(response, "(write %s)", buffer); > s7_eval_c_string(s7, response); > }} > } > > /* > The "g_f" function called in C has no idea which value returned by > make-f is calling it. > So we can get around that by passing it as an argument ("self"?): > > gcc tfunc.c -o tfunc -I. -g3 s7.o -ldl -lm -Wl,-export-dynamic > > tfunc > > > (define f1 (make-f 1)) > > # ; NULL as name above = anonymous function > > > (define f2 (make-f 2)) > > # > > > (f1 f1 3) > > 4 > > > (f2 f2 3) > > 5 > */ Hi, sorry for not replying back in a long time. I had tried this idea too before our discussion, and while I like it, unfortunately it does require the user to call the function in that weird way you show at the end. (there are ways around it, but still...) I am wondering: is there any way in s7 to get the current C function? I've noticed there is a way for normal Scheme functions (*function*), but it doesn't work inside C functions. Also, as a note: I see you've added s7_function_let, I suppose because of our discussion. But I must warn that I noticed there already were other ways to access a C function's let: for example, back when I tried implementing this idea, I used s7_let_ref: that somehow worked even if I passed a C function instead of a real let. Well, I suppose using s7_function_let could be faster due to no checks... From bil at ccrma.Stanford.EDU Sat Jan 11 11:51:32 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 11 Jan 2025 11:51:32 -0800 Subject: [CM] s7 C functions and environments In-Reply-To: <1IUtcBM4DcniQ7rSWWF-fAIoZ3vfrr_hIn-3TkbyV4fdP92V4llA41nyXD-A7XoruqsOnKoiR6d2bVJStLQFuIPRpJSQCzAwAHR2rdHASMc=@protonmail.com> References: <9GBhyzUUx4TmGLdi5HKlVQ3Bq2VLxZRxR6hOYitb_vcw_Qh-fGdwyQDW105ahEt96bzcyKHD6weJofmmgNEuGHwgOVLS0ve6HjoMMb_oLgw=@protonmail.com> <1IUtcBM4DcniQ7rSWWF-fAIoZ3vfrr_hIn-3TkbyV4fdP92V4llA41nyXD-A7XoruqsOnKoiR6d2bVJStLQFuIPRpJSQCzAwAHR2rdHASMc=@protonmail.com> Message-ID: > is there any way in s7 to get the current C function? No. From HerbertGrimsby at protonmail.com Wed Jan 15 11:01:09 2025 From: HerbertGrimsby at protonmail.com (Jenweil) Date: Wed, 15 Jan 2025 19:01:09 +0000 Subject: [CM] Advice on using snd's (play) from another program? Message-ID: Hello, I am driving snd from a comint buffer in emacs, and I was trying to (play "file.mp3"), which gives an error about "unknown sample type: unknown". However, (open-sound "file.mp3") does work, and I've noticed snd does create a new file, "file.mp3.snd". It also gives a sound object in the repl printout like: #. Where I can (play 0) and hear sound. This seems to be expected behavior and maybe part of snd's design, that (play) wouldn't work off the bat, but (open-sound) would. This presents a couple obstacles and I'd love advice on any of the following: - I'm bad at scheme currently. One area I struggle with is tooling--I don't know how to autocomplete for symbols. Or step-through debug. I am used to elisp's debugger. - In my usecase, I'm using user supplied filenames, and mainly using snd programatically. In order to support events where I might call (play), should I write a layer to map sound files to indices? (I'm assuming snd always starts from 0 and auto-increments as new sounds are loaded). This feels brittle because I'm not sure the speed at which I send commands is going to always allow the scheme repl to return a string to me, before the next time emacs sends a command. Is there a way to always state which sound id (like 0, 1, 2, 3) a sound should get, so I can avoid repl parsing? - I've tried to get around this issue by using a documented hook: start-playing-hook The idea is that 1) I intercept before the sound starts playing, 2) look at the file name, and 3) "redirect" the playing to "file.mp3.snd" if it is an mp3. This approach doesn't work for unopened sounds I try to play (it shows an error): #+begin_src scheme (define (my-hook hook) (let* ((snd (hook 'snd))) ;; an error will occur, as calling file-name in this sound object ;; will fail for a sound called by (play) that has not loaded ;; even if it is a supported, playable .wav file (display (file-name snd)) (display "\n") ;; (let ((ext (strrchr fd 46))) ; 46 is . in ascii ;; (when (string=? ext ".mp3") ;; (play (open-sound (append fd ".snd"))))) )) (hook-push start-playing-hook my-hook) #+end_src Apparently I cannot get the file-name this way. (sound-properties snd) will also fail. I was unsure how to view all the properties within this object. If I print the sound object it shows # - I've also noticed snd likes to reread files from disk. I've observed this when I have a "file.wav" opened, but as a test, rename it to "file.wav.bak". snd will play it through it's sound id (play 1), but sometime later, it won't play because it says it cannot find it. Further, if I play an opened sound from (play "file.wav"), rename the file, it won't play because it cannot find it. It's not a huge deal, but ideally for performance I'd like to avoid re-reading from disk, and keep everything in memory Thanks so much! All your wisdom is appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Thu Jan 16 07:01:48 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Thu, 16 Jan 2025 07:01:48 -0800 Subject: [CM] =?utf-8?q?Advice_on_using_snd=27s_=28play=29_from_another_pr?= =?utf-8?q?ogram=3F?= In-Reply-To: References: Message-ID: Here are a few observations (I'll look at this later after breakfast): Snd uses mpg321 (or mpg123) to translate an mp3 file into a format it can read, so before Snd can play the mp3 file, it needs to be translated (via open-sound for example). I think the new output file in this case has a .wav extension. Snd can play other formats without calling open-sound first. You can preload sound files via mus-sound-preload (see extsnd.html), but if you're renaming files right and left, I don't know what will happen. If you just play a file, and there is no sound object for it in Snd (from open-sound etc), there's no object for the start-playing-hook to pass the hook function. Snd should have a better error message in that case. From bil at ccrma.Stanford.EDU Thu Jan 16 13:03:52 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Thu, 16 Jan 2025 13:03:52 -0800 Subject: [CM] =?utf-8?q?Advice_on_using_snd=27s_=28play=29_from_another_pr?= =?utf-8?q?ogram=3F?= In-Reply-To: References: Message-ID: > I'd like to avoid re-reading from disk, and keep everything in memory Linux, and maybe other OS's, caches files in memory. > I don't know how to autocomplete for symbols If you're using Snd's listener, use the tab key when the cursor is at the end of the symbol-to-be-completed. I don't understand the question about "repl parsing"; you can give the index directly to play: (play 1), or the sound object, or the file name. From HerbertGrimsby at protonmail.com Fri Jan 17 07:37:02 2025 From: HerbertGrimsby at protonmail.com (Jenweil) Date: Fri, 17 Jan 2025 15:37:02 +0000 Subject: [CM] Advice on using snd's (play) from another program? In-Reply-To: References: Message-ID: Thanks for your response. I hadn't considered the file system caching for me in this case. The symbol autocomplete in the listener works great. One drawback, which might be because I'm on wayland, is that I cannot seem to copy and paste though (I found a similar issue https://www.mail-archive.com/cmdist at ccrma.stanford.edu/msg06431.html). I also tried to set a bigger font size, but it hasn't been working. I tried: (set! (listener-font) "Noto Sans") (set! (listener-font) "-*-helvetica-bold-r-*-*-20-*-*-*-*-*-*-*") They don't seem to have the desired effect. When I bring up the preferences panel, font can be set in the "listener options" section but remains "". Briefly, a message "Can't find fonts" shows up in the text box before disappearing. Perhaps I have misconfigured snd as to where to find fonts? Maybe this is an X/Motif thing, as I am on Wayland. Regardless, the symbol completion is really nice in the listener. On Thursday, January 16th, 2025 at 2:03 PM, bil at ccrma.Stanford.EDU wrote: > > I'd like to avoid re-reading from disk, and keep everything in memory > > > Linux, and maybe other OS's, caches files in memory. > > > I don't know how to autocomplete for symbols > > > If you're using Snd's listener, use the tab key when the cursor is > at the end of the symbol-to-be-completed. > > I don't understand the question about "repl parsing"; you can give the > index directly to play: (play 1), or the sound object, or the file name. From HerbertGrimsby at protonmail.com Fri Jan 17 07:43:19 2025 From: HerbertGrimsby at protonmail.com (Jenweil) Date: Fri, 17 Jan 2025 15:43:19 +0000 Subject: [CM] Advice on using snd's (play) from another program? In-Reply-To: References: Message-ID: > I don't understand the question about "repl parsing"; you can give the > index directly to play: (play 1), or the sound object, or the file name. Sorry, I meant parsing from the listener. I like that (open-sound ...) gives me back a handle, and that the printed form shows what I can use to play. In your example, I would have gotten back a "#", so my naive approach would be to parse that string in comint, get the "1", and store it along with the file name, so I know to execute (play 1), when I want to play "file.wav". Is it possible to explicitly set which number I get back? Or somehow programmatically assign which number gets mapped to which sound file I open? Thanks again for all your generous help. On Thursday, January 16th, 2025 at 2:03 PM, bil at ccrma.Stanford.EDU wrote: > > I'd like to avoid re-reading from disk, and keep everything in memory > > > Linux, and maybe other OS's, caches files in memory. > > > I don't know how to autocomplete for symbols > > > If you're using Snd's listener, use the tab key when the cursor is > at the end of the symbol-to-be-completed. > > I don't understand the question about "repl parsing"; you can give the > index directly to play: (play 1), or the sound object, or the file name. From bil at ccrma.Stanford.EDU Fri Jan 17 12:07:38 2025 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Fri, 17 Jan 2025 12:07:38 -0800 Subject: [CM] =?utf-8?q?Advice_on_using_snd=27s_=28play=29_from_another_pr?= =?utf-8?q?ogram=3F?= In-Reply-To: References: Message-ID: <8abb9e5255f941d4f0bf99ca27a7c282@ccrma.stanford.edu> I think Snd uses XListFonts or some X11 procedure to find fonts. I'll have to see how Wayland handles it. You can just ignore Snd's file index, and make a vector that holds sound objects putting each at whatever index you want in the vector, then access each by indexing through the vector. From treegestalt at gmail.com Wed Jan 22 20:44:21 2025 From: treegestalt at gmail.com (Forrest Curo) Date: Wed, 22 Jan 2025 20:44:21 -0800 Subject: [CM] Trying to compile Grace common music for another computer. Message-ID: Seems to be hanging on the flac audio format... How to bypass this? ==== Building juce (debug) ==== juce_audio_devices.cpp juce_audio_formats.cpp In file included from juce/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp:69, from juce/modules/juce_audio_formats/juce_audio_formats.cpp:110: juce/modules/juce_audio_formats/codecs/flac/libFLAC/bitreader.c: In function ?void juce::FlacNamespace::crc16_update_word_(FLAC__BitReader*, uint32_t)?: juce/modules/juce_audio_formats/codecs/flac/libFLAC/bitreader.c:95:27: warning: ISO C++17 does not allow ?register? storage class specifier [-Wregister] 95 | register unsigned crc = br->read_crc16; | ^~~ In file included from juce/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp:70: juce/modules/juce_audio_formats/codecs/flac/libFLAC/bitwriter.c: In function ?juce::FlacNamespace::FLAC__bool juce::FlacNamespace::FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter*, FLAC__uint32, unsigned int)?: juce/modules/juce_audio_formats/codecs/flac/libFLAC/bitwriter.c:307:27: warning: ISO C++17 does not allow ?register? storage class specifier [-Wregister] 307 | register unsigned left; | ^~~~ In file included from juce/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp:76: juce/modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c: At global scope: juce/modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c:65:39: error: ?long int juce::FlacNamespace::lround(double)? conflicts with a previous declaration 65 | static inline long int lround(double x) { | ^ In file included from /usr/include/features.h:502, from /usr/include/sched.h:22, from juce/modules/juce_audio_formats/../juce_core/native/juce_BasicNativeHeaders.h:168, from juce/modules/juce_audio_formats/juce_audio_formats.cpp:38: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:323:1: note: previous declaration ?long int lround(double)? 323 | __MATHDECL (long int,lround,, (_Mdouble_ __x)); | ^~~~~~~~~~ juce/modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c: In function ?int juce::FlacNamespace::FLAC__lpc_quantize_coefficients(const FLAC__real*, unsigned int, unsigned int, FLAC__int32*, int*)?: juce/modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c:218:35: error: call of overloaded ?lround(juce::FlacNamespace::FLAC__double&)? is ambiguous 218 | q = lround(error); | ~~~~~~^~~~~~~ In file included from juce/modules/juce_audio_formats/../juce_audio_basics/../juce_core/system/juce_StandardHeader.h:66, from juce/modules/juce_audio_formats/../juce_audio_basics/../juce_core/juce_core.h:143, from juce/modules/juce_audio_formats/../juce_audio_basics/juce_audio_basics.h:28, from juce/modules/juce_audio_formats/juce_audio_formats.h:28, from juce/modules/juce_audio_formats/juce_audio_formats.cpp:39: /usr/include/c++/13/cmath:2384:3: note: candidate: ?constexpr long int std::lround(long double)? 2384 | lround(long double __x) | ^~~~~~ /usr/include/c++/13/cmath:2380:3: note: candidate: ?constexpr long int std::lround(float)? 2380 | lround(float __x) | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/mathcalls.h:323:1: note: candidate: ?long int lround(double)? 323 | __MATHDECL (long int,lround,, (_Mdouble_ __x)); | ^~~~~~~~~~ juce/modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c:65:24: note: candidate: ?long int juce::FlacNamespace::lround(double)? 65 | static inline long int lround(double x) { | ^~~~~~ juce/modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c:247:35: error: call of overloaded ?lround(juce::FlacNamespace::FLAC__double&)? is ambiguous 247 | q = lround(error); | ~~~~~~^~~~~~~ /usr/include/c++/13/cmath:2384:3: note: candidate: ?constexpr long int std::lround(long double)? 2384 | lround(long double __x) | ^~~~~~ /usr/include/c++/13/cmath:2380:3: note: candidate: ?constexpr long int std::lround(float)? 2380 | lround(float __x) | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/mathcalls.h:323:1: note: candidate: ?long int lround(double)? 323 | __MATHDECL (long int,lround,, (_Mdouble_ __x)); | ^~~~~~~~~~ juce/modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c:65:24: note: candidate: ?long int juce::FlacNamespace::lround(double)? 65 | static inline long int lround(double x) { | ^~~~~~ In file included from juce/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp:77: juce/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c: In function ?void juce::FlacNamespace::FLAC__MD5Transform(FLAC__uint32*, const FLAC__uint32*)?: juce/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c:55:31: warning: ISO C++17 does not allow ?register? storage class specifier [-Wregister] 55 | register FLAC__uint32 a, b, c, d; | ^ juce/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c:55:34: warning: ISO C++17 does not allow ?register? storage class specifier [-Wregister] 55 | register FLAC__uint32 a, b, c, d; | ^ juce/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c:55:37: warning: ISO C++17 does not allow ?register? storage class specifier [-Wregister] 55 | register FLAC__uint32 a, b, c, d; | ^ juce/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c:55:40: warning: ISO C++17 does not allow ?register? storage class specifier [-Wregister] 55 | register FLAC__uint32 a, b, c, d; | ^ juce/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c: In function ?void juce::FlacNamespace::format_input_(FLAC__byte*, const FLAC__int32* const*, unsigned int, unsigned int, unsigned int)?: juce/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c:276:30: warning: ISO C++17 does not allow ?register? storage class specifier [-Wregister] 276 | register FLAC__int32 a_word; | ^~~~~~ juce/modules/juce_audio_formats/codecs/flac/libFLAC/md5.c:277:30: warning: ISO C++17 does not allow ?register? storage class specifier [-Wregister] 277 | register FLAC__byte *buf_ = buf; | ^~~~ make[1]: *** [juce.make:168: obj/juce/Debug/juce_audio_formats.o] Error 1 make: *** [Makefile:21: juce] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From treegestalt at gmail.com Thu Jan 23 16:49:31 2025 From: treegestalt at gmail.com (Forrest Curo) Date: Thu, 23 Jan 2025 16:49:31 -0800 Subject: [CM] problems compiling Grace Message-ID: I've found the more recent instructions at https://github.com/ricktaube/grace and they appear to be working up the point where make is asking for a path to webkit2gtk-4.0 What I have instead seems to be webkit2gtk-4.1; and make is not accepting that: "export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/" "$ make -f LinuxMakefile/Makefile Grace Package webkit2gtk-4.0 was not found in the pkg-config search path." (?) Forrest Curo San Diego -------------- next part -------------- An HTML attachment was scrubbed... URL: