From 085bf3d1e95634bffb24d131984d1505695eb4c1 Mon Sep 17 00:00:00 2001 From: Mustafa Date: Wed, 7 May 2014 17:08:32 -0700 Subject: [PATCH] added structures to routing --- oregano/TODO.md | 6 ++++- oregano/routing.rkt | 27 ++++++++++++++++---- rsc3/examples/routing.rkt | 53 --------------------------------------- 3 files changed, 27 insertions(+), 59 deletions(-) delete mode 100644 rsc3/examples/routing.rkt diff --git a/oregano/TODO.md b/oregano/TODO.md index 81e1b32..5adb39b 100644 --- a/oregano/TODO.md +++ b/oregano/TODO.md @@ -23,7 +23,11 @@ Oregano will have these concepts/objects: ## Functionality -- adding filters +- adding filters to tracks +- ability to change filter parameters +- playing a note from an instrument on a track. +- load sound files into buffers, and play them using notes. + - create instruments diff --git a/oregano/routing.rkt b/oregano/routing.rkt index 5b3308d..a225de5 100644 --- a/oregano/routing.rkt +++ b/oregano/routing.rkt @@ -22,21 +22,33 @@ tracks: (note-on my-piano C#3 track3) |# - -(define effects-list '()) +(define num-tracks 8) +(define tracks (make-vector num-tracks '())) + + +;; returns the effect list for a given track +;; track-num is 1-based +(define (get-track-effects track-num) + (vector-ref tracks track-num)) + ;; adds an effect to the end of the effect chain of the given track (define (append-effect track-num effect-ugen) - ; TODO - empty) + (define current-effects (get-track-effects track-num)) + (vector-set! tracks track-num + (append current-effects (list effect-ugen)))) + +(append-effect 3 'reverb) +(append-effect 3 'echo) ;; creates a ugen that is routed ;; in-bus: input bus channel ;; out-bus: output bus channel (define (make-effect-ugen effect-ugen in-bus out-bus) ; TODO + empty) ;; example effect ugen @@ -44,10 +56,15 @@ tracks: (mouse-y kr 0 1 0 0.1) 0.5))) -(define (make-freeverb-with-in-out in-bus out-bus) +#;(define (make-freeverb-with-in-out in-bus out-bus) (out out-bus (free-verb (in 1 ar in-bus) 0.5 (mouse-y kr 0 1 0 0.1) 0.5))) +;;(define freeverb-effect make-freeverb-with-in-out) + + + + diff --git a/rsc3/examples/routing.rkt b/rsc3/examples/routing.rkt deleted file mode 100644 index 5b3308d..0000000 --- a/rsc3/examples/routing.rkt +++ /dev/null @@ -1,53 +0,0 @@ -#lang racket - -#| -tracks: - -0 - output left speaker -1 - output right speaker -3 - first track - -## example usage - -; add reverb to track 3 -(append-effect track3 (reverb-effect 0.5 0.9)) - -(append-effect track3 (reverb-effect 0.5 0.9)) - -; done internally: -; (process-track 3) - -(define my-piano (make-instrument "piano")) - -(note-on my-piano C#3 track3) - -|# - -(define effects-list '()) - - - -;; adds an effect to the end of the effect chain of the given track -(define (append-effect track-num effect-ugen) - ; TODO - empty) - -;; creates a ugen that is routed -;; in-bus: input bus channel -;; out-bus: output bus channel -(define (make-effect-ugen effect-ugen in-bus out-bus) - ; TODO - empty) - -;; example effect ugen -#;(audition (out 0 (free-verb (in 1 ar 16) 0.5 - (mouse-y kr 0 1 0 0.1) - 0.5))) - -(define (make-freeverb-with-in-out in-bus out-bus) - (out out-bus (free-verb (in 1 ar in-bus) 0.5 - (mouse-y kr 0 1 0 0.1) - 0.5))) - - -