A DISTRIBUTED SYNCHRONOUS MEMORY FOR NETWORKED
LIVECODING PERFORMANCE
 
Audio Recordings & Code Listings
 
 
 
All audio files can be downloaded from http://public.me.com/digego.  Please be aware that the audio files are all 3 channel OGG format audio files (50M) - audacity (v1.3+) should cope with them fine.  Excerpts are all taken from the 7-8 minute marks of the 30 minute recording and are about 2M in size.  
 
Some of the code examples in the ICMC paper were very slightly simplified for clarity (particularly in the metronome test) and to more easily fit into the document.  The full code listings as run for the tests are shown here in full:
 
 
SIMPLE SYNC TEST
 
(define loop
   (lambda ()
      (spaces:take "note/varese" 'pitch)
      (play-note (now) piano pitch 120 1000)
      (loop)))
 
;; this starts the recursion
(loop)
 
Listing 1.  Sync test, reader code - (as used on host varese)
 
 
;; repeat once every second
(define timed-loop
   (lambda ()
      (spaces:write "note/varese" 60)
      (spaces:write "note/debussy" 63)
      (spaces:write "note/acidimac" 67)
      (schedule (+ (now) *second*) timed-loop)))
 
;; this starts the timed loop
(timed-loop)
 
Listing 2.  Sync test, reader code - (as used by host debussy which ran as both reader and writer)
 
You can download the 30 minute audio recording “spaces_sync_30.ogg” in OGG format from http://public.me.com/digego.  There is also a 1 minute excerpt available.  An AIFF is available by request.
 
 
 
GLOBAL CLOCK SYNC TEST
 
(define loop
   (lambda ()
      (spaces:take "note/varese" 'pitch 'ctime)
      (play-note (clock->samples ctime) piano pitch 80 1000)
      (loop)))
 
;; this starts the recursion
(loop)
 
 
Listing 3.  Global Clock Test , reader code - (as used on host varese)
 
 
;; repeat once every second
(define timed-loop
   (lambda ()
      (let ((time (clock)))
         (spaces:write "note/varese" 60 time)
         (spaces:write "note/debussy" 63 time)
         (spaces:write "note/acidimac" 67 time)
         (schedule (+ (now) *second*) timed-loop))))
 
;; this starts the timed loop
(timed-loop)
 
 
Listing 4.  Global Clock Test, writer code - (as used by host debussy which ran as both reader and writer)
 
You can download the 30 minute audio recording “spaces_timed_30.ogg” in OGG format from http://public.me.com/digego.  There is also a 1 minute excerpt available.  An AIFF is available by request.
 
 
 
 
METRONOME TEST
 
 
;; reader plays 1 note every beat
(define loop
   (lambda (beat)
      (play-note (*metro* beat) piano 67 120 1000)
      (callback (*metro* (+ beat 1)) 'loop (+ beat 1))))
 
(loop (*metro* 'get-beat 4))
 
;; reader listening for tempo changes
(define tempo-watch
   (lambda ()
      (spaces:bind "spaces:tempo" 'ctime 'bpm 'beats)
      (sys:wait (clock->samples ctime))
      (set! *metro* (make-metro bpm (cons (clock->samples ctime) beats)))
      (spaces:wait "spaces:tempo")
      (tempo-watch)))
 
(tempo-watch)
 
 
;; writer randomly sets tempo changes
(define random-tempo
   (lambda (beat dur)
      (spaces:set-tempo (clock) (cosr 160 100 1/32))
      (callback (*metro* (+ beat dur)) 'random-tempo
                (+ beat dur)
                (random (cons .95 1/4) (cons .05 8)))))
 
(random-tempo (*metro* 'get-beat 4) 2)
 
Listing 5.  A Metronome Example
 
You can download the 30 minute audio recording “spaces_metro_30.ogg” in OGG format from http://public.me.com/digego.  There is also a 1 minute excerpt available. An AIFF is available by request.