Replies: 4 comments 3 replies
-
Just to avoid possible duplication of work, I wanted to mention I've been working on functionality that will dump UGens from the current SuperCollider installation, by way of an Here's what I have currently for an implementation of FbNode from Feedback: ;;; fbnode
(defclass fbnode () ; (sc::ugen)
((num-channels :initarg :num-channels :initform 1)
(frames :initarg :frames :initform 1024)
(phase :initarg :phase :initform nil)
(max-delay-time :initarg :max-delay-time :initform nil)
(local-buf :initarg :local-buf :initform nil)
(interpolation :initarg :interpolation :initform 2)))
(defmethod cl-collider::floatfy ((fbn fbnode))
(buf-rd.ar (slot-value fbn 'num-channels)
(slot-value fbn 'local-buf)
(sc::-~ (slot-value fbn 'phase) (sc::server-options-block-size (sc::server-options *s*)))
1
(slot-value fbn 'interpolation)))
(defun fbn (&optional (num-channels 1) max-delay-time (interpolation 2))
(let* ((sample-rate 44100)
(block-size (sc::server-options-block-size (sc::server-options *s*)))
(max-delay-time (or max-delay-time (/ block-size sample-rate)))
(frames (+ (* max-delay-time sample-rate) block-size))
(fbn (make-instance 'fbnode
:num-channels num-channels
:frames frames
:phase (phasor.ar 0 1 0 frames)
:max-delay-time max-delay-time
:local-buf (local-buf frames num-channels)
:interpolation interpolation
)))
(clear-buf (slot-value fbn 'local-buf))
fbn))
(export 'fbn)
(defun fbn-read (fbn &optional (delay (slot-value fbn 'max-delay-time)))
"Read from FBN at a time DELAY seconds from its input. DELAY defaults to the fbn's max delay time."
(let* (;; (delay (or delay ))
(block-size (sc::server-options-block-size (sc::server-options *s*)))
(sample-rate 44100)
(offset (sc::min~ (sc::max~ (sc::*~ delay sample-rate) block-size)
(sc::-~ (slot-value fbn 'frames) block-size))))
(buf-rd.ar (slot-value fbn 'num-channels)
(slot-value fbn 'local-buf)
(sc::-~ (slot-value fbn 'phase) offset)
1
(slot-value fbn 'interpolation))))
(export 'fbn-read)
(defun fbn-write (fbn input)
"Write INPUT to FBN."
(buf-wr.ar input
(slot-value fbn 'local-buf)
(slot-value fbn 'phase))
input)
(export 'fbn-write) I didn't submit it yet because it still needs to be cleaned up and fixed/improved in a few ways. Example usage: (proxy :feedback
(let* ((freq (mouse-y.kr 20 20000 :exp))
(feed (mouse-x.kr 0 100 :lin))
(fbn (fbn 1 0.1))
(sig (sin-osc.ar freq (* feed (fbn-read fbn 0.1))))
(_ (fbn-write fbn sig)))
(pan2.ar sig))) Personally, I am of the opinion that it would be nicer to have UGens like Feedback/FbNode/Fb1 together as part of cl-collider itself rather than as separate libraries. But for the more "opinionated" ones like ddwMixer that present a way of working that is different from standard SC, a separate library might make more sense. But again, that is just my opinion. |
Beta Was this translation helpful? Give feedback.
-
I am going to start working on porting the most basic functionality of the CuePlayer quark (https://github.com/dathinaios/CuePlayer/tree/master) over to cl. I use this all the time for structuring our performances, so it is kind of essential for me if I am ever going to make the switch over to lisp from sclang... I will definitely need a bit of help for this one, but I will shout out as the issues arise. I'd start out with a non-gui version, just evaluating code from emacs or the repl, but as it develops I would't mind a bit of gui bling as well. |
Beta Was this translation helpful? Give feedback.
-
OK, first question: What is the cl-collider equivalent of SystemClock.sched? I'm trying this kind of stuff: (sc:at (+ 2 (sc:now) (print "hello")))
(sc:callback (+ 2 (sc:now) (lambda () (print "hi")))) but I'm getting a complaint that the function should return a number. So, the question is, how to schedule arbitrary code to be executed at n seconds into the future (in absolute time, that is, not musical time)? |
Beta Was this translation helpful? Give feedback.
-
I've done some preliminary work on the Here's the code: https://codeberg.org/kflak/qp Any feedback is much appreciated! |
Beta Was this translation helpful? Give feedback.
-
I'm going to start porting some quark functionality from SuperCollider that I find useful, and create libraries for them. These won't be exact ports, but will provide lispy and strongly opinionated versions of them.
Current candidates are the following:
Happy to consider any other quarks that people think are useful.
Beta Was this translation helpful? Give feedback.
All reactions