From 3cf9feed7d7db138c894e4ebd1816fc276bcaff1 Mon Sep 17 00:00:00 2001 From: Mustafa Date: Tue, 25 Feb 2014 20:36:16 -0800 Subject: [PATCH] added 2 testcases to rhs.rkt just to see how rackunit works --- rhs/rhs.rkt | 8 ++++++++ rsc3/examples/ring3.rkt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 rsc3/examples/ring3.rkt diff --git a/rhs/rhs.rkt b/rhs/rhs.rkt index 66a0739..a78bc30 100644 --- a/rhs/rhs.rkt +++ b/rhs/rhs.rkt @@ -773,3 +773,11 @@ Licensed under GPL (2 or 3? FIXME) (let ((lr (partition* (compose not pair?) t))) (cons (fst lr) (levels (concat (snd lr)))))))) + + +(module+ test + (require rackunit) + (check-equal? (drop 2 '(1 2 3 4 5 6)) '(3 4 5 6)) + (check-equal? (transpose '((1 2) (3 4))) '((1 3) (2 4))) + ) + diff --git a/rsc3/examples/ring3.rkt b/rsc3/examples/ring3.rkt new file mode 100644 index 0000000..31ae1eb --- /dev/null +++ b/rsc3/examples/ring3.rkt @@ -0,0 +1,30 @@ +#lang racket + +(require rsc3) + + +;; from rsc3/help/ugen/binary-ops/ring3.help.scm + + +;; make group 1 +(with-sc3 (lambda (fd) (send fd (g-new1 1 add-to-tail 0)))) + +(audition + (out 0 (mul (ring4 (f-sin-osc ar 800 0) + (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) + 0.125))) + +(let ((a (f-sin-osc ar 800 0)) + (b (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0))) + (audition + (out 0 (mul (sub (mul3 a a b) (mul3 a b b)) + 0.125)))) + + +(audition + (out 0 (mul (ring3 (f-sin-osc ar 800 0) + (f-sin-osc ar (x-line kr 200 500 5 do-nothing) 0)) + 0.125))) + +;; to stop sound and reset nodes/groups +;; (with-sc3 reset)