Search
Sunday, 10th of January 2021, 2:30:50 UTC
3:51:56
slondr
Hey all, is there an easy-to-use package to play musical notes?
3:52:12
slondr
Like, I want to do something along the lines of (play 'C) and hear a C note from my computer
4:01:02
Xach
slondr: i wish i could suggest something, but it's not an area i know anything about when it comes to CL.
4:01:21
Xach
and those who might know may be asleep! but maybe a q on reddit or stackoverflow would get an answer eventually.
4:01:52
Xach
ACTION thinks back to GWBASIC programs that could do this easily decades ago
4:05:15
beach
Good morning everyone!
4:07:15
slondr
Xach: ah, thanks for the insight at least
4:07:29
moon-child
slondr: nothing that I know of, but I bet you could build something pretty easily off of oss
4:08:24
Xach
moon-child: "easily"!!
4:08:53
moon-child
sin waves are easy to construct. A4 is (usually) 440Hz, and you scale by increments of 2^1/12
4:09:10
moon-child
s/increments/factors
4:09:52
beach
It is easier to use the MIDI interface for that.
4:10:16
moon-child
oss has a midi interface?
4:10:20
slondr
certainly seems a little more involved than just (play-note "C") etc
4:10:40
beach
I didn't know OSS was a requirement.
4:11:39
beach
slondr: I am sure there are systems that use the MIDI interface. OpenMusic must be doing something like that.
4:11:50
moon-child
didn't mean to imply that it was; just thought that you were. What midi interface were you referring to?
4:13:10
beach
Oh, maybe that's just input.
4:13:24
beach
In which case you need to use something like Timidity.
4:13:39
moon-child
I think that's for interacting with midi hardware devices; both input and output, but not a regular speaker
4:13:45
beach
Let me check what I did for Gsharp. I know it was very simple.
4:13:54
slondr
beach: that seems *way* more involved than (play-note "C4")
4:15:29
beach
moon-child: You are right. I wrote a MIDI file and started Timidity.
4:15:36
slondr
Although if there's nothing that does precisely what I'd like, it may be worth the extra effort
4:15:58
beach
slondr: It is one of those things that are easier to write than to specify.
4:16:21
beach
slondr: What's the volume? How long does the note last? What's the sound?
4:17:03
beach
slondr: If all you want is a sine wave, it's a 5-line program.
4:18:26
moon-child
slondr: a little googling suggests https://ccrma.stanford.edu/software/snd/snd/clm.html
4:19:06
slondr
moon-child: yeah I found that in my searching, it's very mechanical though
4:19:18
edgar-rft
slondr: don't know how much it is maintained but looks reasonably simple -> https://www.cliki.net/sb-simple-audio
4:20:22
edgar-rft
slondr: another alternative would be -> https://filonenko-mikhail.github.io/cl-portaudio/
4:22:20
slondr
edgar-rft: I'll try that one I guess
4:22:30
slondr
I'm disappointed that this isn't a solved problem really
4:23:00
beach
OpenMusic is a solution.
4:23:40
edgar-rft
slondr: a complete CL realtime synth is -> http://incudine.sourceforge.net/
4:24:19
slondr
My use case is I have some other function that generates note sequences, eg (E G B A C), I just want to hear what that sequence sounds like, preferably without defining instruments or dealing with frequences and all that other stuff
4:24:24
slondr
Perhaps I am just lazy
4:25:35
beach
slondr: That's a very specific use case that you can't expect to have a pre-existing library for.
4:25:54
beach
slondr: Normally, you would want to know the instrument, the duration, the volume, etc.
4:26:18
fiddlerwoaroof
slondr: common music has something like that, I think
4:26:29
fiddlerwoaroof
But I think they switched from CL to scheme a while ago
4:26:39
slondr
beach: something like this exists for python I believe
4:53:03
slondr
moon-child: sadly the download link for CLM 404s, and afaict it's not in quicklisp
4:53:47
moon-child
slondr: there are two links; the second works fine for me
4:54:10
slondr
oh! I hadn't noticed that
4:59:00
bmansurov
** NICK Guest71249
5:00:20
Guest71249
** NICK bmansurov`
5:02:01
bmansurov`
** NICK bmansurov_
7:09:33
Aurora_v_kosmose
** NICK aurora\uwu^test
7:09:51
aurora\uwu^test
** NICK Aurora_v_kosmose
11:17:04
ecm
How do I make emacs indent common lisp code properly ?
11:18:39
beach
Specifically, the slime-indentation module, but I believe it is on by default now.
11:19:05
ecm
I have a slime instance running, should I expect it to indent it normally ?
11:19:31
beach
It is not perfect, but it's pretty good.
11:19:36
beach
Are you having difficulties?
11:20:18
ecm
It's not indenting sub-functions under a function like it would with let or some other built-in function
11:20:26
beach
Indentation is important mostly for the buffer in Lisp mode.
11:20:48
beach
What is a "sub-function"?
11:21:19
ecm
sorry, not just a sub-function, any expression
11:21:36
ecm
it indents it to the line below the function name
11:21:58
beach
Are you sure your buffer is in Lisp mode?
11:22:11
ecm
unlike let where it indents it 2 spaces after the start
11:22:16
beach
Did you visit a file named xxx.lisp?
11:22:36
ecm
I can confirm it's in lisp-mode
11:22:47
ecm
and I have a slime instance running
11:22:50
beach
You need to paste the code. Try the plaster.tymoon.eu
11:26:13
beach
ecm: Did you manage to paste your code there?
11:27:58
ecm
https://plaster.tymoon.eu/view/2236#2236
11:28:06
ecm
this is what emacs indents the code as
11:28:26
beach
Erm, do you have TABs in there?
11:28:44
beach
ecm: Please untabify it first.
11:31:20
ecm
https://plaster.tymoon.eu/view/2236#2236
11:31:48
beach
No, untabify means that you replace TABs by spaces.
11:32:05
ck_
ecm: emacs has a command called 'untabify' -- M-x untabify
11:32:24
beach
Now you need to indent the buffer again, and then untabify it.
11:32:55
ck_
which will probably produce the exact same text as before though
11:33:37
ck_
like I predicted ;) your emacs is set to indent using tabs, that's the issue you need to address first
11:34:25
ecm
I expected crt:with-windows to be indented 2 spaces from crt:with-screen
11:34:29
beach
ecm: You need to do C-x h and then M-x untabify.
11:34:54
ck_
try M-x customize-variable indent-tabs-mode, set it to off -- that's my guess
11:35:21
beach
Ah, that depends on the definition of the macro WITH-SCREEN.
11:36:25
beach
OK, let's see. Have you loaded the system that defines crt:xxx?
11:37:03
beach
Let me see if I can reproduce it. What's the system?
11:37:15
ecm
croatoan, an ncurses library
11:37:39
ecm
I've loaded it in slime already
11:37:41
beach
But the fact that you did that on the first line doesn't mean it is loaded.
11:37:49
beach
OK, let me try it then...
11:38:02
ecm
I typed "(ql:quickload :croatoan)" inthe SLIME REPL
11:38:18
beach
yes, that's what I meant.
11:38:38
ecm
When I do a C-M-q it indents it like that
11:40:57
beach
So, how exactly did you create this code? How did you start emacs, SLIME, and how did you create the buffer?
11:41:55
ecm
I opened the file as normal, I've added a slime-company hook for the file, I then started slime, loaded croatoan, compiled the file and did a C-M-q expecting to indent properly
11:45:27
ck_
what's wrong with cmq? "C-M-q (translated from <escape> C-q) runs the command indent-sexp"
11:46:07
beach
I guess if you do it on the first opening parenthesis, it works.
11:46:18
beach
But only for one expression.
11:46:27
ck_
I thought that was what this was about, my mistake if not.
11:47:08
beach
I may be wrong of course.
11:47:14
ecm
I restarted emacs just in-case
11:47:42
beach
ecm: Did you do C-M-q when the cursor was before (defun?
11:48:23
beach
What about C-x h and then C-M-\
11:48:55
ecm
ok it just worked once I restarted
11:49:48
beach
Hmm. Disconcerting! OK, good luck.
11:52:01
ck_
did you change indent-tabs-mode in the meantime?
11:52:31
ecm
am I not supposed to be using tabs for indentation ?
11:53:16
ck_
I think it is the consensus to use spaces today
11:59:07
beach
Yeah, everything looks better that way.
11:59:27
beach
Git diffs, paste sites, etc.
14:23:52
puchacz
hi, to play with ecl (I am interested in android), I need to sudo apt get ecl first, to get any version, then compile the newest one and follow some tutorials?
14:24:14
puchacz
the manual says ecl should be compiled with ecl
14:29:07
spoeplau
I'm trying to do (defctype foo :pointer) with several types '(foo bar baz), and I'm looking for a way to do something like (dolist (name '(foo bar baz)) (defctype name :pointer)). It doesn't quite work like this because "name" isn't evaluated, and the best I've been able to come up with so far is to define my own macro and then call it just once. Is there a better way?
Sunday, 10th of January 2021, 14:30:50 UTC