From 64c2682524509f738199709a8172c471194c353e Mon Sep 17 00:00:00 2001 From: nik gaffney Date: Thu, 16 Apr 2009 18:28:51 +0200 Subject: [PATCH] updated to use tasks --- bamboo/llink.scm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/bamboo/llink.scm b/bamboo/llink.scm index 198140f..8769c2a 100644 --- a/bamboo/llink.scm +++ b/bamboo/llink.scm @@ -2,6 +2,8 @@ ;; in fluxus from pd. requires llink.pd to be running in pd and the ;; 'frame-functions' to be loaded. +(require mzlib/string) + (define t1 0) (define c1 (vector 0 0 0)) (define v1 (vector 0 0 0)) @@ -24,4 +26,22 @@ (draw-cube) (pop)) -(add-frame-fcn spin) + +(define (osc-repl) + (cond ((osc-msg "/code") + (printf "eval..~% ~a~%" (pd-filter (osc 0))) + (eval-string (pd-filter (osc 0)) osc-repl-err)) + ((osc-msg "/ping") + (printf "ping... ~%")))) + +(define (osc-repl-err err) + (printf "xcrrERR: ~a~%" err)) + +(define (pd-filter str) + (regexp-replace* "_" str " ")) + +(osc-source "88008") + + +(spawn-task osc-repl) +(spawn-task spin)