<div dir="ltr">Hi List!<div><br></div><div>I&#39;ve come up with a solution to the question I posted (below) previously by creating an OSC router in Csound, passing events over OSC from Scheme to a running Csound orchestra. I wrote a blog post about it here - maybe someone will find it useful:<div><br></div><div><a href="http://listenfaster.tumblr.com/post/142910737568/realtime-csound-from-grace-using-osc-routing">http://listenfaster.tumblr.com/post/142910737568/realtime-csound-from-grace-using-osc-routing</a><br></div><div><br></div><div>Thanks!</div><div>b</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 16, 2016 at 9:28 PM, Ben McAllister <span dir="ltr">&lt;<a href="mailto:benmca@gmail.com" target="_blank">benmca@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I&#39;m stuck with a problem trying to sprout process with Csound.  I&#39;m<br>
trying to do something more complex with a piece I&#39;m working on, but<br>
managed to boil down the problem I&#39;m having by using the Csound Scheme<br>
example. If you take a look at that example, you&#39;ll see a function<br>
called ransco:<br>
<br>
(define (ransco len rhy lb ub amp)<br>
  (let ((dur (* rhy 2)))<br>
    (process repeat len<br>
             for t = (elapsed #t) ; get true score time<br>
             for k = lb then (between lb ub)<br>
             do<br>
             (cs:i 1 t dur k amp)<br>
             (wait rhy))))<br>
<br>
<br>
A bit further down in the example, there&#39;s some instruction on sprout<br>
this bit multiple time, using :write #f to &#39;collect&#39; the events<br>
generated into one score:<br>
<br>
<br>
; This will generate a score without writing an audio file. execute<br>
; the expression several times and use the Audio&gt;Csound&gt;Export... item<br>
; to export all the score data in various formats<br>
<br>
(sprout (ransco 10 .2 60 72 1000) &quot;test.sco&quot; :write #f)<br>
<br>
I was assuming I&#39;d be able to do this same thing from a process, but<br>
I&#39;m getting an error that Grace is unable to get a file handle to<br>
&quot;test.sco&quot;. Here&#39;s the function:<br>
<br>
(define (f1)<br>
  (process repeat 3<br>
  do<br>
  (sprout (ransco 10 .2 60 72 1000) &quot;test.sco&quot; :write #f)<br>
  (wait 1)))<br>
<br>
...and I try to execute it like so:<br>
(sprout (f1))<br>
<br>
<br>
Is this one of those &#39;not yet implemented&#39; features, or am I missing<br>
something? Any help is very much appreciated - thanks! Complete<br>
listing below:<br>
<br>
;------------------------------------------------<br>
;<br>
;; Csound output<br>
;<br>
<br>
; To evaluate code put the cursor after each expression and press<br>
; Command-Return, then check the console window for any output.<br>
<br>
; A process that sends csound data<br>
<br>
(define (ransco len rhy lb ub amp)<br>
  (let ((dur (* rhy 2)))<br>
    (process repeat len<br>
             for t = (elapsed #t) ; get true score time<br>
             for k = lb then (between lb ub)<br>
             do<br>
             (cs:i 1 t dur k amp)<br>
             (wait rhy))))<br>
<br>
; Write a score file<br>
<br>
(sprout (ransco 10 .2 60 72 1000) &quot;test.sco&quot;)<br>
<br>
; Options for csound scorefiles are:<br>
;      play:           if #t call csound after writing file<br>
;      header:         header string for scorefile<br>
;      orchestra:      path to .orc file<br>
;      write:          if #t write the scorefile (default #t)<br>
; These options are all &#39;sticky&#39; and except for write: are saved in<br>
; your preferences file.<br>
<br>
; This next command will call csound after generating the<br>
; file. Before executing it copy the simp.orc code below into your<br>
; home directory and use Audio&gt;Csound&gt;Settings... to assign your<br>
; Csound app.<br>
<br>
(sprout (ransco 10 .2 60 72 1000) &quot;test.sco&quot; :play #t<br>
        :orchestra &quot;simp.orc&quot;)<br>
<br>
; This will generate a score without writing an audio file. execute<br>
; the expression several times and use the Audio&gt;Csound&gt;Export... item<br>
; to export all the score data in various formats<br>
<br>
(sprout (ransco 10 .2 60 72 1000) &quot;test.sco&quot; :write #f)<br>
<br>
(define (f1)<br>
  (process repeat 3<br>
  do<br>
  (sprout (ransco 10 .2 60 72 1000) &quot;test.sco&quot; :write #f)<br>
  (wait 1)))<br>
<br>
(sprout (f1))<br>
<span class="HOEnZb"><font color="#888888"><br>
Ben<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ben McAllister | <a href="http://listenfaster.com" target="_blank">listenfaster.com</a> |  @listenfaster | <a href="http://tuktuband.com" target="_blank">tuktuband.com</a> | c: 206.849.3183<br></div>
</div>