Fork me on GitHub
#overtone
<
2018-10-19
>
hlolli09:10:02

@dam You can require overtone.core with alias (:as o). It's not hygenic because it's more tought of as a runtime live-coding library for musicians than it is as library for IT systems. That said, you can use both hygenic and non-hygenic as you wish. But bear in mind that every public overtone function would live behind the alias, irrelevant of the namespace. There are so many macros at play, it would be hard to remember the dozens of namespaces of all the different functions.

lambdam09:10:03

Thanks. I get it.

lambdam09:10:20

We'll try it at my coworking space.

lambdam09:10:39

I'll use it with Clojure newbies so I wanted to be clear about Clojure good practices in general vs the Overtone approach.

hlolli09:10:00

This untidyness is mostly from a namespace hacking tool. Tell them that for every namespace hack they do for a library for other people, a dolphin dies in the sea.

hlolli09:10:51

If you have any problems setting up overtone, on the 0.10.3 release or the master branch, please let me know and report 🙂

lambdam09:10:11

😂Thanks. I'll quote that also in the README!

lambdam09:10:25

Ok. Thanks.

👍 4
bfay14:10:43

I've been trying to build something a bit like overtone in clojurescript, so I can run it on node and not worry about startup time (it's really long when running on a Raspberry Pi) I don't want to kill any dolphins, but sometimes I wish clojurescript had more namespace-hacking potential. You can't even refer :all, so if I want to define my ugens in different namespaces, I would have to do a ton of different requires. Instead I'm just putting them all in one namespace, and aliasing it to u so that I type things like (u/out (u/sin-osc 330)), it's kind of annoying to have to do that.

dave14:10:09

one way you could get around that is to make a data-based DSL

dave14:10:15

and an interpreter for said DSL

dave14:10:57

e.g. something like [:out [:sin-osc 330]]

dave14:10:11

as a bonus, programs/patches could be serializable

dave14:10:29

i'm sure there are some downsides to that approach

bfay14:10:13

Oh, hadn't considered that, not a bad idea

hlolli14:10:38

With lumo, I could hack the namespace, but thats not possible in non-self hosted cljs. Maybe another way.

dave14:10:27

@bfay have you thought about how you will generate the audio in the node environment?

dave14:10:34

i'm curious what the state of the art is there

bfay14:10:53

I guess one downside of the data-based approach is that it would be hard to use one ugen in multiple parts of the graph. For example I'm thinking:

(let [lfo (u/mul (u/sin-osc:kr 0.2) 1000)
       osc1 (u/sin-osc:ar lfo)
       osc2 (u/sin-osc:ar (u/mul 100 lfo))])
Here both oscillators are reusing the same lfo to control frequency. If I wanted to do this with just data, I would need to be able to mark the id of that lfo somehow, so that I don't wind up duplicating it

bfay14:10:24

Oh, I'm actually just using supercollider (the nodejs instance isn't creating any audio, just sending OSC messages to scsynth)

bfay14:10:57

It's extremely hacky and undocumented and doesn't have a lot of features yet, but my work so far is here: https://github.com/brianfay/synchrotron

bfay15:10:31

I'm also really curious what other options exist for audio from node. I remember seeing a web audio api port for node at some point, but I'm not sure if that's being actively maintained

dave15:10:49

i saw that WAA port too -- looked interesting

dave15:10:27

good point about needing references to created objects

dave15:10:15

i've been working on some data-based DSLs recently, and one way to get around that is to have a data way to represent a reference to a named thing, something like [:ref "lfo"] which would be resolved by the interpreter

dave15:10:00

and you would also name the thing when you create it, e.g. [:fixture "lfo" [:mul ...]]

bfay15:10:40

I could see that working, and it would probably make the interpreter code much easier to write and reason about. I've been having a lot of issues trying to add ugens, because SuperCollider has a lot of hidden logic on the client side - some ugens have quirky behavior where arguments only mean something to the client, and are discarded before they make it to the server.

bfay15:10:52

For example, BufRd is documented with this signature

(numChannels, bufnum: 0, phase: 0, loop: 1, interpolation: 2)
In most ugens, that would mean each argument shows up somewhere in the binary synthdef file. But in BufRd, numChannels isn't a real input; it's used to determine the number of outputs of the ugen, and then discarded before the synthdef is generated. The only way to figure this out is reading through a ton of supercollider source code; it's pretty amazing to me that the Overtone authors had the patience to do this so well