Any CLM in Extempore?

144 views
Skip to first unread message

Robert Herman

unread,
Aug 15, 2016, 6:05:29 AM8/15/16
to Extempore
I would like to leverage any Common Lisp Music (CLM) I might remember, since I am having fun with Extempore, but I am not able to make the leap to making anything I am happy with on my own.

I have been able to put sounds together in GRACE (a CLM all-in-one app for all platforms), so it is not due to not having basic music theory and coding skills.

I am hoping to get the Ah-Ha moment, but I guess I am getting old and dummer than I like to think ;)

Rob

Andrew Sorensen

unread,
Aug 15, 2016, 6:54:29 AM8/15/16
to extemp...@googlegroups.com
Hi Rob,

I'm not exactly sure what the question is here :)

Would you like to start with notes + scales + chords ...
or alternatively would you prefer to start with sounds?

Ultimately I'm sure you'll probably want to do both, but I would suggest starting at one end or the other.



--
You received this message because you are subscribed to the Google Groups "Extempore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Sorensen

unread,
Aug 15, 2016, 7:00:29 AM8/15/16
to extemp...@googlegroups.com
You will not find anything CLM in extempore, but I tell you what, why don't you post something that you like in grace/clm code and i'll transliterate into extempore.  Let's start with something *small* :)

Also, it's late here so won't get around to a reply until tomorrow.

Robert Herman

unread,
Aug 17, 2016, 2:01:54 AM8/17/16
to Extempore
Hey, Andrew, 

Thanks for the quick replies.

I apologize for the unclear request or comment.

Also, I am currently living in UTC+7 with spotty internet, so no rush on my part at all from you.

I love Extempore, but being on Windows and Linux, I sometimes have issues with the install (my fault or Windows or Linux usually), and fall back to Grace/CLM, since it is a one-click, multi-platform install. It too crashes, but it's generally reliable. CLM is old and so am I ;)

I sometimes spend the day doing classic music theory with notes, chords, etc..., and other days, I am trying to craft a sound.

I guess what I am getting at is how there are some older CLM generators, and I was wondering if any of them were transliterated into xtlang's gens, like this code snippet for make-oscil and make-granulate generator example off of the CLM site (s7 vs CL version I suppose, corrrect? CLM is a beast with many arms!):

(with-sound (:play #t)
  (let* ((osc (make-oscil 440.0))
	 (sweep (make-env '(0 0 1 1) 
			  :scaler (hz->radians 440.0) 
			  :length 44100))
	 (grn (make-granulate (lambda (dir)
				(* 0.2 (oscil osc (env sweep))))
			      :expansion 2.0
			      :length .5)))
    (do ((i 0 (+ i 1)))
	((= i 88200))
      (outa i (granulate grn)))))
 
I had remembered reading how you used s7 in Impromptu(?), so I thought I could read the libs and learn Extempore that way, since my old brain is not jumping up the abstraction ladder too quickly ;)

Any news of a possible book on the horizon?

Thanks!

Rob
To unsubscribe from this group and stop receiving emails from it, send an email to extemporelan...@googlegroups.com.

ami...@gmail.com

unread,
Aug 17, 2016, 9:57:43 AM8/17/16
to extemp...@googlegroups.com


El 17 ago 2016, a las 02:01, Robert Herman <rpjh...@gmail.com> escribió:

Hey, Andrew, 

Thanks for the quick replies.

I apologize for the unclear request or comment.

Also, I am currently living in UTC+7 with spotty internet, so no rush on my part at all from you.

I love Extempore, but being on Windows and Linux, I sometimes have issues with the install (my fault or Windows or Linux usually), and fall back to Grace/CLM, since it is a one-click, multi-platform install. It too crashes, but it's generally reliable. CLM is old and so am I ;)

I sometimes spend the day doing classic music theory with notes, chords, etc..., and other days, I am trying to craft a sound.

I guess what I am getting at is how there are some older CLM generators, and I was wondering if any of them were transliterated into xtlang's gens, like this code snippet for make-oscil and make-granulate generator example off of the CLM site (s7 vs CL version I suppose, corrrect? CLM is a beast with many arms!):

(with-sound (:play #t)
  (let* ((osc (make-oscil 440.0))
	 (sweep (make-env '(0 0 1 1) 
			  :scaler (hz->radians 440.0) 
			  :length 44100))
	 (grn (make-granulate (lambda (dir)
				(* 0.2 (oscil osc (env sweep))))
			      :expansion 2.0
			      :length .5)))
    (do ((i 0 (+ i 1)))
	((= i 88200))
      (outa i (granulate grn)))))
 
I had remembered reading how you used s7 in Impromptu(?), so I thought I could read the libs and learn Extempore that way, since my old brain is not jumping up the abstraction ladder too quickly ;)

Any news of a possible book on the horizon?


A book -- or, possibly better, some multimedia equivalent -- would indeed be awesome.

Tom

Andrew Sorensen

unread,
Aug 17, 2016, 8:14:03 PM8/17/16
to extemp...@googlegroups.com
OK, so bearing in mind that I have never used Grace, CLM etc.. I've put together something that I'm guessing is similar to the example provided.  Don't let the length of the reply put you off - the code required is actually very short - but I've tried to explain a few things along the way :)   This is setup so that you can just keep recompiling dsp as you work through the example.  If I somehow misunderstood the intention of the CLM example please let me know and I'll modify as required.

(sys:load "libs/core/audio_dsp.xtm")

;; let's work this up in parts :)

;; we need a *master* dsp callback
;; we can call it whatever we like .. although by convention we call it 'dsp'
;; it's type *must* be [float,float,i64,i64,float*]*
(bind-func dsp
  (let ((oscil (osc_c 0.0))) ;; instantiates an oscilator with phase 0.0
    (lambda (in:float time:i64 chan:i64 dat:float*)
      (if (= chan 0)        ;; if sample request is for channel 0 (i.e. left if stereo)
          (oscil 0.3 220.0) ;; then return sound a 220hz tone with amplitude 0.3
          0.0))))           ;; otherwise all other channels return silence 

;; as i mentioned above we are allowed to name the callback routine anything
;; but we need to tell extempore what we did name it.  we do that using dsp:set!
;; we only call dsp:set! once per session, from that point, until the end of the
;; session, the function named 'whatever' is the audio callback 
(dsp:set! dsp)


;; we can of course recompile dsp on-the-fly
(bind-func dsp
  (let ((oscil (osc_c 0.0))) 
    (lambda (in:float time:i64 chan:i64 dat:float*)
      (if (= chan 1)         ;; swith from left channel to right channel
          (oscil 0.3 330.0)  ;; change to 330.0 hz
          0.0))))           

;; two oscillators (left and right channels)
;; we also introduce DSP - which is an alias for [float,float,i64,i64,float*]*
(bind-func dsp:DSP
  (let ((oscil_left (osc_c 0.0))
        (oscil_right (osc_c 0.0)))
    (lambda (in time chan dat)    ;; we don't need to type these anymore because we typed dsp
      (cond ((= chan 0) ;; left
             (oscil_left 0.3 330.0))  
            ((= chan 1) ;; right
             (oscil_right 0.3 220.0))
            (else ;; any other channels
             0.0)))))       

;; one multi-channel oscillator for 'n' channels
(bind-func dsp:DSP
  (let ((oscil (osc_mc_c 0.0)))
    (lambda (in time chan dat)
      (oscil chan 0.3 220.0)))) ;; any number of channels (takes additional chan argument)


;; add frequency sweep from CLM example
;; SRf is the audio samplerate (f for float)
(bind-func dsp:DSP
  (let ((oscil (osc_mc_c 0.0))
        (duration (* SRf 1.0))      ;; samplerate * 1.0 seconds
        (range (/ 440.0 duration))) ;; rise up to 440.0 hz      
    (lambda (in time chan dat)
      ;; explicit conversion required to coerce time (i64) into a float
      (oscil chan 0.3 (* range (% (i64tof time) duration))))))


;; granulate the rising oscillator
;;
;; with default settings the granulator will have
;; little effect on the original signal
(bind-func dsp:DSP
  (let ((oscil (osc_mc_c 0.0))
        (duration (* SRf 1.0))      ;; samplerate * 1.0 seconds
        (range (/ 440.0 duration))
        (grains (granulator_c 2)))   ;; setup granulator for stereo (i.e. 2)    
    (lambda (in time chan dat)
      (grains chan time  ;; granulator takes chan, time and input
              (oscil chan 0.7 (* range (% (convert time) duration)))))))


;; start stuffing with the granulators settings!
(bind-func dsp:DSP
  (let ((oscil (osc_mc_c 0.0))
        (duration (* SRf 1.0))      ;; samplerate * 1.0 seconds
        (range (/ 440.0 duration))
        (grains (granulator_c 2)))   ;; setup granulator for stereo (i.e. 2)
    ;; some initial settings for granulator (there are plenty more - check audio_dsp.xtm)
    ;; note that extempores granulator is stochastic and supports lo and hi (low and high)
    ;; ranges for most parameters with a stochastic choice for each grain in that range.
    ;; you can obviously have determinstic behaviour by making lo and hi the same value.
    (grains.iot 500)     ;; inter offset time (time between grains in samples)
    (grains.dlo 1000.0)  ;; shortest (i.e. low)  duration (in samples)
    (grains.dhi 10000.0) ;; longest  (i.e. high) duration  (in samples)
    (grains.rlo 0.5)     ;; slowest  (low) playback rate  (%50)
    (grains.rhi 2.0)     ;; fastest  (high) playback rate (%200)    
    (lambda (in time chan dat)
      (grains chan time  ;; granulator takes chan, time and input
              (oscil chan 0.7 (* range (% (convert time) duration)))))))


;; etc. etc..

Cheers,
Andrew.

p.s. installing from the Extempore binaries *should* now be as simple as downloading the binary zip/tgz/dmg for your platform and putting the enclosed directory somewhere.  This should *just work* - on all platforms - if not please let us know.


To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.

Andrew Sorensen

unread,
Aug 17, 2016, 8:24:38 PM8/17/16
to extemp...@googlegroups.com
I have been thinking about an algorithmic composition book on-and-off over the years - so maybe.

More likely are video tutorials (i.e. screencasts)  that run as a series per  topic - signal processing, music composition, 3D graphics, physics simulation - probably based around an extant book so that people can read the theory offline while following the screencasts online.  I'm pretty keen to do this - and have some suitable books in mind - I just need to find the time and resourcing to make this possible :)

To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Extempore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.

Robert Herman

unread,
Aug 17, 2016, 10:53:28 PM8/17/16
to Extempore
The videos in tandem with an existing book offline sounds ideal.

I can't speak for others, but I would contribute monthly to a tutorial series.

I think Extempore as an environment needs these resources. I compare it to the venerable CLM, and then look at the amount of stuff already generated for Sonic Pi. Did you ever take Extempore further on on the Raspberry Pi?
I'd also be interested to know if you've done anything highly distributed with it too in a sense of computations across nodes. I've been toying with Wasp Lisp. It was a Lisp created for pen testing on top of the MOSVM. It borrows from Scheme, Lisp, Python and Erlang. I think you (perhaps me when I learn Extempore more) may be able to borrow some of its ideas for spawning distributed Extempore processes. Wasp is able to send byte code to be executed on other platforms that don't have Wasp VM initially installed.

A higher concept I have for later, is to spawn evolving processes to other Extempore instances that all feedback on each other in a sort of gross neural network, or in the large. Not efficient, but something to play with.

I hope Extempore takes off more. It really is quite an accomplishment.

Rob

Robert Herman

unread,
Aug 18, 2016, 12:36:36 AM8/18/16
to Extempore
Wow, thank you so much for your time on this!

I will test it out in an hour or so. I am just reconfiguring my Extempore environment  and Emacs after having to go back to Win 8.1. Win 10 has a bug where you lose your Start menu, and you really can't fix it without a repair/reinstall, so I am dropping back ;)

Your code looks right at first glance to me. I know you are familiar with s7 Scheme from Impromptu, right? Did you leave it behind, because it is not able to be reinstantiated, but only embedded for scripting?

CLM is a wealth of information. As you know, it is old, and has a lot of generators first written in Lisp, but then with Snd, there came Scheme (s7), Ruby and Forth! Yes, Forth. I am not proficient enough yet in Extempore, and Jason Levine's NoC was helpful, and now the CLM website.

I had fun duplicating a frog sound from here in East Java per one of the CLM tutorials. GRACE is just all of the CLM, CM, and Snd stuff repackaged with JUCE to make it cross-platform. The old code runs on it with little modification in the interpreter as long as you keep in mind if it is in Scheme or Lisp.

For me, it presents a great way to learn Extempore. Open up GRACE side-by-side with Extempore, pick an example in GRACE (Scheme example, not SAL - an attempt at infixing Scheme!), play it, modify the code, and listen and learn. Then I try to go into Extempore looking in the instrument libs to see
if there is a corollary.

Thanks to you, I can follow along with your work below, and see if this will be my learning path forward, based upon some really good work in the past with CLM and music.

I'll let you know how it goes.

Thanks again!

Rob

Andrew Sorensen

unread,
Aug 18, 2016, 12:50:02 AM8/18/16
to extemp...@googlegroups.com
Extempore has been distributed from its initial inception - indeed Impromptu was fairly capable before I even started work on Extempore, and Extempore's process abstraction is largely unchanged from code I had built for Impromptu in 2005.

As a seed project for Extempore, the Physics Playroom was designed from the ground up for distributed computation and rendering in the context of a real-time interactive simulation (https://vimeo.com/58239256).  More recently Ben Swift and I have been trying to get the HPC community interested in live-coding in general - and Extempore more specifically.  You might find our recent paper "Live Programming in Scientific Simulation" worth a look - http://superfri.org/superfri/article/viewFile/72/65

Extempore certainly does need resources - no doubt about it.   Unfortunately I've been too busy building things *with* Extempore to write much *about* Extempore :)   I must also acknowledge that I'm a terrible community builder - unlike Sam, who is a master at such things ;)

Anyway, one day I'll hopefully find time to get Extempore to v1.0 and then make some, hopefully useful, resources to go along with it. 

Cheers,
Andrew.





To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.

Andrew Sorensen

unread,
Aug 18, 2016, 12:51:47 AM8/18/16
to extemp...@googlegroups.com
Yes, Impromptu incorporated a Scheme interpreter (as does Extempore) but nothing related to s7 - I'm not even sure what s7 is?

Hope the post proves useful.  Send me another *small* CLM example when you've digested that one :)

Robert Herman

unread,
Aug 18, 2016, 2:17:53 AM8/18/16
to Extempore
I remember Physics Playroom, and I know Extempore is distributed over TCP sockets. It is more the actor model that Wasp Lisp uses akin to Erlang that might have some tidbits for Extempore.

Thanks for the paper link. I was looking for something like that after I knew you were in Singapore(?) at the HPC conf.

I was becoming a PL (I won't say the wh*$! word) jumping from one to another. I've always had C, and Lisps/Schemes on my table. So now, I am back to just C, J (love it), and Scheme (going to stick with Extempore as far as I can for what I do).

Keep building! It's up to us, community, to pitch in, and I hope I can with my limited abilities. I think the GRACE open alongside Extempore might prove to be a great way to learn, and a stepping stone for other beginners. It is not that popular as evidenced by Google searches, but everything it contains is well-known, taught, and accessible (CLM/SND/CM). I will try and do a YouTube video of my process probably after I work through some more examples as you have for me.

Yes, Sam is a frenetic builder! I am not a Ruby fan though, total bias on my part. SonicPi is great fun for its intended purpose of getting livecoding and music out there for education. I like sampling, but I think to create anything original and sophisticated you need to develop or modify your own gens. Sampling can be an art too as you know. Sonic with Overtone to create ugens? Not sure, since it is SC-based.

I had a little Twitter message back-n-forth about a line in Sam's book on SonicPi where he wrote:

"For those who don’t know, live_loop is Sonic Pi’s special magic ability that no other programming language has." page 32

I raised Extempore up as far as 'live loops' go as being unique to Sonic, even though there are others, and he replied that temporal recursion is managed by the scheduler, but in Sonic it is done 'manually'? I don't know enough of the mechanics of Sonic, or Extempore for that matter to comment further.

I know Sonic does time-stretching to keep time, but pitch changes, unlike say in Ableton Live where you can stretch and maintain pitch. I failed to see what was unique in Sonic WRT live loops compared with Overtone, Extempore, Tidal, Gibber, etc...

Anyway, back to work for me...

Thanks, Andrew!

W

Robert Herman

unread,
Aug 18, 2016, 2:21:11 AM8/18/16
to Extempore
Must be old age creeping in. I thought I had read you had used s7.

s7 is a Scheme intended to be embedded; it's only a .h and .c file. It is embedded in Snd for doing the Scheme work, and I am sure in GRACE too. It was based on TinyScheme, but it has much more capabilities.


A recent article where a game dev switched from TinyScheme to s7 for his game scripting:

Andrew Sorensen

unread,
Aug 18, 2016, 2:55:10 AM8/18/16
to extemp...@googlegroups.com
I remember Physics Playroom, and I know Extempore is distributed over TCP sockets. It is more the actor model that Wasp Lisp uses akin to Erlang that might have some tidbits for Extempore.

There are many similarities between the actor model and Extempore's IPC - although obviously without 'objects' per se.

Yes, Sam is a frenetic builder! I am not a Ruby fan though, total bias on my part. SonicPi is great fun for its intended purpose of getting livecoding and music out there for education.

Yep, agreed.  It is worth highlighting the obvious though - that Extempore is a completely different project to Sonic Pi (also to Tidal, Gibber and Overtone for that matter) with a very different agenda. It is a much more ambitious project, with all of the pro's and con's that that entails.

I had a little Twitter message back-n-forth about a line in Sam's book on SonicPi where he wrote:

"For those who don’t know, live_loop is Sonic Pi’s special magic ability that no other programming language has." page 32

Yes, that is unfortunate :(
 
Cheers,
Andrew.


To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.

Andrew Sorensen

unread,
Aug 18, 2016, 2:58:42 AM8/18/16
to extemp...@googlegroups.com
Impromptu originally started with TinyScheme (v 1.35), which was then heavily modified over many years before being integrated into Extempore.  Never even new s7 existed :)  

To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.

Robert Herman

unread,
Aug 18, 2016, 3:01:18 AM8/18/16
to Extempore
Andrew, your code worked beautifully!

And, Extempore had much more detailed granulator than the GRACE sample test. I learned tons on it, and I haven't even dove fully into it.

I apologize about pasting 200 lines here, but I am not sure how to attach a file for you in Groups. My site is down for a while, so I can't link it.
What follows is GRACE's example file processes.scm on 'processes', sort of like temporal recursion and scheduling events. It can be used to 'livecode' with GRACE. The sample is heavily documented. I am trying to transliterate it into Extempore now, but go ahead whenever you can, since you are the maestro!



;
;; Musical Processes
;


; To run examples put the cursor at the end of each expression and
; press Command-Return. Look in the console window for any output.


; A 'process' is an iterative function (a combination of a function
; and a loop) that runs in the system scheduler and generates a
; unique timeline of events.  Here is a simple first example.


(define (simple)
 
(process repeat 20
           
do
           
(mp:midi :key (between 60 96))
           
(wait 0.1)
           
))


; Before listening to the process use the Midi Out menu to select the
; MIDI device you want to use and try Test Output to make sure you can
; hear sound!


; Now lets sprout the process to hear it generate output in real
; time. Notice that you can sprout overlapping instance of the process
; and each each time you sprout it the process produces a different
; variation of the algorithm.


(sprout (simple))


; You can start a process running in the future by providing an
; optional 'ahead' argument to sprout. This example tells sprout to
; start running simple 2 seconds in the future.


(sprout (simple) 2)


; To sprout more than one process at a time pass a LIST of processes
; to sprout.


(sprout (list (simple) (simple)))


; The ahead factors can also be a list, in which case each successive
; process will be paired with a successive start value


(sprout (list (simple) (simple)) '(2 2.5))


; The definition of simple looks similar to a function and a loop and
; it has a special '
wait' command. The 'wait' clause tells the process
; how much time to pause before its next iteration occurs.  For
; example '
wait .1', means that the internal time points for the sends
; will be at 0, .1, .2, .3, .4, .5, .6 ... Of course you can specify
; any wait time, even random ones as in this example.


(define (simple2)
  (process repeat 50
           do
           (mp:midi :key (between 60 96))
           (wait (odds .2 .5 .1))
           ))


(sprout (simple2))


;
;; Arguments to a '
process'
;


; As with function definition the '
process' definition command allows
; the process to receive argument values.


(define (playscale low high length)
  (process with rhy = (/ length (+ (- high low) 1))
           for key from low to high
           do
           (mp:midi :key key :dur (* 2 rhy))
           (wait rhy)))


; '
playscale' plays a chromatic scale from 'low' to 'high' within the
; time '
length' (in sec.). the expression: 'with rhy = length / (high
; - low + 1)' calculates the rhythm of each note as a proportion of
; the distance between low and high: the greater the distance the
; faster the scale.


(sprout (playscale 60 72 1))


(sprout (playscale 60 72 2))


; You can run different versions of scale in parallel at the same
; time, each with different argument values by passing a list of
; processes to sprout.


(sprout (list (playscale 72 84 5)
              (playscale 60 84 5)
              (playscale 48 84 5)
              (playscale 36 84 5)
              (playscale 24 84 5)))


; Here is a process that implements Steve Reich'
s piano phase. it
; creates a cyclic pattern to read the trope over again and stops when
; the current (elapsed) time of the process is the end time specified
; to the process.


(define (piano-phase stop keys rate)
 
(process with pat = (make-cycle keys)
           
until (>= (elapsed) stop)
           
do
           
(mp:midi :key (next pat) :dur rate)
           
(wait rate)
           
))


(let ((notes '(e4 fs4 b4 cs5 d5 fs4 e4 cs5 b4 fs4 d5 cs5))
      (stop 20))
  (sprout (list (piano-phase stop (key notes) .167)
                (piano-phase stop (key notes) .17))))
             
; You can compute different versions of a piece and choose the ones
; you like. In this example we will shuffle the trope each time to
; compose different versions of the piece each time we run it.  Since
; we are not sure what we will be hearing, we save different versions
; of the file so that we can review and choose the ones we like the
; best.


(let ((notes (shuffle '
(e4 fs4 b4 cs5 d5 fs4 e4 cs5 b4 fs4 d5 cs5)))
     
(stop 20))
 
(print "phasing trope=" notes)
 
(sprout (list (piano-phase stop (key notes) .167)
               
(piano-phase stop (key notes) .17))))


; The next process demonstrates regulation of a rit/accell in which
; the current rhythm will be continually scaled by 'fac'.


; We first define a helping function called 'chroma' to produce a
; keynum-row from 'low' to 'high'.


(define (chroma low high)
 
(loop for v from low to high
        collect v
)
 
)


(define (acc-rit key-list start-rhy fac)
 
(process for k in key-list
           
for r = start-rhy then (* r fac)
           
do
           
(mp:midi :key k :dur r)
           
(wait r)
           
))


(sprout (acc-rit (shuffle (chroma 48 85)) .1 1.05))


(sprout (acc-rit (shuffle (chroma 48 85)) .1 .95))


; The combination of multiple 'acc-rits' produces a part-wise
; proportions canon.


(define (acc-rit-list key-list tr-list r-list fac-list)
 
(loop for tr in tr-list
       
for r in r-list
       
for fac in fac-list
        collect
(acc-rit (transpose key-list tr) r fac)))


; The sprout command takes an optional second argument, the future
; time(s) to start the algorithm(s) supplied in the first argument.


(let ((lst (shuffle (chroma 60 85))))
 
(sprout (acc-rit-list lst
                       
'(-24 -12 0 12 24)
                        '
(1/4 1/8 3/16 5/16 1/16)
                       
'(1.01 1 .9 1 1.1))
          '
(0 2 4 6 8)))


; It is possible to sprout processes from inside other processes. We
; first define a process that harmonizes a shuffled and transposed
; melodic line using 4th and 5ths.


(define (ran-series fund row rhy)
 
(process for r in (shuffle rhy)
           
for k in (shuffle (transpose row fund))
           
do
           
(mp:midi :key (- k 12) :dur r)
           
(mp:midi :key k :dur r)
           
(mp:midi :key (+ k (pick 5 7)) :dur r)
           
(wait r)
           
))


(sprout (ran-series 72
                   
'(0 2 6 4 1 3 -5 8)
                    '
(.375 .125 .5 .375 .125 .25 .25 .25)
                   
))


; Now define the 'meta process' (the process that creates other
; processes) to sprout multiple ran-series processes to create low
; random staccato notes. 5% of the time is sprouts a harmonized line
; otherwise it simply plays the melodic tone.


(define (meta-proc len)
 
(process for r = (between .2 .4)
           
for k = (between 36 43)
           
until (>= (elapsed) len)
           
do
           
(mp:midi :key k :dur 1)
           
(if (odds 0.05)
               
(sprout (ran-series (+ k 36)
                                   
'(0 2 6 4 1 3 -5 8)
                                   '
(.5 .4375 .375 .3125 .25 .1875 .125 .0625))))
           
(wait r)
           
))
                     


(sprout (meta-proc 20))


---End of code paste ---

Robert Herman

unread,
Aug 18, 2016, 3:07:25 AM8/18/16
to Extempore
Agree to all you say below.

I think there is a place for many environments, but as an individual, I have to chose my weapons carefully; I'm getting old, and there's only so much time in the day.

I chose Extempore, since I want a complete platform - HPC, livecoding, music comp, graphics, scientific visualization, etc... The only thing it seems to lack for me now, is a way of sharing or distributing a creation. Even if it meant packing up a bunch of Dlls, and zipping, it wouldn't be that bad. But sharing is very important to get experiences in front of people's eyes and ears who don't code, or can't install a lot of software.
I don't code for a living, so I can afford to spend my time on it. I really like it, and I hope you guys get enough moral, and monetary support, to keep it going.

Cheers!

Robert Herman

unread,
Aug 18, 2016, 4:06:00 AM8/18/16
to Extempore
Nevermind about attaching - I see the paperclip ;)

Here'a livecoding sample using processes - livecoding.scm attached.

I'll start a new thread for these GRACE -> Extempore discussions. I really think I can develop a lesson plan using this material. It is well-structured, although Extempore would need some further examples due to its different nature. All good though.

Rob
livecoding.scm

algomusic

unread,
Aug 18, 2016, 5:41:17 PM8/18/16
to Extempore
>Yes, Sam is a frenetic builder! I am not a Ruby fan though, total bias on my part. SonicPi is great fun for its intended purpose of getting livecoding and music out there for education. 
> I like sampling, but I think to create anything original and sophisticated you need to develop or modify your own gens. Sampling can be an art too as you know. 

If you are interested I ported some of SonicPi's examples to Extempore (hopefully they still work) - see here:

ami...@gmail.com

unread,
Aug 18, 2016, 6:03:10 PM8/18/16
to extemp...@googlegroups.com
Yes, this type of screencast would be awesome.

Ben Swift

unread,
Aug 18, 2016, 7:43:52 PM8/18/16
to extemp...@googlegroups.com
This is partially my fault as well---I had grand plans about being the
"Sam Aaron"-style community builder for Extempore, but alas it seems
like I may have overestimated my skills in this area.

Oh well, the point isn't to have a pity-party on the mailing list I
guess. Thanks to our small, dedicated community - we love you guys.
Let's make Extempore great again!

Cheers
Ben

Ben Swift

unread,
Aug 18, 2016, 7:55:08 PM8/18/16
to extemp...@googlegroups.com
Also, here's a link to Andy's tutorial, slightly cleaned up.

http://digego.github.io/extempore/common-lisp-music.html

Cheers
Ben

Robert Herman

unread,
Aug 18, 2016, 11:31:55 PM8/18/16
to Extempore
No fault to be found anywhere by  anyone, really.

As Andy has said Extempore has different goals. And, they are not for the 'flash in the pan', but for ongoing exploration with a very sophisticated toolset.

I have peers who have tried SonicPi due to its ubiquity, and seemingly they have put more time into it, than I have put into Extempore. But you know what?

They all, each one have stopped, after getting over the  initial giddiness of sample remixing and some code manipulation. I've been there too. In Extempore, I go beyond my hobby of wanting to be a livecoding VJ (for myself only), and look to using if for scientific visualization and modeling. I am currently working on recreating some NetLogo models into Extempore. NetLogo is cool, but quite frankly, it could use a facelift in the graphics and sound department despite being based on Java which you would think otherwise.

With Extempore, I have started to look for ways to use it where I normally use C or the J programming language now. I have the concepts, ideas and experience to implement, but unfortunately my skills in Extempore are not there yet. It's all due to practice only. Higher concepts and abstractions and new languages take time.

We'll get there!

Robert Herman

unread,
Aug 18, 2016, 11:32:50 PM8/18/16
to Extempore
Great trascription!

This exercise for me, and Andy's assistance has really put me over a big initial hurdle. Thanks!

Rob

Circu Virtu

unread,
Aug 21, 2016, 11:43:39 AM8/21/16
to Extempore
I have had a look into CLM a while ago as well. 
Mainly through Heinrich Taube's book  – Notes From the Metalevel: an Introduction to Computer Composition.
Code examples: http://www.moz.ac.at/sem/lehre/lib/cm/Notes%20from%20the%20Metalevel/index.html

like:
(define (reduce-pcs knums)
  ;; create a scratch pad list with 12 locations to
  ;; remember the pitch classes in knums. each element
  ;; in the pad is initially false.
  (let ((pad (make-list 12)))
    ;; remember each pitch class in knums by setting
    ;; its position in the scratch pad to true.
    (loop for k in knums
          for pc = (keynum->pc k)
          do (list-set! pad pc true))
    ;; iterate over the scratch pad and return
    ;; a list of the positions where pitch classes
    ;; were recorded
    (loop for i in pad
          for j from 0
          when i collect j)))


Most of the examples use the CL loop or process macro.

(define (markov-rhythms len)
  ;; rhythms generated from first order Markov
  (let ((tbl (make-ttable rhy-table)))
    (process for i below len
             for k = 60 then (drunk k 6 :low 40 :high 80 
                                    :mode :jump)
             for r = 'q then (mran tbl r)
             for d = (* (rhythm r 120)
                        (interpl (/ i len) tcurve))
             output (new midi :time (now) :keynum k
                         :duration d)
             wait d)))


 I have not found that in extempore.
It would be great to have that in extempore as well. Any chance that will get implemented some day.
I had a look at the code but it's to heavy fro me to code that myself.

--cv
To unsubscribe from this group and stop receiving emails from it, send an email to extemporelan...@googlegroups.com.

Robert Herman

unread,
Aug 21, 2016, 11:53:06 AM8/21/16
to Extempore
Thanks, I just caught your email!

I'll have a look, and will compare to learn.

Robert Herman

unread,
Aug 21, 2016, 12:15:46 PM8/21/16
to Extempore
Yes, GRACE afforded me the ease of a cross platform setup, but now Extempore is just as easy for me to install.

I don't fully understand how 'process' is implemented under the hood. You trigger them, and you can end them by user-assigned name.
I know I read they are able to jump in on a beat and not glitch, but I am not sure about how they are scheduled or scheduable?

I am not a fan of Sal, the infix language GRACE and Nyquist are pushing. The only thing I like about Nyquist, and I am not sure if Extempore can be used, is that plugins in Audacity can be written in the XLisp of Nyquist; they are integrated. I could see making custom plugins in Extempore for Audacity! What do you say, Andrew ;) is this possible?
Maybe I'll have a look one day when I've earned my Extempore keyboard!

Rob

Andrew Sorensen

unread,
Aug 21, 2016, 6:51:36 PM8/21/16
to extemp...@googlegroups.com
Out of interest, what do you see as being the benefit of 'process'?

To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.

Andrew Sorensen

unread,
Aug 21, 2016, 6:54:26 PM8/21/16
to extemp...@googlegroups.com
Possible, yes, likely no :)  A far more useful proposition (for me at least) is native AU, VST etc..  Still not likely to happen anytime soon, but much more likely than supporting Audacity pluggins (for either writing or reading) :) 

To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.

Robert Herman

unread,
Aug 21, 2016, 10:29:33 PM8/21/16
to Extempore
I was pondering that one as an exercise for me really. I don't think it would be of too much use other than providing another way of applying Extempore-created filters and such.

Robert Herman

unread,
Aug 21, 2016, 10:34:11 PM8/21/16
to Extempore
I wouldn't know. I am trying to understand how all of the programs I have used treat time, or scheduling.

Off the bat, Extempore seems the most powerful abstraction. I just know CLM has been around for a while, and when 'process' was introduced, it seemed to be a significant contribution to the code base by the introduction and exercises about it.

I feel I am getting more and more clear on the structure and function (somewhat) of Extempore. I need that conceptual framework to advance my learning.

I am still tackling your timing examples with callbacks and temporal recursion. I understand them, but in working through some of the recursions, it can be a lot to track.
Fun anyway!

Rob

Circu Virtu

unread,
Aug 22, 2016, 1:36:54 PM8/22/16
to Extempore
Didn't have anything special in mind abour process. Just saw it used a lot in the books examples.
Maybe it's build around loop macro in some way. Syntax looks similar.

Nevertheless the loop macro looks interesting and useful for iteration.
http://commonmusic.sourceforge.net/cm/res/doc/cm.html#iteration
 
-cv
Reply all
Reply to author
Forward
0 new messages