freenode/lisp - IRC Chatlog
Search
17:01:34
sjl
Shinmera: I see the word "segment" a lot in the docs, but it's not defined first. what is a segment?
17:01:56
Shinmera
The basic idea is that there's a DAG of segments which do some computation on audio buffers. There's sources, which translate raw data from some format to the internal, "decompressed" buffers. Then there's drains which do the opposite. Everything else does buffer->buffer transformations.
17:03:50
Shinmera
Each segment has a number of options, and a number of input and output ports, each of which carry a buffer and potential, other options.
17:07:58
sjl
Shinmera: okay I gotta go, I'll ping you later after I read cl-mixed's docs on my lunch break
17:41:24
sjl
Shinmera: another unrelated question: I have a bunch of music files I'd like to play as background music for my game, and when one finishes I'd like to start another one
17:41:55
sjl
is the right way to do this to save the source I get back from (play ...)and check (ended-p ...) on each tick?
17:48:07
Shinmera
Better would probably be to subclass the source and add an :after method to (setf ended-p) that starts the next track.
17:51:23
sjl
That's another thing I wasn't clear on -- if I subclass the source, will that new subclass be used for ALL mp3 files?
17:52:13
Shinmera
PLAY doesn't do too much so you can also replicate what it does easily enough if you already have an instance.
17:53:10
sjl
So it would be something like (defclass music-source (mp3-source) ...) ..after method on setf ended-p... (play "foo.mp3" :music :source-type 'music-source) ?
17:53:32
Shinmera
Well, I'd probably make what you want to play next a slot on the class so you can chain things and parametrise it, yeah?
17:55:07
Shinmera
Actually you'd probably want to do it on a :before method and instead do something like (add (make-instance 'bla ...) (mixer source))
17:55:56
sjl
(mixer source) is to automatically add it to the same mixer as the thing that's ending?
18:42:37
Xach
Hmm, what's a good example of a project named "cl-foo" that defines a system named "foo"?
19:07:32
minion
dim, memo from _death: maybe you'll find what I hacked this past few hours a useful start - https://github.com/death/TIC-80
19:52:30
pjb
_death: given that you can define defglobal in two lines, why should it have it? Just do it!
20:00:37
scymtym
pjb: which aspects would that replicate? performance characteristics or behavior or both?
20:10:22
scymtym
then again, _death said "like sb-ext:defglobal", so he could have referred to a subset of its behavior
21:14:41
aeth
(defparameter *foo* (list 1 2 3)) (define-symbol-macro foobar (elt *foo* 2)) (macroexpand-1 'foobar) => (ELT *FOO* 2)
21:16:28
aeth
in fact, referencing things that aren't global won't work, e.g. (let ((temp (elt *foo* 2))) (define-symbol-macro barfoo temp)) ; barfoo will only work in places where there's a defined temp, like e.g. (let ((temp (elt *foo* 2))) barfoo)
21:27:52
aeth
I suppose the way to handle it properly would be to have a mutable global *foo* (probably an array or hash table, though) because otherwise setf won't work as expected.
21:27:54
_death
pjb: yes, for my purposes defvar+define-symbol-macro could work.. I just wanted to know whether ecl already has such a thing
21:34:57
aeth
At the very least, there's no mention of it here. https://common-lisp.net/project/ecl/static/ecldoc/Extensions.html
21:36:35
_death
guess that for a nicer CL experience w/ tic-80 there'd have to be a specific module.. but that is a job for another time
23:16:21
pierpa
CCL's DEFGLOBAL doesn't do what I understand you are talking about here. It's only vaguely related to global variables.
3:36:24
Josh_2
I left my laptop on, I was attacked by someone I know so that sobered me up pretty fast