overtone

2018-10-19T09:37:02.000100Z

@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.

lambdam 2018-10-19T09:39:03.000100Z

Thanks. I get it.

lambdam 2018-10-19T09:40:20.000100Z

We'll try it at my coworking space.

lambdam 2018-10-19T09:42:39.000100Z

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

2018-10-19T09:45:00.000100Z

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.

2018-10-19T09:46:51.000100Z

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

lambdam 2018-10-19T09:47:11.000100Z

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

lambdam 2018-10-19T09:47:25.000100Z

Ok. Thanks.

👍 1
2018-10-19T14:32:43.000100Z

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.

dave 2018-10-19T14:35:09.000100Z

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

dave 2018-10-19T14:35:15.000100Z

and an interpreter for said DSL

dave 2018-10-19T14:35:57.000100Z

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

dave 2018-10-19T14:36:11.000100Z

as a bonus, programs/patches could be serializable

dave 2018-10-19T14:36:29.000100Z

i'm sure there are some downsides to that approach

2018-10-19T14:37:13.000200Z

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

2018-10-19T14:37:38.000100Z

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

dave 2018-10-19T14:53:27.000100Z

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

dave 2018-10-19T14:53:34.000200Z

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

2018-10-19T14:54:53.000100Z

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

2018-10-19T14:55:24.000100Z

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

2018-10-19T14:55:57.000100Z

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

2018-10-19T15:00:31.000100Z

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

dave 2018-10-19T15:04:49.000100Z

i saw that WAA port too -- looked interesting

dave 2018-10-19T15:05:27.000100Z

good point about needing references to created objects

dave 2018-10-19T15:06:15.000100Z

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

dave 2018-10-19T15:07:00.000100Z

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

2018-10-19T15:17:40.000100Z

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.

2018-10-19T15:20:52.000100Z

For example, BufRd is documented with this signature

<http://BufRd.ar|BufRd.ar>(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