freenode/lisp - IRC Chatlog
Search
16:28:37
Shinmera
Hmm yes, punishing curiosity is definitely a good thing and posting something malicious to trick people makes me a good, likeable person.
16:28:38
_death
will someone fall for (format t "~{,2F~^ ~}" (loop repeat 5 collect (random 1.0))) ?
16:29:31
jmercouris
It's definitely not trolling, I didn't have the intent to rile anybody up or trick anyone, I was just making a joke
16:30:03
jmercouris
The joke was that I was running the command somewhere on my system, or on one of my machines
16:31:03
jmercouris
I think we can let this one go now, I apologize, for anyone reading this conversation in the future, please do not run the command as it will recursively delete all of your directories given enough permissions to do so
16:51:02
pjb
jmercouris: can you imagine that some people actually drilled into their iPhone 7 to add an audio plug!
16:54:10
pjb
beach: For now, I have no idea. I'm looking for a new job (to pay taxes). I probably will be busy for the next one…
17:01:56
beach
Though, I understand that they are still looking for a program chair. If anyone knows anybody that might accept this important task, please contact a member of the steering committee.
17:41:57
sjl
Shinmera: I didn't have time to do much of anything last night, but maybe I can ask you some stuff today to clarify things in my brain
17:42:23
sjl
Shinmera: so, the general idea of Harmony is that you have a Mixer that plugs together a bunch of segments
17:43:24
Shinmera
A "mixer" is basically just a collection of segments that are run in order when the mixer is run.
17:45:44
sjl
one thing I wasn't clear on: are there actual separate buffers between each, or is it just a single buffer that gets operated on by each one in turn?
17:46:38
Shinmera
buffers are basically just float arrays. you can re-use them or not, but obviously if you have two channels you can't use the same buffer for both.
17:46:59
Shinmera
Harmony obscures that detail because it includes a system to automatically handle buffer allocation for you.
17:48:03
Shinmera
That stuff happens in pipeline.lisp. The actual allocation algorithm is in the Flow library, though.
17:49:19
sjl
what I'd probably want to do is use the vanilla mp3 source's (decode ...) to fill a buffer in memory in the initialize-instance :after method on my preloaded source
17:49:46
Shinmera
What I think you should do is look at https://github.com/Shirakumo/harmony/blob/master/sources/buffer.lisp and try to make it work with a data array that's initialised with a complete buffer read by cl-mpg123.
17:51:37
sjl
so instead of (play "foo.mp3" :sfx :type 'mp3-source), it would end up being (defparameter *foo* (read-mp3-file-into-buffer "foo.mp3")) ... (play *foo* :sfx :type 'buffer-source)
17:54:42
Shinmera
Maybe something like making play accept a CFFI pointer or some struct that encapsulates a raw audio array
17:54:58
Shinmera
And then change the source interface to include generic versions to decode stuff into such arrays.
17:55:10
sjl
What's the deal with https://github.com/Shirakumo/harmony/blob/master/sources/mp3.lisp#L70-L96 then?
17:55:51
Shinmera
That was a hasty attempt at making things work as I was pressed for time before a jam.
17:56:10
Shinmera
It's not because it ties logic that's part of the decoding and logic that's just part of the buffer together.
17:57:11
Shinmera
We'll probably want some class that contains a data array, size, encoding, channels, structure, and sample rate, from which actual sources can then be spawned.
17:58:51
Shinmera
The idea would be that you'd keep this structure around and allocate it ahead of time, whereas sources are used to actually play it back at run time.
17:59:39
sjl
well, I guess if you wanted multiple concurrent copies of some audio effect, you'd need to have multiple sources
17:59:46
Shinmera
You can, but especially with sfx where you might need to play multiple instances of the same thing simultaneously, that doesn't really work.
18:00:09
Shinmera
And just logic-wise it's easier to simply say "hey, play this back" and not have to worry about reusing it if you don't have to.
18:43:21
sjl
Shinmera: I guess the thing that still feels weird would be the filling of that preloaded buffer, because it would use an mp3-source to fill a buffer which would then be used by sources
18:43:36
sjl
or are you thinking there would be some really basic (read-mp3-file-into-buffer ) function
18:50:44
Shinmera
The high-level interface would probably then also get a LOAD function analogous to PLAY that loads to this buffer struct thingy based on the source implementation.
18:52:47
Shinmera
While I'm on that, more source types is another obvious improvement area. Especially supporting WAV, OGG, and FLAC would be good.
18:56:55
Shinmera
More filter segments on libmixed would also be nice, particularly high/low-pass filtering, reverb, and distorion.
19:05:49
jmercouris
beach: seems like people are always conflating language with implementation, now that you've made me aware of the difference, I see it everywhere: https://getstream.io/blog/switched-python-go/?a=b
19:22:48
bigos
https://github.com/bigos/qtools-testdrive/blob/hello-notepad/src/qtools-testdrive.lisp
19:32:09
bigos
i guess i will try another time, i found few c++ examples but i have no clue how to translate them to qtools, i guess it's time to have a break
19:39:27
phoe_
bigos: I have some qtools experience that includes translating C++ Qt to CL Qtools, I might be able to help you later on here or #lisp-pl
20:09:01
jmercouris
What's a good way of declaring an interface in CL? Let's say I have like a superclass "Potato" and then I want child classes to implement "grow" methods, how could I force them to do that?
20:12:16
Shinmera
jmercouris: Generally you don't force people to do things in CL. Just document it.
20:12:40
phoe_
it's GPL though, I haven't been able to contact the maintainer to relicense it elsewhere
20:13:27
jmercouris
Bicyclidine: pjb: thank you guys for your help, I'll either copy the macro into my code or just not use interfaces
20:13:50
Shinmera
If you want to check whether you didn't forget to implement methods, you could build a little tool that traverses the class hierarchy and checks whether your applicable generic functions do have a method that specialises on each class.
20:13:53
jmercouris
maybe this is an X-Y problem, let me describe what I'm actually trying to do, and you can tell me whether you think my approach is sound
20:14:57
jmercouris
Alright, so I have some graphical view, and I want to implement two different backends, because I want 99% of my code to be agnostic to the different graphical backends, I want to create an interface with some expected behavior, that way I can make a change to the "core" of the program, and know that it will work with both interfaces
20:17:34
phoe_
https://github.com/robert-strandh/McCLIM/blob/b3546424f68ccc72c762ccb8be16400768ad2479/Core/clim-basic/protocol-classes.lisp#L24
20:18:48
phoe_
jmercouris: I've mailed the author if he can relicense that code, maybe we'll get him to respond.
20:20:06
jmercouris
phoe_: http://gplv3.fsf.org/wiki/index.php/Compatible_licenses#GPLv2-compatible_licenses
20:23:42
phoe_
it's full GPLv2, so even using this code as a library in your code counts as being infected with stallmanovirus
20:24:58
jmercouris
phoe_: that's what I'm saying, I can't pull it into my code, I refuse that license
20:27:51
phoe_
in the worst case, I'll just clean-room reimplement that macro based on its specification
20:39:41
pjb
Not necessarily. AFAIK, You could include GPL2 code in a LGPL library, and use this library in a BSD project, as long as the library doesn't contain core functinality of your project, and it may easily be replaced by a BSD library.
20:44:43
phoe_
https://softwareengineering.stackexchange.com/questions/342156/can-i-use-some-gpl-code-in-lgpl-project
20:48:13
jackdaniel
also saying, that pulling gplv2 to repository makes your code have same license is bs, it just means, that derived work is gplv2 - you still may copy your bsd code from the core library to other bsd project without any implications
20:52:20
jackdaniel
I would appreciate (if you really dislike LGPL2+) not linking McCLIM project with a disclaimer, that it is a virus or as being infected by something, it is rude and belittles work of many people
20:59:53
phoe_
but it is a viral license, as https://www.gnu.org/philosophy/vaccination.en.html itself states
22:09:01
hrehf
I'm trying to implement read, as elegantly as possible. So far my only axiom/invariant/hard-coded rule is that everything that is not matched is returned as a symbol when (actually before) the next match is returned. This allows to implement everything else as a reader macro, however it does NOT easily cover rules like "whitespace before numbers"
22:19:27
pjb
hrehf: this channel is concerned by Common Lisp only. The specification of Common Lisp contains ONLY ONE algorithm. This is the reader algorithm.