From j_hearon at hotmail.com Fri Oct 1 10:52:57 2021 From: j_hearon at hotmail.com (James Hearon) Date: Fri, 1 Oct 2021 17:52:57 +0000 Subject: [CM] polyoid-partial-amps-and-phases gen Message-ID: Hi, I was looking at "other generators" in generators.scm, and became confused a bit by the example: (with-sound (:clipped #f :channels 2) (let* ((samps 44100) (n 10) (gen (make-noid 1.0 n 'min-peak)) (gen2 (make-oscil n ((polyoid-partial-amps-and-phases gen) (- (length (polyoid-partial-amps-and-phases gen)) 1))))) (do ((i 0 (+ i 1))) ((= i samps)) (outa i (noid gen)) (outb i (oscil gen2))))) I can do something like: (gen2 (make-oscil n 0.25)) ) to get an output, but seems like that polyoid-partial-amps-and-phases gen may be something old or no longer in use? But the example seems interesting in terms of phase so was trying to unravel it to try to understand what it was meant to demonstrate. Regards, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Fri Oct 1 13:01:13 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Fri, 01 Oct 2021 13:01:13 -0700 Subject: [CM] polyoid-partial-amps-and-phases gen In-Reply-To: References: Message-ID: Thanks for the bug report. That example is obsolete; polyoid is now a wrapper around polywave. I didn't notice it because it is commented out. noid and polyoid play games with initial phases -- they were part of the minimum-peak-amplitude project (see sndscm.html#peakphasesdoc). From j_hearon at hotmail.com Sun Oct 3 10:24:01 2021 From: j_hearon at hotmail.com (James Hearon) Date: Sun, 3 Oct 2021 17:24:01 +0000 Subject: [CM] Cmdist Digest, Vol 161, Issue 2 In-Reply-To: References: Message-ID: Hi Bill, re: polyooid-partial-amps-and-phases gen Thank you. I see the sndscm.html#peakphasesdoc now, and that helps explain what the obsolete polyoid-partial-amps-and-phases gen was doing in the phase parameter of an oscillator. Polywave is certainly a deep and fascinating area of Snd for synthesis. Regards, Jim ________________________________ From: cmdist-bounces at ccrma.Stanford.EDU on behalf of cmdist-request at ccrma.Stanford.EDU Sent: Saturday, October 2, 2021 9:00 AM To: cmdist at ccrma.Stanford.EDU Subject: Cmdist Digest, Vol 161, Issue 2 Send Cmdist mailing list submissions to cmdist at ccrma.stanford.edu To subscribe or unsubscribe via the World Wide Web, visit https://cm-mail.stanford.edu/mailman/listinfo/cmdist or, via email, send a message with subject or body 'help' to cmdist-request at ccrma.stanford.edu You can reach the person managing the list at cmdist-owner at ccrma.stanford.edu When replying, please edit your Subject line so it is more specific than "Re: Contents of Cmdist digest..." Today's Topics: 1. Re: polyoid-partial-amps-and-phases gen (bil at ccrma.Stanford.EDU) ---------------------------------------------------------------------- Message: 1 Date: Fri, 01 Oct 2021 13:01:13 -0700 From: bil at ccrma.Stanford.EDU To: James Hearon Cc: "cmdist at ccrma.Stanford.EDU" Subject: Re: [CM] polyoid-partial-amps-and-phases gen Message-ID: Content-Type: text/plain; charset=US-ASCII; format=flowed Thanks for the bug report. That example is obsolete; polyoid is now a wrapper around polywave. I didn't notice it because it is commented out. noid and polyoid play games with initial phases -- they were part of the minimum-peak-amplitude project (see sndscm.html#peakphasesdoc). ------------------------------ _______________________________________________ Cmdist mailing list Cmdist at ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist End of Cmdist Digest, Vol 161, Issue 2 ************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From juanig at ccrma.Stanford.EDU Sun Oct 3 10:25:34 2021 From: juanig at ccrma.Stanford.EDU (Juan I Reyes) Date: Sun, 03 Oct 2021 10:25:34 -0700 Subject: [CM] pipewire Snd and SndLib Message-ID: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> Hi Bill Maybe I should address this issue to Nando also. Been trying 'pipewire' on Fedora34 last weeks and seems useful. Performance seems good and in fact makes one use Jack clients all the time. However, I've been getting warning complaints when I start Snd with Jack or when I use 'sndplay' on the command line: -------------- [] /zap> sndplay new.snd Warning. Cannot connect jack output port 4: "Midi-Bridge:Midi Through:(playback_0) Midi Through Port-0". Warning. Cannot connect jack input port 2: "Midi-Bridge:Midi Through:(capture_0) Midi Through Port-0". [] /zap> -------------- After some digging, for some reason either PipeWire or ALSA seem to lock 'Midi Through Port-0' and Jack is not able to make any connections. Have read PipeWire documentation and there is little about MIDI Ports. Further, I don't know why Snd and 'sndplay" for that matter, want to use MIDI since both are audio applications and only Jack audio connections would be expected. BTW, audio connections work seamlessly. Old Qjackctl patch-bay configurations still work under pipewire. Tried to compile my own version of 'Sndlib' with jack features but when I try to make 'sndplay' complains about a missing 'alsa' library 'libsndlib.a' although 'libsndlib.so' is compiled. Use 'sndplay' all the time not only because you can open almost any type of soundfile headers but because you can play eight or sixteen channels of interleaved audio soundfiles just on the command line. Very useful when you're rendering audio and testing code. Cheers, -- * Juan Reyes From bil at ccrma.Stanford.EDU Sun Oct 3 11:55:40 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 03 Oct 2021 11:55:40 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> References: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> Message-ID: <29be645530c1ed9be7883efc5814b5be@ccrma.stanford.edu> Why is it looking for libsndlib.a? Snd's makefile uses the .o files like io.o, so the library is unneeded. The warning appears to be from sndjack_init in audio.c From juanig at ccrma.Stanford.EDU Sun Oct 3 15:39:17 2021 From: juanig at ccrma.Stanford.EDU (Juan I Reyes) Date: Sun, 03 Oct 2021 15:39:17 -0700 Subject: [CM] pipewire Snd and SndLib Message-ID: Hi Bill, I am not able to find any reference to MIDI in sndjack_init in audio.c. Sorry I am not so that Jack savvy. As far sndplay, on the makefile on the sndplay portion this is what I get: sndplay: $(SNDLIB_HEADERS) $(SNDLIB_O_FILES) sndplay.o $(CC) sndplay.c -o sndplay libsndlib.a $(AUDIO_LIB) $(DEFS) $(CFLAGS) $(SO_FLAGS) $(XEN_CFLAGS) $(JACK_FLAGS) $(JACK_LIBS) $(LIBS) This is what I am doing while trying to make 'sndplay' with Jack. ./configure --with-jack ... checking for audio system... JACK configure: creating ./config.status config.status: creating makefile ... make ... gcc headers.o audio.o io.o sound.o xen.o vct.o clm.o sndlib2xen.o clm2xen.o s7.o -o libsndlib.so -shared -lgsl -lgslcblas -lm -D_REENTRANT -L/usr/lib64/pipewire-0.3/jack -ljack -ljacknet -lsamplerate -lm -ldl : -rc libsndlib.a headers.o audio.o io.o sound.o xen.o vct.o clm.o sndlib2xen.o clm2xen.o s7.o : libsndlib.a make sndplay gcc -c -DHAVE_CONFIG_H -I. -g -O2 -fPIC -D_REENTRANT sndplay.c gcc sndplay.c -o sndplay libsndlib.a -DHAVE_CONFIG_H -I. -g -O2 -fPIC -D_REENTRANT -L/usr/lib64/pipewire-0.3/jack -ljack -ljacknet -lsamplerate -lm -ldl /usr/bin/ld: cannot find libsndlib.a: No such file or directory collect2: error: ld returned 1 exit status make: *** [makefile:70: sndplay] Error 1 [] /zap/sndlib> -- > Why is it looking for libsndlib.a? Snd's makefile > uses the .o files like io.o, so the library is > unneeded. > > The warning appears to be from sndjack_init in audio.c > From bil at ccrma.Stanford.EDU Sun Oct 3 16:18:29 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 03 Oct 2021 16:18:29 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> References: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> Message-ID: <9380af68f29096aa0a56bf5f672e1201@ccrma.stanford.edu> That is the sndlib makefile -- I thought you were using Snd's. It does not create libsndlib.a in the --with-jack case, but still refers to it; that is a bug. I'll look at it tomorrow. Thanks! From bil at ccrma.Stanford.EDU Mon Oct 4 06:18:03 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 04 Oct 2021 06:18:03 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: References: Message-ID: <9608b1adff9d5971b8f1900749609ebd@ccrma.stanford.edu> I'll make a new sndlib tarball in a week or so. In the meantime you can fix configure.ac by commenting out lines 298 and following: # if test "$with_jack" = yes ; then # A_INSTALL=":" # A_LD=":" # fi Run autoconf to remake the configure script. Then, at least in Ubuntu, you need to include the --with-alsa switch to configure. make clean ./configure --with-alsa --with-jack make make sndplay From k.s.matheussen at gmail.com Mon Oct 4 09:24:54 2021 From: k.s.matheussen at gmail.com (Kjetil Matheussen) Date: Mon, 4 Oct 2021 18:24:54 +0200 Subject: [CM] pipewire Snd and SndLib In-Reply-To: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> References: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> Message-ID: Hi Juan, The jack code for libsnd was written before jack MIDI existed, so I didn't think about checking for the correct type. That's why you see an error message about it trying to connect an audio port to a MIDI port. This patch should fix it: http://users.notam02.no/~kjetism/audio.c.diff (Bill, please apply the patch, I've tested it) On Sun, Oct 3, 2021 at 7:27 PM Juan I Reyes wrote: > > > Hi Bill > > Maybe I should address this issue to Nando also. > > Been trying 'pipewire' on Fedora34 last weeks and seems useful. > > Performance seems good and in fact makes one use Jack clients all the > time. > > However, I've been getting warning complaints when I start Snd with Jack > or when I use 'sndplay' on the command line: > > -------------- > > [] /zap> sndplay new.snd > Warning. Cannot connect jack output port 4: "Midi-Bridge:Midi > Through:(playback_0) Midi Through Port-0". > Warning. Cannot connect jack input port 2: "Midi-Bridge:Midi > Through:(capture_0) Midi Through Port-0". > [] /zap> > > -------------- > > After some digging, for some reason either PipeWire or ALSA seem to lock > 'Midi Through Port-0' and Jack is not able to make any connections. > Have read PipeWire documentation and there is little about MIDI Ports. > > Further, I don't know why Snd and 'sndplay" for that matter, want to use > MIDI since both are audio applications and only Jack audio connections > would be expected. BTW, audio connections work seamlessly. Old Qjackctl > patch-bay configurations still work under pipewire. > > Tried to compile my own version of 'Sndlib' with jack features but when > I try to make 'sndplay' complains about a missing 'alsa' library > 'libsndlib.a' although 'libsndlib.so' is compiled. > > > Use 'sndplay' all the time not only because you can open almost any type > of soundfile headers but because you can play eight or sixteen channels > of interleaved audio soundfiles just on the command line. Very useful > when you're rendering audio and testing code. > > > Cheers, > > > -- * Juan Reyes > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist From bil at ccrma.Stanford.EDU Mon Oct 4 10:06:10 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 04 Oct 2021 10:06:10 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: References: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> Message-ID: I have made those changes to my version of audio.c -- thanks very much! I'll update the ccrma versions later today, or maybe tomorrow morning. From juanig at ccrma.Stanford.EDU Mon Oct 4 12:04:18 2021 From: juanig at ccrma.Stanford.EDU (Juan Reyes) Date: Mon, 4 Oct 2021 12:04:18 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: <9608b1adff9d5971b8f1900749609ebd@ccrma.stanford.edu> References: <9608b1adff9d5971b8f1900749609ebd@ccrma.stanford.edu> Message-ID: <74ebb12c-42b3-9796-37a8-9b46b41bccc1@ccrma.stanford.edu> Hi Bill, Thanks a lot for your help and suggestions. Followed your instructions on editing configure.ac but then after autoconf, make clean and ./configure --with-alsa --with-jack, make works fine. However, when I try to make sndplay I'm getting the following: ------ []# make sndplay gcc -c -DHAVE_CONFIG_H -I. -g -O2 -fPIC -D_REENTRANT sndplay.c gcc sndplay.c -o sndplay libsndlib.a -lasound -DHAVE_CONFIG_H -I. -g -O2 -fPIC -D_REENTRANT -L/usr/lib64/pipewire-0.3/jack -ljack -ljacknet -lsamplerate -lm -ldl /usr/bin/ld: libsndlib.a(audio.o): undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' /usr/bin/ld: /usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make: *** [makefile:70: sndplay] Error 1 ------ Checked on libpthread and there is '/usr/lib64/libpthread-2.33.so' Tried './configure --with-jack' on Fedora34 and still get same results. > Run autoconf to remake the configure script.? Then, at least in > Ubuntu, you need to include the --with-alsa switch to configure. > > make clean > ./configure --with-alsa --with-jack > make > make sndplay From juanig at ccrma.Stanford.EDU Mon Oct 4 12:10:31 2021 From: juanig at ccrma.Stanford.EDU (Juan Reyes) Date: Mon, 4 Oct 2021 12:10:31 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: References: <1d6ac735e6a19043aa37be02bb52e6b0@ccrma.stanford.edu> Message-ID: Hi Kjetil, Thanks a lot for your patch and for taking care of the issue. Good explanation also. I'll wait for the new tarball and give it a test (thanks again Bill). -- * Juan From bil at ccrma.Stanford.EDU Mon Oct 4 12:46:57 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 04 Oct 2021 12:46:57 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: <74ebb12c-42b3-9796-37a8-9b46b41bccc1@ccrma.stanford.edu> References: <9608b1adff9d5971b8f1900749609ebd@ccrma.stanford.edu> <74ebb12c-42b3-9796-37a8-9b46b41bccc1@ccrma.stanford.edu> Message-ID: You need to add -lpthread to JACK_LIBS -- not sure why this has to be done by hand. With this change it works in fedora 34. From juanig at ccrma.Stanford.EDU Mon Oct 4 14:26:45 2021 From: juanig at ccrma.Stanford.EDU (Juan Reyes) Date: Mon, 4 Oct 2021 14:26:45 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: References: <9608b1adff9d5971b8f1900749609ebd@ccrma.stanford.edu> <74ebb12c-42b3-9796-37a8-9b46b41bccc1@ccrma.stanford.edu> Message-ID: That's it Bill. Will Kjetil's patch also migrate to Sndlib's audio.c ? Seems to me that they are the same file. Thanks a lot. -- * Juan > You need to add -lpthread to JACK_LIBS -- not sure why this has to > be done by hand. With this change it works in fedora 34. From bil at ccrma.Stanford.EDU Mon Oct 4 15:14:45 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 04 Oct 2021 15:14:45 -0700 Subject: [CM] pipewire Snd and SndLib In-Reply-To: References: <9608b1adff9d5971b8f1900749609ebd@ccrma.stanford.edu> <74ebb12c-42b3-9796-37a8-9b46b41bccc1@ccrma.stanford.edu> Message-ID: <1dc4563947cd38f7ef6f33eb18ccbaf6@ccrma.stanford.edu> > Will Kjetil's patch also migrate to Sndlib's audio.c ? yes. From dev at mobileink.com Fri Oct 8 06:23:17 2021 From: dev at mobileink.com (Gregg Reynolds) Date: Fri, 8 Oct 2021 08:23:17 -0500 Subject: [CM] extending the reader? Message-ID: I've got a peculiar need. Literally: it involves "peculiar" identifiers. I'm using s7 to convert Dune build files to Bazel build files. Dune is the standard build tool for OCaml. Its build language syntax is s-expressions. Unfortunately they are not quite Scheme s-expressions. Here's one I've come across that makes the s7 reader puke: (run %{bin:tezos-protocol-compiler} .) The error message is ";read-error ("unexpected close paren: ... (write (define x '(action .)) ...").." The problem is the isolated '.'; if I change that to './' then it reads just fine. I believe that's because './' is a legal "peculiar identifier" (at least for R7RS) while '.' is not. So my question is: can I extend the reader to accept '.' as a peculiar identifier without breaking things? I'm guessing it would be a simple change if I knew where that code is, but I'm wondering about unintended consequences. Of course I could warn my users that they need to use './' and not '.' (as a directory name), but I think extending the reader would be better. The tool is not intended for general programming, and scripts written for it would have very limited scope, so it's not really critical to have a strictly conformant Scheme. Thanks, Gregg -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Fri Oct 8 07:27:15 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Fri, 08 Oct 2021 07:27:15 -0700 Subject: [CM] =?utf-8?q?extending_the_reader=3F?= In-Reply-To: References: Message-ID: <5bf8bc05438a7ecf7188ae44034969c9@ccrma.stanford.edu> I can't think of a way to do this in scheme code. *read-error-hook* is not currently called at the point of the error (probably line 69449 in s7.c). I suppose it could be called, but I'd need to back out with the new input (if any), which would take a ton of testing. You could change the C code, perhaps -- { s7_pointer pt; pt = current_input_port(sc); fprintf(stderr, "%c\n", port_data(pt)[port_position(pt) - 2]); } at that pointer prints ".", so you know it's reading ".)". You'd need to add the symbol ./ to the current list in the reader, then pop back to whatever was being read before that -- kinda tricky! I'll look into extending *read-error-hook*, but with input like that, there are probably more such gotchas. From dev at mobileink.com Fri Oct 8 09:41:54 2021 From: dev at mobileink.com (Gregg Reynolds) Date: Fri, 8 Oct 2021 11:41:54 -0500 Subject: [CM] extending the reader? In-Reply-To: <5bf8bc05438a7ecf7188ae44034969c9@ccrma.stanford.edu> References: <5bf8bc05438a7ecf7188ae44034969c9@ccrma.stanford.edu> Message-ID: Thanks. Looking at the c code I realized I made an embarrassingly dumb mistake interpreting the error. The problem is not that the reader does not accept '.', but that it expects it to be followed by an expression as in '(a . b)'. So it chokes on '(a .)', as it should. Hacking the C code to accept the latter would obviously be a bad idea. ;) So I'll just catch the error and tell the user to use './' instead of '.'. On the other hand, it would be nice if the error args included the string that caused the error in a more convenient form. It's included in the message string, but it would be nice if it were passed in isolation, like '(:data ...badcode here...)' or some such. Thanks! On Fri, Oct 8, 2021 at 9:27 AM wrote: > I can't think of a way to do this in scheme code. > *read-error-hook* is not currently called at the > point of the error (probably line 69449 in s7.c). > I suppose it could be called, but I'd need to back > out with the new input (if any), which would take > a ton of testing. You could change the C code, > perhaps -- > > { > s7_pointer pt; > pt = current_input_port(sc); > fprintf(stderr, "%c\n", port_data(pt)[port_position(pt) - 2]); > } > > at that pointer prints ".", so you know it's reading > ".)". You'd need to add the symbol ./ to the current > list in the reader, then pop back to whatever was > being read before that -- kinda tricky! > I'll look into extending *read-error-hook*, but with > input like that, there are probably more such gotchas. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elronnd at elronnd.net Fri Oct 8 14:55:15 2021 From: elronnd at elronnd.net (Elijah Stone) Date: Fri, 8 Oct 2021 14:55:15 -0700 (PDT) Subject: [CM] extending the reader? In-Reply-To: References: <5bf8bc05438a7ecf7188ae44034969c9@ccrma.stanford.edu> Message-ID: I suggest making your own reader. It should not be prohibitive, as s-expressions are very regular, and will surely end better than trying to use one language's reader on another. -E From dev at mobileink.com Sat Oct 9 06:00:00 2021 From: dev at mobileink.com (Gregg Reynolds) Date: Sat, 9 Oct 2021 08:00:00 -0500 Subject: [CM] format output to file port fails Message-ID: (let ((opts (stanza-opts stanza)) ;; function returns '(-safe-string) (opts2 '(-safe-string))) (format #t "OPTS: ~A :: ~A" (type-of opts) opts) (newline) (format #t "OPTS2: ~A :: ~A" (type-of opts2) opts2) (newline) (for-each (lambda (opt) (format outp " \"~A\",\n" opt) ;; outp => file (format #t " \"~A\",\n" opt) ) opts) ...) Stdout: OPTS: pair? :: (-safe-string) OPTS2: pair? :: (-safe-string) "-safe-string", File output for for-each over opts2 is "-safe-string", as expected. But there is no file output for for-each over opts. No idea what's going on. Is this a bug, or am I doing something wrong? Thanks Gregg -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sat Oct 9 06:43:42 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 09 Oct 2021 06:43:42 -0700 Subject: [CM] format output to file port fails In-Reply-To: References: Message-ID: Did you close or flush the file port? Normally output is buffered. From dev at mobileink.com Sat Oct 9 07:05:23 2021 From: dev at mobileink.com (Gregg Reynolds) Date: Sat, 9 Oct 2021 09:05:23 -0500 Subject: [CM] format output to file port fails In-Reply-To: References: Message-ID: Thanks, found the problem. On Sat, Oct 9, 2021 at 8:44 AM wrote: > Did you close or flush the file port? Normally output is buffered. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Wed Oct 13 05:37:12 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Wed, 13 Oct 2021 05:37:12 -0700 Subject: [CM] Snd 21.8 Message-ID: Snd 21.8 sndlib: Kjetil updated the Jack support in audio.c. s7: now using __has_include if it is defined (gcc has it) this means mus-config.h is optional in gcc/clang (you don't need an empty file). s7_make_byte_vector and friends (s7.h) added (*s7* 'profile-prefix), a symbol or #f profile-info now includes the file and line-number of the function and the function-local value of (*s7* 'profile-prefix), if any. added support for tcc (Tiny C compiler) -- no dynamic loading yet checked: notcurses 2.4.1|3, sbcl 2.1.9 due to a blizzard of changes in notcurses, nrepl currently needs notcurses version 2.4.3 or later -- sorry for the inconvenience! Thanks!: Iain Duncan, Brad Christensen, Christos Vagias, Woody Douglass, James Hearon, Juan Reyes, Kjetil Matheussen From iainduncanlists at gmail.com Wed Oct 13 07:30:58 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 13 Oct 2021 07:30:58 -0700 Subject: [CM] Snd 21.8 In-Reply-To: References: Message-ID: Thanks Bill! I am planning a Scheme for Max and PureData release in the next month and will try bumping to the latest. Will let you know how it goes. iain On Wed, Oct 13, 2021 at 5:37 AM wrote: > Snd 21.8 > > sndlib: Kjetil updated the Jack support in audio.c. > > s7: now using __has_include if it is defined (gcc has it) > this means mus-config.h is optional in gcc/clang (you > don't need an empty file). > s7_make_byte_vector and friends (s7.h) > added (*s7* 'profile-prefix), a symbol or #f > profile-info now includes the file and line-number of the function > and the function-local value of (*s7* 'profile-prefix), if any. > added support for tcc (Tiny C compiler) -- no dynamic loading yet > > checked: notcurses 2.4.1|3, sbcl 2.1.9 > > due to a blizzard of changes in notcurses, nrepl currently needs > notcurses version 2.4.3 or later -- sorry for the inconvenience! > > Thanks!: Iain Duncan, Brad Christensen, Christos Vagias, Woody Douglass, > James Hearon, Juan Reyes, Kjetil Matheussen > > _______________________________________________ > 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 dev at mobileink.com Mon Oct 18 07:33:13 2021 From: dev at mobileink.com (Gregg Reynolds) Date: Mon, 18 Oct 2021 09:33:13 -0500 Subject: [CM] syntax-rules etc. Message-ID: I've been pilfering some SRFI reference implementation code to fill in some of the gaps in the s7 lib. Unfortunately a lot of that code depends on macros implemented using define-syntax and syntax-rules. Any chance s7 could support define-syntax et al? Alternatively, does anybody have define-macro implementations of the srfi macros? Thanks, gregg -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Mon Oct 18 11:46:33 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 18 Oct 2021 11:46:33 -0700 Subject: [CM] syntax-rules etc. In-Reply-To: References: Message-ID: <12bb593a3373c08eb1762e727afb7f70@ccrma.stanford.edu> > Any chance s7 could support define-syntax et al? No. I think there are r5rs implementations, but I can't remember any names -- ppsyntax? alexandria?? From wdouglass at carnegierobotics.com Tue Oct 19 06:30:13 2021 From: wdouglass at carnegierobotics.com (Woody Douglass) Date: Tue, 19 Oct 2021 13:30:13 +0000 Subject: [CM] Multiple catch syntax Message-ID: <905f256c1d36128f5abc80d33d33b4d5681cd28e.camel@carnegierobotics.com> Hi all, i'm trying to catch multiple errors at once. i've tried a few things, what is the correct syntax for the catch? is it ``` (catch (or 'error-one 'error-two) (lambda () #t) (lambda (type args) #f)) ``` or maybe ``` (catch '(error-one error-two) (lambda () #t) (lambda (type args) #f)) ``` I'm just trying to determine if my syntax is wrong, or there's some other problem in my code... Thanks, Woody From bil at ccrma.Stanford.EDU Tue Oct 19 06:57:57 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 19 Oct 2021 06:57:57 -0700 Subject: [CM] Multiple catch syntax In-Reply-To: <905f256c1d36128f5abc80d33d33b4d5681cd28e.camel@carnegierobotics.com> References: <905f256c1d36128f5abc80d33d33b4d5681cd28e.camel@carnegierobotics.com> Message-ID: <5d21264900d61efca3b8be899cb45951@ccrma.stanford.edu> catch uses eq? to match the tag to the error type -- I can't find any mention of this in s7.html -- will make it explicit. The expected usage for the (or 'a 'b) case would be to have two catches. Kinda ugly, now that I think about it. I borrowed catch from Guile, and now I don't remember if they accepted expressions for the tag. I don't like the r7rs "guard" or whatever they call it -- hmmm. From wdouglass at carnegierobotics.com Tue Oct 19 07:57:37 2021 From: wdouglass at carnegierobotics.com (Woody Douglass) Date: Tue, 19 Oct 2021 14:57:37 +0000 Subject: [CM] Multiple catch syntax In-Reply-To: <5d21264900d61efca3b8be899cb45951@ccrma.stanford.edu> References: <905f256c1d36128f5abc80d33d33b4d5681cd28e.camel@carnegierobotics.com> <5d21264900d61efca3b8be899cb45951@ccrma.stanford.edu> Message-ID: Ok, well in that case i guess i can do ``` (let ((handler (lambda (type args) #f))) (catch 'error-one (catch 'error-two (lambda () #t) handler) handler)) ``` maybe i'll write a macro. `(catch-multiple catchlist thunk handler)` maybe... Thanks, Woody On Tue, 2021-10-19 at 06:57 -0700, bil at ccrma.Stanford.EDU wrote: > catch uses eq? to match the tag to the error type -- > I can't find any mention of this in s7.html -- will > make it explicit. The expected usage for the > (or 'a 'b) case would be to have two catches. > Kinda ugly, now that I think about it. I borrowed > catch from Guile, and now I don't remember if they > accepted expressions for the tag. I don't like > the r7rs "guard" or whatever they call it -- hmmm. > From j_hearon at hotmail.com Tue Oct 26 10:40:43 2021 From: j_hearon at hotmail.com (James Hearon) Date: Tue, 26 Oct 2021 17:40:43 +0000 Subject: [CM] poly questions Message-ID: Hi, Trying to get an understanding of all the interesting aspects of polywave in snd, and chebyshev polynomials, coefficients etc. I was trying to get a squarish wave from the coefficients but failing. Also tried partials->polynomial, and normalize-partials with same result. Wondering what I'm misunderstanding about how you would employ the coefficients for a typical float-vector of partials, and amps for say a square wave? (with-sound (:srate 48000 :channels 1 :play #t) (let ((gen (make-polyshape 100.0 :coeffs (partials->polynomial (float-vector 1 1 3 .33 5 .2 7 .142 9 0.111)) )) ) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .75 (polyshape gen 1.0 )))))) Also, if I can ask more than one question per email, how do you go about using the generators: mus-chebyshev-tu-sum x t-coeffs u-coeffs mus-chebyshev-t-sum x t-coeffs mus-chebyshev-u-sum x u-coeffs I couldn't seem to locate an ex. for those, but I did see the c code in clm.c which is interesting. Thank you, Regards, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Tue Oct 26 13:23:25 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 26 Oct 2021 13:23:25 -0700 Subject: [CM] poly questions In-Reply-To: References: Message-ID: Here's an example using polywave: (let ((g (make-polywave 100 '(1 1 3 1/3 5 1/5 7 1/7 9 1/9) :type mus-chebyshev-second-kind))) (with-sound () (do ((i 0 (+ i 1))) ((= i 44100)) (outa i (polywave g))))) You need to set the type to the second kind to get a sum of sines, rather than cosines. There are examples of the other generators in snd-test.scm. From chris.actondev at gmail.com Tue Oct 26 15:53:11 2021 From: chris.actondev at gmail.com (Christos Vagias) Date: Wed, 27 Oct 2021 00:53:11 +0200 Subject: [CM] MSVC patch Message-ID: Hi Bil, I'm attaching a tiny patch I had to apply in order to build s7 under MSVC. -------------- next part -------------- A non-text attachment was scrubbed... Name: msvc.patch Type: text/x-patch Size: 1049 bytes Desc: not available URL: From bil at ccrma.Stanford.EDU Tue Oct 26 16:19:48 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 26 Oct 2021 16:19:48 -0700 Subject: [CM] MSVC patch In-Reply-To: References: Message-ID: <8664a2540090bb689e5da45faee7b73e@ccrma.stanford.edu> Thanks very much! -- I wondered about that setjmp business. And thanks for the other bugfix -- why doesn't gcc complain about it? From elronnd at elronnd.net Tue Oct 26 16:33:34 2021 From: elronnd at elronnd.net (Elijah Stone) Date: Tue, 26 Oct 2021 16:33:34 -0700 (PDT) Subject: [CM] MSVC patch In-Reply-To: <8664a2540090bb689e5da45faee7b73e@ccrma.stanford.edu> References: <8664a2540090bb689e5da45faee7b73e@ccrma.stanford.edu> Message-ID: On Tue, 26 Oct 2021, bil at ccrma.Stanford.EDU wrote: > And thanks for the other bugfix -- why doesn't gcc complain about it? You're allowed to return void from a void function; e.g. void f() { return (void)0; } is also fine; inline_file_write_char also returns void, so msvc is actually in the wrong here. -E From j_hearon at hotmail.com Wed Oct 27 10:24:17 2021 From: j_hearon at hotmail.com (James Hearon) Date: Wed, 27 Oct 2021 17:24:17 +0000 Subject: [CM] poly questions In-Reply-To: References: Message-ID: Hi, Thank you for the example re: polyshape , square wave. I am surprised to see that fractions vs. decimals for amps in the float-vector makes a difference in the chebyshev coefficients. (partials->polynomial (float-vector 1 1 3 1/3 5 1/5 7 1/7 9 1/9 )) ;(0.0 1.0 0.0 -7.999999999999999 0.0 35.2 0.0 -54.85714285714286 0.0 28.44444444444444) (with-sound (:srate 48000 :channels 1 :play #t) (let ((gen (make-polyshape 100.0 :coeffs #r(0.0 1.0 0.0 -7.999999999999999 0.0 35.2 0.0 -54.85714285714286 0.0 28.44444444444444) )) ) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .75 (polyshape gen 1.0 )))))) When trying to plug the coefficents back into make-polyshape, I get a different wave shape, which looks more like a triangle-ish wave instead of the square: ^^^^^^ I believe this is where I'm stuck, trying to empirically understand how the chebyshev coefficient numbers work for additive synthesis. I thought the problem might be normalization or order of coefficients? Still not sure where I'm going wrong. Any help, advice much appreciated. Regards, Jim ________________________________ From: cmdist-bounces at ccrma.Stanford.EDU on behalf of cmdist-request at ccrma.Stanford.EDU Sent: Tuesday, October 26, 2021 9:00 AM To: cmdist at ccrma.Stanford.EDU Subject: Cmdist Digest, Vol 161, Issue 11 Send Cmdist mailing list submissions to cmdist at ccrma.stanford.edu To subscribe or unsubscribe via the World Wide Web, visit https://cm-mail.stanford.edu/mailman/listinfo/cmdist or, via email, send a message with subject or body 'help' to cmdist-request at ccrma.stanford.edu You can reach the person managing the list at cmdist-owner at ccrma.stanford.edu When replying, please edit your Subject line so it is more specific than "Re: Contents of Cmdist digest..." Today's Topics: 1. poly questions (James Hearon) ---------------------------------------------------------------------- Message: 1 Date: Tue, 26 Oct 2021 17:40:43 +0000 From: James Hearon To: "cmdist at ccrma.Stanford.EDU" Subject: [CM] poly questions Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi, Trying to get an understanding of all the interesting aspects of polywave in snd, and chebyshev polynomials, coefficients etc. I was trying to get a squarish wave from the coefficients but failing. Also tried partials->polynomial, and normalize-partials with same result. Wondering what I'm misunderstanding about how you would employ the coefficients for a typical float-vector of partials, and amps for say a square wave? (with-sound (:srate 48000 :channels 1 :play #t) (let ((gen (make-polyshape 100.0 :coeffs (partials->polynomial (float-vector 1 1 3 .33 5 .2 7 .142 9 0.111)) )) ) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .75 (polyshape gen 1.0 )))))) Also, if I can ask more than one question per email, how do you go about using the generators: mus-chebyshev-tu-sum x t-coeffs u-coeffs mus-chebyshev-t-sum x t-coeffs mus-chebyshev-u-sum x u-coeffs I couldn't seem to locate an ex. for those, but I did see the c code in clm.c which is interesting. Thank you, Regards, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ Cmdist mailing list Cmdist at ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist End of Cmdist Digest, Vol 161, Issue 11 *************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Wed Oct 27 11:21:12 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Wed, 27 Oct 2021 11:21:12 -0700 Subject: [CM] poly questions In-Reply-To: References: Message-ID: <83375a3e940d7a45456a92daed1f26bc@ccrma.stanford.edu> This is the same problem as before. There are two (or is it 4?) kinds of Chebyshev polynomials. You need to be consistent in which ones you use. For the square wave you want the second kind for a sum of sines: (with-sound (:srate 48000 :channels 1 :play #t) (let ((gen (make-polyshape 100.0 :coeffs (partials->polynomial (float-vector 1 1 3 1/3 5 1/5 7 1/7 9 1/9) mus-chebyshev-second-kind) :kind mus-chebyshev-second-kind))) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .75 (polyshape gen 1.0)))))) From j_hearon at hotmail.com Thu Oct 28 10:48:31 2021 From: j_hearon at hotmail.com (James Hearon) Date: Thu, 28 Oct 2021 17:48:31 +0000 Subject: [CM] poly questions In-Reply-To: References: Message-ID: Hi, I think I'm understanding better now. In order to generate and utilize the correct Chebyshev coefficients with make-polyshape, one needs to specify the kind or type using partials->polynomial to first generate the coefficients. (partials->polynomial (float-vector 1 1 3 1/3 5 1/5 7 1/7 9 1/9) mus-chebyshev-second-kind) ;#r(0.8349206349206351 0.0 -2.082539682539683 0.0 18.43809523809524 0.0 -40.63492063492063 0.0 28.44444444444444 0.0 (with-sound (:srate 48000 :channels 1 :play #t) (let ((gen (make-polyshape 100.0 :coeffs #r(0.8349206349206351 0.0 -2.082539682539683 0.0 18.43809523809524 0.0 -40.63492063492063 0.0 28.44444444444444 0.0) :kind mus-chebyshev-second-kind))) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .75 (polyshape gen 1.0)))))) Fantastic. partials-->polynomial is a nice tool. There's not that much around that allows one to view the coefficents being used in the synthesis. ...I'll move on and try to get some understanding of the sums. mus-chebyshev-tu-sum x t-coeffs u-coeffs mus-chebyshev-t-sum x t-coeffs mus-chebyshev-u-sum x u-coeffs thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: