From ripley.jason at gmail.com Fri May 3 15:17:04 2013 From: ripley.jason at gmail.com (Jason Ripley) Date: Fri, 3 May 2013 17:17:04 -0500 Subject: [CM] S7 scheme running on Android in NDK Message-ID: Hi, I have just added s7 scheme to a C++ project on Android, and I ran into a couple of issues that I would like to post in case anyone else runs into them. 1 - android doesn't seem to support the log2 function. Easy fix: fx = log((double)ix)/log(2.0); 2 - It seems that arm based architectures have issues with aligned access. I discovered this when calling s7_init to create a second scheme vm. The fix for this is to simply add __ANDROID__ to the __bfin__ check. here is the diff of the changes for s7.c: 4021c4021 < #if (__bfin__) --- > #if (__bfin__ || __ANDROID__) 10216a10217,10219 > #if (__ANDROID__) > fx = log((double)ix)/log(2.0); > #else 10217a10221 > #endif Are there any other spots in s7 where unaligned access may occur? They are rather difficult to debug. Sincerely, Jason Ripley -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Fri May 3 16:39:06 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Fri, 3 May 2013 16:39:06 -0700 Subject: [CM] S7 scheme running on Android in NDK In-Reply-To: References: Message-ID: <20130503233540.M77666@ccrma.Stanford.EDU> Thanks very much! I have merged those changes into the ccrma and sourceforge copies of s7. > Are there any other spots in s7 where unaligned access may occur? > They are rather difficult to debug. That's the truth! Sorry you got bitten. As far as I know, that one spot is the only unaligned access. Please let me know of any other troubles. By the way, how do you run it in Android? I had somehow convinced myself that I needed Java. From Jean-Paul.ROY at unice.fr Sun May 5 01:14:17 2013 From: Jean-Paul.ROY at unice.fr (Jean-Paul.ROY at unice.fr) Date: Sun, 5 May 2013 10:14:17 +0200 Subject: [CM] Installing snd and s7 on MacOS-X Mountain Lion Message-ID: <3EA6EB86-E90E-4852-A217-56D663117965@unice.fr> Hi ! New to cmdist. Is there any easy way to install s7 scheme and snd on Mac-OSX Mountain Lion ? Thanks a lot, roy From bil at ccrma.Stanford.EDU Sun May 5 04:42:49 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Sun, 5 May 2013 04:42:49 -0700 Subject: [CM] Installing snd and s7 on MacOS-X Mountain Lion In-Reply-To: <3EA6EB86-E90E-4852-A217-56D663117965@unice.fr> References: <3EA6EB86-E90E-4852-A217-56D663117965@unice.fr> Message-ID: <20130505113443.M23301@ccrma.Stanford.EDU> I think the easiest way is to configure snd without any GUI: ./configure --with-no-gui make This will give you snd/clm/s7 in an old-style interpreter. There are several suggestions in README.Snd -- perhaps you can get motif or gtk from one of the packagers mentioned there. I don't recommend trying to build either one yourself -- both are borderline impossible to get going by hand. I can't upgrade my old Mac to the new OSX, so I haven't tested it. Good luck! From antoinedaurat at googlemail.com Thu May 9 00:30:49 2013 From: antoinedaurat at googlemail.com (Antoine) Date: Thu, 9 May 2013 07:30:49 +0000 (UTC) Subject: [CM] optional arguments in Scheme Message-ID: Hello, I am having a hard time understanding optional arguments in Scheme and could use a little help. I want to pass optional arguments, without having to write the keywords and it seems that in that case "&optkey" becomes an argument!... (define* (hiho a &optkey (b 0) (c 0)) (+ a b c)) (hiho 1 12) => 1 (hiho 1 12 1 1) => 3 Neither s7 documentation nor Common Music's reference or examples give an overview of the syntax for optionals and rests arguments. Could you be kind enough to point me the right direction? :) Thank you! From taube at illinois.edu Thu May 9 04:07:08 2013 From: taube at illinois.edu (Heinrich Taube) Date: Thu, 9 May 2013 06:07:08 -0500 Subject: [CM] optional arguments in Scheme In-Reply-To: References: Message-ID: <79C991F0-2334-404F-9E89-BEBD219937E7@illinois.edu> hi if you use s7's define then you don't need OptKey at all because all arguments will be opt key: > (define* (foo a b c d e) (list a b c d e)) > (foo ) (#f #f #f #f #f) > (foo 1 2) (1 2 #f #f #f) > (foo 1 2 3 4 5) (1 2 3 4 5) > (foo 1 2 3 4 5 6) >>> Error: foo: too many arguments: (1 2 3 4 5 6) On May 9, 2013, at 2:30 AM, Antoine wrote: > Hello, > > I am having a hard time understanding optional arguments > in Scheme and could use a little help. > I want to pass optional arguments, without having to write > the keywords and it seems that in that > case "&optkey" becomes an argument!... > > > (define* (hiho a &optkey (b 0) (c 0)) > (+ a b c)) > > (hiho 1 12) > > => 1 > > (hiho 1 12 1 1) > > => 3 > > Neither s7 documentation nor Common Music's reference > or examples give an overview of the syntax > for optionals and rests arguments. Could you be kind enough > to point me the right direction? :) > Thank you! > > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist From bil at ccrma.Stanford.EDU Thu May 9 04:18:19 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Thu, 9 May 2013 04:18:19 -0700 Subject: [CM] optional arguments in Scheme In-Reply-To: References: Message-ID: <20130509111715.M60288@ccrma.Stanford.EDU> (Just as I was about to press "send", Rick's answer arrived, but I'll send my redundant verbiage anyway). In s7, define* arguments are optional and have keyword names without any marker like &optkey (:optional is accepted, but ignored). I'm not sure where &optkey comes from, perhaps def-optkey-fun in the Common Lisp version of clm? (define* (hiho a (b 0) (c 0)) (+ a b c)) has 3 optional/keyword arguments. (hiho 1) -> 1 (hiho 1 11) -> 12 (hiho :c 0 :b 11 :a 1) -> 12 See s7.html under define* (the third major section of the doc). s7.html has tons of examples, and there are many more in the Snd *.scm files. The s7 version of clm is primarily documented in sndclm.html. From antoinedaurat at googlemail.com Thu May 9 04:27:56 2013 From: antoinedaurat at googlemail.com (Antoine) Date: Thu, 9 May 2013 11:27:56 +0000 (UTC) Subject: [CM] optional arguments in Scheme References: Message-ID: Thank you both! From bil at ccrma.Stanford.EDU Mon May 13 13:41:54 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Mon, 13 May 2013 13:41:54 -0700 Subject: [CM] gtk snd listener Message-ID: <20130513203846.M64838@ccrma.Stanford.EDU> I'm unicodizing the gtk version of snd's listener, so if you use the cvs stuff or the daily tarball, expect the unexpected. I'll have it back to normal in no time... From j_hearon at hotmail.com Wed May 15 18:50:27 2013 From: j_hearon at hotmail.com (James Hearon) Date: Thu, 16 May 2013 01:50:27 +0000 Subject: [CM] s7, simple listener In-Reply-To: References: Message-ID: Hi, Trying to run the simple listener example from s7 manual under FFI. $ gcc -c s7.c -I. ok. $ gcc -o doc7 doc7.c s7.o -lm -I. s7.o: In function `g_load': s7.c:(.text+0x4a177): undefined reference to `dlopen' s7.c:(.text+0x4a192): undefined reference to `dlsym' s7.c:(.text+0x4a1b6): undefined reference to `dlerror' s7.c:(.text+0x4a1e9): undefined reference to `dlclose' s7.c:(.text+0x4a1f0): undefined reference to `dlerror' collect2: error: ld returned 1 exit status I tried just including dlfcn.h in s7.c but that didn't fix it. Wondering what lib or headers I'm missing. I do have a ld-2.16.so in usr/lib if that's what it needs. thanks, Jim Hearon -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Thu May 16 03:56:25 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Thu, 16 May 2013 03:56:25 -0700 Subject: [CM] s7, simple listener In-Reply-To: References: Message-ID: <20130516105437.M41591@ccrma.Stanford.EDU> I think you need to add -ldl: gcc -o doc7 doc7.c s7.o -lm -I. -ldl The default gcc version of s7 now includes the dynamic loader, but I (of course) forgot to check the documentation examples. I need to find a way to extract those examples and run them during my huge regression test suite. Thanks for the bug report! From bil at ccrma.Stanford.EDU Sat May 18 15:56:23 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Sat, 18 May 2013 15:56:23 -0700 Subject: [CM] live coding with common music Message-ID: <20130518225432.M28284@ccrma.Stanford.EDU> There's an interesting live coding music video: http://vimeo.com/66448855 comments here: http://www.reddit.com/r/lisp/comments/1ekpfs/livecoding_on_clozurecl/ (reddit lisp -- not sure these urls will actually work). From bil at ccrma.Stanford.EDU Sat May 18 15:58:28 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Sat, 18 May 2013 15:58:28 -0700 Subject: [CM] live coding with common music In-Reply-To: <20130518225432.M28284@ccrma.Stanford.EDU> References: <20130518225432.M28284@ccrma.Stanford.EDU> Message-ID: <20130518225751.M5704@ccrma.Stanford.EDU> while watching it I was thinking, "hooboy, my poor little gtk repl has a long ways to go..." From antoinedaurat at googlemail.com Tue May 21 00:18:40 2013 From: antoinedaurat at googlemail.com (Antoine) Date: Tue, 21 May 2013 07:18:40 +0000 (UTC) Subject: [CM] stop and sprout in one block Message-ID: Hello, I would like to stop all running processes and then sprout the next ones on a single evaluation. (define (proc) (process repeat 100 do (print (pick 1 2)) (wait .5) )) (begin (stop) (sprout (proc)) ) This seems to even stop (proc) from being sprouted! I can't use id's because it would be too much of a trouble naming and keeping track of all the processes I am sprouting each time... I just would like to "flush" and keep on. Thank you for your time and your reply! Antoine From j_hearon at hotmail.com Tue May 21 17:33:56 2013 From: j_hearon at hotmail.com (James Hearon) Date: Wed, 22 May 2013 00:33:56 +0000 Subject: [CM] build clm-4 In-Reply-To: References: Message-ID: Hi, I'm trying to build clm-4 for lisp on fedora18, and not sure everything compiled. After compilation I tried: (compile-file "v.ins") (load "v") (with-sound () (fm-violin 0 1 440 .1)) But get: The function COMMON-LISP-USER::FM-VIOLIN is undefined. I'm wondering if I have it right and everything was built since only exe I see in the clm-4 folder is sndplay. [fedora2 at localhost clm-4]$ sbcl This is SBCL 1.1.2-1.fc18, an implementation of ANSI Common Lisp. More information about SBCL is available at . SBCL is free software, provided as is, with absolutely no warranty. It is mostly in the public domain; some portions are provided under BSD-style licenses. See the CREDITS and COPYING files in the distribution for more information. * (load "all.lisp") ; using existing configuration file mus-config.h ; Compiling "/opt/clm-4/io.c" ; Compiling "/opt/clm-4/headers.c" ; Compiling "/opt/clm-4/audio.c" ; Compiling "/opt/clm-4/sound.c" ; Compiling "/opt/clm-4/clm.c" ; Compiling "/opt/clm-4/cmus.c" ; Creating "/opt/clm-4/libclm.so" ;;gcc -shared -fPIC -o /opt/clm-4/libclm.so /opt/clm-4/headers.o /opt/clm-4/audio.o /opt/clm-4/io.o /opt/clm-4/sound.o /opt/clm-4/clm.o /opt/clm-4/cmus.o -lasound ;compiling /opt/clm-4/clm-package.lisp ;loading /opt/clm-4/clm-package.fasl ;compiling /opt/clm-4/initmus.lisp ;loading /opt/clm-4/initmus.fasl ;compiling /opt/clm-4/sndlib2clm.lisp ;loading /opt/clm-4/sndlib2clm.fasl ;compiling /opt/clm-4/defaults.lisp ;loading /opt/clm-4/defaults.fasl; Building sndplay program: "/opt/clm-4/sndplay" ;compiling /opt/clm-4/ffi.lisp ;loading /opt/clm-4/ffi.fasl ;compiling /opt/clm-4/mus.lisp ;loading /opt/clm-4/mus.fasl ;compiling /opt/clm-4/run.lisp ;loading /opt/clm-4/run.fasl ;compiling /opt/clm-4/sound.lisp ;loading /opt/clm-4/sound.fasl ;compiling /opt/clm-4/defins.lisp ;loading /opt/clm-4/defins.fasl ;compiling /opt/clm-4/env.lisp ;loading /opt/clm-4/env.fasl ;compiling /opt/clm-4/export.lisp ;loading /opt/clm-4/export.fasl ;compiling /opt/clm-4/clm1.lisp ;loading /opt/clm-4/clm1.fasl T * -------------- next part -------------- An HTML attachment was scrubbed... URL: From andersvi at notam02.no Wed May 22 02:22:41 2013 From: andersvi at notam02.no (andersvi at notam02.no) Date: Wed, 22 May 2013 11:22:41 +0200 Subject: [CM] build clm-4 References: Message-ID: <87bo83v066.fsf@notam02.no> >>>>> "J" == James Hearon writes: J> Hi, J> I'm trying to build clm-4 for lisp on fedora18, and not sure everything compiled. J> After compilation I tried: J> (compile-file "v.ins") J> (load "v") J> (with-sound () (fm-violin 0 1 440 .1)) J> But get: The function COMMON-LISP-USER::FM-VIOLIN is undefined. The compilation looks ok. Id check if things happen in the right packages. Try evaluating: (package-name (symbol-package 'fm-violin)) and see if its the same as the package youre working in: (package-name *package*) -anders From taube at illinois.edu Wed May 22 07:37:21 2013 From: taube at illinois.edu (Heinrich Taube) Date: Wed, 22 May 2013 09:37:21 -0500 Subject: [CM] stop and sprout in one block In-Reply-To: References: Message-ID: <74AE6922-20BA-4E5C-B406-34D1E1EE8BB2@illinois.edu> did you try using Command-K to stop things and then simply re-evaluate the sprouts ?? On May 21, 2013, at 2:18 AM, Antoine wrote: > Hello, > > I would like to stop all running processes and then sprout the next ones > on a single evaluation. > > (define (proc) > (process repeat 100 do > (print (pick 1 2)) > (wait .5) > )) > > (begin > (stop) > (sprout (proc)) > ) > > This seems to even stop (proc) from being sprouted! > I can't use id's because it would be too much of a trouble naming > and keeping track of all the > processes I am sprouting each time... I just would like to "flush" > and keep on. > > Thank you for your time and your reply! > > Antoine > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist From j_hearon at hotmail.com Thu May 23 11:47:58 2013 From: j_hearon at hotmail.com (James Hearon) Date: Thu, 23 May 2013 18:47:58 +0000 Subject: [CM] build clm-4 In-Reply-To: References: Message-ID: The compilation looks ok. Id check if things happen in the right packages. Try evaluating: (package-name (symbol-package 'fm-violin)) and see if its the same as the package youre working in: (package-name *package*) -anders -------Hi, I getCOMMON-LISP-USER by evaluating the above expressions in sbcl on fedora 18. But if I just do: (compile-file "v.ins") (load "v") I get:The variable FM-VIOLIN is unbound. Also if I go on to the 2nd example from the CL/CLM manual online: (definstrument simp (start-time duration frequency amplitude) (let* ((beg (floor (* start-time *srate*))) (end (+ beg (floor (* duration *srate*)))) (j 0)) (run (loop for i from beg below end do (outa i (* amplitude (sin (* j 2.0 pi (/ frequency *srate*))))) (incf j))))) I get:The variable SIMP is unbound.So maybe SBCL is not the best choice for lisp for CLM? I tried Clisp but the CLM/README.clm file shows several problems with Clisp so I removed it and installed SBCL before compiling CLM. SBCL seemed to have the most uptodate status in README.clm, but also mentions something about sbcl - fix.lisp from R Mattes. I wonder if that could help?Regards,Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From andersvi at notam02.no Thu May 23 13:03:51 2013 From: andersvi at notam02.no (andersvi at notam02.no) Date: Thu, 23 May 2013 22:03:51 +0200 Subject: [CM] build clm-4 References: Message-ID: <87y5b5sbtk.fsf@notam02.no> J> I get J> COMMON-LISP-USER by evaluating the above expressions in sbcl on fedora 18. J> But if I just do: J> (compile-file "v.ins") J> (load "v") J> I get: J> The variable FM-VIOLIN is unbound. J> Also if I go on to the 2nd example from the CL/CLM manual online: J> (definstrument simp (start-time duration frequency amplitude) J> (let* ((beg (floor (* start-time *srate*))) J> (end (+ beg (floor (* duration *srate*)))) J> (j 0)) J> (run J> (loop for i from beg below end do J> (outa i (* amplitude (sin (* j 2.0 pi (/ frequency *srate*))))) J> (incf j))))) J> I get: J> The variable SIMP is unbound. J> So maybe SBCL is not the best choice for lisp for CLM? clm w. sbcl is usually very stable. Have you loaded clm at all in your lisp? If you follow what README.clm says and the problems persist, paste in your whole session, from starting up to the message about unbound FM-VIOLIN, and send in an email. From bil at ccrma.Stanford.EDU Thu May 23 17:36:53 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Thu, 23 May 2013 17:36:53 -0700 Subject: [CM] build clm-4 In-Reply-To: <87bo83v066.fsf@notam02.no> References: <87bo83v066.fsf@notam02.no> Message-ID: <20130524003353.M37177@ccrma.Stanford.EDU> You can get that error if you type (with-sound () fm-violin 0 1 440 .1) which strikes me as odd -- surely fm-violin is defined? Or is this related to the fact that fm-violin is a function so it's undefined when used as a variable? * (defun hi (a) a) HI * hi debugger invoked on a UNBOUND-VARIABLE in thread #: The variable HI is unbound. I'm forgetting what little CL I ever knew... From tossel at gmail.com Fri May 24 12:48:13 2013 From: tossel at gmail.com (tossel at gmail.com) Date: Fri, 24 May 2013 23:48:13 +0400 Subject: [CM] Trouble with sndlplay Message-ID: Greetings! I'm trying to learn clm library but the key program, sndplay returns with an error: "ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream open pcm default for stream 1: Invalid argument open pcm plughw:0 for stream 1: No such file or directory open pcm hw:0 for stream 1: No such file or directory open pcm hw:0 for stream 1: No such file or directory open pcm plughw:0 for stream 1: No such file or directory open pcm hw:0 for stream 1: No such file or directory" Maybe the error is caused by the fact that my soundcard is present in the system as device #1, not #0. So before debugging into sndlib I want to try easier ways. 1. I've read in the documentation that by changing clm:*clm-player* I can set an alternative player. Are there some players under Linux that support that format? OR 2. Maybe there is a way to change alsa device, sndlib uses by default. Will be grateful for any help. -- Anton Gerasimov -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Fri May 24 13:34:52 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Fri, 24 May 2013 13:34:52 -0700 Subject: [CM] Trouble with sndlplay In-Reply-To: References: Message-ID: <20130524203221.M7105@ccrma.Stanford.EDU> There's a section in README.Snd that discusses some ways to set the alsa variables that sndplay sees. I think, however, that I'd first try aplay -- that is alsa's sound player. Nando should be back from vacation soon, I think, and he's the expert on this. From bil at ccrma.Stanford.EDU Fri May 24 14:34:50 2013 From: bil at ccrma.Stanford.EDU (Bill Schottstaedt) Date: Fri, 24 May 2013 14:34:50 -0700 Subject: [CM] Snd 13.7 Message-ID: <20130524213352.M54683@ccrma.Stanford.EDU> Snd 13.7. s7: r7rs changes: flush-output-port, vector-append, read|write-string, boolean=?, symbol=?, exit, emergency-exit (see s7.html for the rest). added destination/start/end args to copy. Snd: new gtk listener, split out as glistener.c/h, tests in tools/gcall.c and tools/gtest.scm. checked: sbcl 1.1.7, gtk 3.9.0 Thanks!: Nando, Jason Ripley, James Hearon From pjb at informatimago.com Fri May 24 10:22:26 2013 From: pjb at informatimago.com (Pascal J. Bourguignon) Date: Fri, 24 May 2013 19:22:26 +0200 Subject: [CM] build clm-4 References: <87bo83v066.fsf@notam02.no> <20130524003353.M37177@ccrma.Stanford.EDU> Message-ID: <871u8wl2ct.fsf@kuiper.lan.informatimago.com> "Bill Schottstaedt" writes: > You can get that error if you type > > (with-sound () fm-violin 0 1 440 .1) > > which strikes me as odd -- surely fm-violin is defined? > Or is this related to the fact that fm-violin is a function > so it's undefined when used as a variable? > > * (defun hi (a) a) > > HI > * hi > > debugger invoked on a UNBOUND-VARIABLE in thread > #: > The variable HI is unbound. > > I'm forgetting what little CL I ever knew... Common Lisp is a lisp-2: it distinguishes the variable namespace from the function namespace. defun defines a function. To get it, you just use the CL:FUNCTION special operator: CL-USER> (defun hi (a) a) HI CL-USER> (function hi) # CL:LET defines a variable. To get its value, you would just evaluate it: CL-USER> (let ((hi 42)) hi) 42 CL-USER> (let ((hi 42)) (list (quote hi) hi (function hi))) (HI 42 #) -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. You can take the lisper out of the lisp job, but you can't take the lisp out of the lisper (; -- antifuchs From tossel at gmail.com Sat May 25 01:39:31 2013 From: tossel at gmail.com (tossel at gmail.com) Date: Sat, 25 May 2013 12:39:31 +0400 Subject: [CM] Trouble with sndlplay In-Reply-To: <20130524203221.M7105@ccrma.Stanford.EDU> References: <20130524203221.M7105@ccrma.Stanford.EDU> Message-ID: Thank you! I didn't find a way to change the ALSA device, sndplay uses or make it work with dmix (I don't know much about ALSA programming actually) but (setf *clm-player* (lambda (name) (clm::run-in-shell "aplay" (format nil "-t au -f float_le -r ~d ~a" clm::*clm-srate* name)))) works fine for now. -- Anton Gerasimov 2013/5/25 Bill Schottstaedt > There's a section in README.Snd that discusses some ways to > set the alsa variables that sndplay sees. I think, however, that > I'd first try aplay -- that is alsa's sound player. Nando should > be back from vacation soon, I think, and he's the expert on this. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From taube at illinois.edu Mon May 27 07:54:10 2013 From: taube at illinois.edu (Heinrich Taube) Date: Mon, 27 May 2013 09:54:10 -0500 Subject: [CM] stop and sprout in one block In-Reply-To: References: Message-ID: > This seems to even stop (proc) from being sprouted! > I can't use id's because it would be too much of a trouble naming > and keeping track of all the when you call (begin (stop) (sprout ?)) these function are not synchronies in the way you are expecting. scheme and the scheduler are not the same thread. these scheme functions add "execution nodes" to the scheduler thread from the scheme thread. the scheduler places stop nodes at the head of its queue and they flush the queue or specific nodes in the queue *when they are evaluated by the scheduler*. so the first call adds a stop node, the second call added process node(s), then when the scheduler wakes up it stop what you just added. i think to approximate what you want either (1) Type Command-K and then evaluate the expression. (2) evaluate (stop) and then evaluate (sprout), or (3) keep them together as you have but have the stop selectively stop only the process that you already sprouted in the previous pass (by associating ids with them) On May 21, 2013, at 2:18 AM, Antoine wrote: > Hello, > > I would like to stop all running processes and then sprout the next ones > on a single evaluation. > > (define (proc) > (process repeat 100 do > (print (pick 1 2)) > (wait .5) > )) > > (begin > (stop) > (sprout (proc)) > ) > > This seems to even stop (proc) from being sprouted! > I can't use id's because it would be too much of a trouble naming > and keeping track of all the > processes I am sprouting each time... I just would like to "flush" > and keep on. > > Thank you for your time and your reply! > > Antoine > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist From taube at illinois.edu Mon May 27 08:48:32 2013 From: taube at illinois.edu (Heinrich Taube) Date: Mon, 27 May 2013 10:48:32 -0500 Subject: [CM] Scheduler and environment In-Reply-To: References: Message-ID: > Now, the main problem was that sometimes the midi receiver would increase the step variable from 1 but the messages wouldn't be sent to Max/MSP - or wouldn't arrive : I'm also asking Max's experts about their end of my problem. One thing was pretty clear, it sent either every messages or none.\ if your step variable is always incrementing correctly then it would seem the problem would be not with midi per se but rather in (or under) the sendocs call. but just to make sure you might try turning on midi tracing using the menu item Audio>Midi In> Trace Input to make sure the midi code is always happening so at this point its still hard for me to really understand exactly what the issue is here?the "(if (string? ((n 0) 0))" looks very odd to me -- is each "n" really a function that is called with a zero and returns another function that is called with another 0 to return a possible string? or maybe this is just an email typo???? midi and osc triggers are handled pretty much the same way: a callback node is registered with the scheduler and evaluated with the arriving data. when the scheduler pops that node and evals it the scheduler has to wait for the scheme code its calling to return before it can do anything else, but i don't *think* that would stop other processes from added more trigger nodes to the queue. sigh. i wish you could add a few c++ trace calls to the 3.8.0 Grace code base and rebuild to trace/debug things but unfortunately i have no tar ball of S7 Scheme 1.105 (6-Feb-12) and i can't find one. so i can't really build that super-stable Grace from sources to debug. and you can't build the cm in the repo because I never got that running without some scheme code crashing that i didn't have the time the past months to really work on! i guess the shortest path might be for me to try get this going again, but i don't thing there is going to be a quick easy answer for you, I'm sorry! > -Second question is about my midi receiver, it receives values from a midi-pedal. > > In order to make it short it looks like this : > > (begin > (define step 0) > > (define (trigger msg) > (if (= (last msg) 127) > (begin > (sendosc (cues step)) > (set! step (+ step 1))))) > > (mp:receive mm:ctrl trigger) > ) > > Where cues is a list containing lists and closures and (sendosc) translates those lists and closures into processes that send osc messages. Typically (cues 0) would look like this '((("hi") (100))(("ho")(200))). (sendosc) looks also like this : > > (define (sendosc lst) > (loop for n in lst > do > (if (string? ((n 0) 0)) > (sprout (list->message n)) > (sendosc n)))) > > Now, the main problem was that sometimes the midi receiver would increase the step variable from 1 but the messages wouldn't be sent to Max/MSP - or wouldn't arrive : I'm also asking Max's experts about their end of my problem. One thing was pretty clear, it sent either every messages or none. > > At first, I changed the condition of the receiver so that the first value of the controller greater than 0 would trigger the whole thing, but it didn't really changed anything. Because I also tried an osc receiver that took a single value whenever I hit the spacebar in Max, and that solution was rock solid - even though unpracticable for the piece - I thought that maybe the midi receiver wouldn't have always the time to fully evaluate (sendosc) if the incoming messages were to be very fast, like they are with most midi-pedal? but it is just a guess... > Is it possible that the scheduler gives priority to the newest message and drops the task of evaluating what comes with the old ones? > Would it be possible to filter the midi input before it gets to the receiver? > Could it be something else? > > -My last question concern something else. > > I wanted to try the new environments example of s7 and after downloading the newest tarball for Grace I keep becoming those errors : >>>> Error: environment-ref: unbound variable >>>> Error: open-environment: unbound variable > I don't use or need snd but it would be great to access those functions in Grace. Do you know how I could do that? > > Thank you very much for your time and your patience and even more for your software : I couldn't have done this piece without Grace! > > Best regards, > > Antoine > From taube at illinois.edu Tue May 28 04:41:14 2013 From: taube at illinois.edu (Heinrich Taube) Date: Tue, 28 May 2013 06:41:14 -0500 Subject: [CM] Scheduler and environment In-Reply-To: <5491A786-13A7-4C2C-A316-274C35913F6E@googlemail.com> References: <5491A786-13A7-4C2C-A316-274C35913F6E@googlemail.com> Message-ID: <6BDFEE99-4599-4397-B665-67D7B03A8F00@illinois.edu> or it could be that liblo isn't sending the messages out, not sure what is more likely. if you could trigger the failing behavior without actually calling osc that would at least tell me which has the problem, eval under midi callback or osc message output. i will try to get things running in the repo this week, that way at least you will be able to add tracings to c++ code. On May 27, 2013, at 4:15 PM, Antoine Daurat wrote: > guess that I should now test my code away from the stress of the repetition and the concert, it would probably help... > > Anyway, thank you for your help and if you ever come to *be certain* that it could or couldn't stop other processes to add trigger nodes to the queue, I'll be glad if you'd let me know.