freenode/#lisp - IRC Chatlog
Search
16:02:43
Josh_2
Whats the best resource for learning about compiler macros? I'm pretty sure there is a section in lol but I can't find it
16:08:11
heisig
Josh_2: I think I learned most of what I know by searching all Quicklisp projects for DEFINE-COMPILER-MACRO.
16:09:58
heisig
I also have some more specific rules, like "Never use &key in a compiler macro's lambda list".
16:11:44
heisig
https://lispcookbook.github.io/cl-cookbook/macros.html mentions a talk by cbaggers that also seems to explain compiler macros.
16:12:06
Gnuxie[m]
there's also this https://web.archive.org/web/20160306051951/http:/pentaside.org/paper/compilermacro-lemmens/compiler-macros-for-publication.txt
16:18:22
beach
And thanks to call-site optimization, compiler macros may soon be a thing of the past. :)
19:23:38
brandflake11
Hey all, I am having trouble with some lisp programming I am working on with Common Music. There is a function called (rhythm) that takes a symbol that represents a music rhythm (quarter-note 'q, eighth note 'e). I made a function that can parse a list and return these symbols, but rhythm doesn't like its output. I get an error "Can't parse QUOTE as a rhythm." Would anyone be willing to look at a pastebin and see where I'm going wro
19:31:35
Nilby
I would guess it would have to be like: (setq test-list '(0 e 1 s 2 q 3 e 4 q 5 s 6 t))
19:32:40
brandflake11
Nilby: The rhythm function needs the quote though. Without it, I get the error "The value e is not of type number"
19:33:17
brandflake11
The documentation for rhythm says it takes symbols, so maybe something like that?
19:34:54
brandflake11
Nilby: Oh, actually, my fault, that was the problem. I was doing something silly. Thank you Nilby!
19:45:54
brandflake11
Okay, another problem. If I do the rhythm function in a loop, like (rhythm (list-select)), I get "The value e is not of type number when binding sb-kernel::x".
19:51:47
Nilby
It's passing i to list-select which expects it to be number, and it's a symbol every alternate time. So you'd probably have to do something like (loop for (i s) in test-list ... ) so that i would only be the numbers.
19:55:02
brandflake11
Nilby: It lets you create systems that make music, instead of you having to write the notes themselves
19:58:01
Nilby
I tried it a long time ago, but I realized I'm not so good a algorithmic composing. I'm more a mindless improviser.
20:13:39
Nilby
There's quite a few people who do music with lisp/scheme, from many years back. But even a new system was created recently: OpusModus
20:14:17
brandflake11
Nilby: I've never heard of OpusModus. Do you know of any artist names that I can look up and listen to music?
20:18:29
brandflake11
That's cool, so you know someone who wrote the software? The only other lisp composer that I found so far was Andrew Sorensen, and the pieces on http://commonmusic.sourceforge.net/
20:20:25
brandflake11
Nilby: I never thought that kind of thing was super interesting, until I saw it done with lisp. That changed everything for me
20:20:49
brandflake11
Lisp just looked faster than other languages when it came to live-coding music
20:21:44
brandflake11
Totally, especially if there's also visuals. I think it would be cool to also integrate some kind of body controller that can affect the music
20:36:07
phantomics
A while back I was experimenting with using April to generate midi notes, vector languages are good for live coding thanks to the terse syntax
20:37:36
phantomics
Combine it with Slime and you can have a code file that serves as an interface, where you can C-x C-e code blocks to produce different effects
20:38:44
brandflake11
phantomics: That's what I'm doing with common music. At this point anyways, text editing with anything else but emacs is tough for me :)
20:39:58
phantomics
It's a compiler from the APL language to CL, lets you do array transformations with very little code
20:47:39
phantomics
The protocol itself is extremely simple, it takes like 30 lines of code using the lisp-binary library to create each frame
20:48:24
phantomics
Each frame is just a vector of 8-bit ints, each 3 of them setting the R G B level of each pixel