From e69605a3ee58395318c2790d49f10a2d29a77a45 Mon Sep 17 00:00:00 2001 From: Mustafa Date: Wed, 21 May 2014 08:33:02 -0700 Subject: [PATCH] added make-instrument --- oregano/instrument.rkt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/oregano/instrument.rkt b/oregano/instrument.rkt index f506068..4d8827a 100644 --- a/oregano/instrument.rkt +++ b/oregano/instrument.rkt @@ -15,6 +15,10 @@ (set! current-node-id (add1 current-node-id)) current-node-id) +(define custom-synth-num 1) +(define (gen-synth-name) + (set! current-node-id (add1 current-node-id)) + current-node-id) (define (wave-instrument wave-func) (letc ([bus 0] @@ -41,8 +45,13 @@ ;; TODO (define (make-instrument graph) - (letc ([bus 0]) - (out bus graph))) + (let ([synthedef (letc ([bus 0]) + (out bus graph))] + [name (format "synth~a" current-node-id)]) + + (with-sc3 (lambda (fd) + (send-synth fd name synthdef))) + )) ;; setup ;; show osc messages on server