Fork me on GitHub

anyone have experience using Clojure to control MIDI instruments? (or know of libraries that support this?)

Alex Miller (Clojure team)03:07:51

Didn’t Rich do a talk about this? The Harmonikit talk?

👍 4

I totally forgot about that, now I'm gonna go rewatch it 🙂


Btw my goal is to control external devices via MIDI signals, and if I recall correctly Overtone doesn't address that


if you don’t want to pull in supercollider etc

Luke Zeitlin08:07:23

I think Overtone will do what you want. Although it's not the most stable lib I've ever used. Maybe you'll have a better experience with a java lib :


@U051H1KL1 that's very cool, i'll take a look at pink

Dan Richelson03:07:55

I'm trying to deploy a snapshot build via Maven to Clojars. Here's the relevant bits in the pom.xml: It looks like artifacts get uploaded, but it fails when dealing with the metadata:

[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ LX ---
Downloading from clojars: 
Uploading to clojars: 
Uploaded to clojars:  (617 kB at 224 kB/s)
Uploading to clojars: 
Uploaded to clojars:  (3.9 kB at 1.9 kB/s)
Downloading from clojars: 
Uploading to clojars: 
Uploaded to clojars:  (773 B at 367 B/s)
Uploading to clojars: 
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  18.641 s
[INFO] Finished at: 2019-07-18T20:55:40-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project LX: Failed to deploy metadata: Could not transfer metadata org.clojars.heronarts:LX/maven-metadata.xml from/to clojars (): Access denied to:  -> [Help 1]

Dan Richelson03:07:17 help page says to come here..

Dan Richelson04:07:03

mvn --version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T11:41:47-07:00)


maybe your credentials to clojars not properly configured in maven? or maybe a gpg key issue ?

Dan Richelson16:07:42

@U13RRNF2M credentials are correct. I have tried it with a bad password and it fails earlier with a 401.


i seem to remember there could be issues with unsigned poms

Dan Richelson16:07:04

thanks for the tip. Any ideas on more docs/help on this matter? the site is pretty sparse


let me try to find something

thanks2 4



signature seems optional

Dan Richelson16:07:57

the error message I get back is not really helpful, so it’s hard to figure out what to change


yes i had to fiddle quite a lot, mostly in the dark too

Dan Richelson16:07:03

were you using maven? I’m wondering if an example would help.. otherwise I’m not sure clojars is a good fit


i actually had to switch to using maven to make it all work

Dan Richelson16:07:51

ooh are you able to share your pom.xml/commands?


check the start-pom.xml


hum i'm on windows, and i have a cmd file that does a full release


but it isn't on the github >>


del pom.xml
copy start-pom.xml pom.xml
IF [%1]==[] GOTO NO_BUMP
clojure -A:release %1
clojure -A:garamond
call mvn deploy
git push --tags


check the deps.edn see what those clojure calls do


garamond is mostly just editing the pom


the whole process can be seen on this other repository of mine :

Dan Richelson16:07:41

I’m not a clojure person so i may get lost here

Dan Richelson16:07:14

i was looking at some docs and saw that groupID cannot equal member name.. this is the case for us so i changed groupID but still no luck


there is a clojars channel on this slack, maybe someone more knowledgeable can help you there


i just hammered at it until it worked =)

Ashwin Bhaskar09:07:41

Can anyone help me out with how the let macro is implemented? From the implementation let expands to something that calls destructure. And destructure, which is a function, in turn calls let. Where does this mutual recursion end?


1- clojure has let* built in, 2- clojure.core defines a let macro on top of let*w/o destructuring support 3- clojure.core defines destructure function using the simple `let macro 4- clojure.core redefines the let macro with destructuring support using destructure

👍 4

what am I doing wrong?




a protocol is a Var not a Class

✔️ 8

I have weird problem. I am trying to create a project with lein new droid but it does not find can it be removed from the repo?


has clojure on android revived? you might have luck asking @U06PNK4HG


lein droid is a bit weird - maybe the maven artifact it used has been "unpublished" ?


Does anyone know of a way to reload Java classes from a Clojure REPL? Or any suggestions for other Java/Clojure workflow? Should I just test thoroughly in Java before importing into Clojure? I like the idea of testing in the REPL and don't like to restart the REPL only for some Java changes... thanks!


my approach is to do only things that I absolutely need java for in java (either clean unboxed numerics or tooling mandated inheretence or features that exploit the metadata that javac puts on classes), and as much as possible fill out the rest via clojure (with java finding and calling clojure code) for repl friendlyness

👍 4

reloading java classes is hacky at best, sadly


all the logic is looked up in clojure code on the fly


(other than the top level error handler)


@noisesmith thanks... so it's easier to invert the relationship sort-of and call Clojure code from Java and then use that Java class from the REPL? Then you can write a function, use it with the Java class and edit/reload the function as you like?


exactly - more convolute than invert maybe :D


you create the java so some class knows how to find and use it (usually), then the implementation calls back into clojure again


in my example it just uses a convention (this system property must point to the name of a namespace, these defns must exist in the namespace)


but you could even pass the var in to the class constructor, then invoke it (delegation pattern sort of) - since it has the var, redefinitions will be used properly


another approach is via gen-class, but as I've said recently, I find a minimal java file more straightforward than equivalent gen-class, ymmv


@noisesmith Ok thank you so much. Just curious, do you know what is holding us back from reloading Java classes in Clojure? I found this also: ... not sure what they are doing or if it works.


it's one of the hacks I'm referring to - you can make a new class with the same name as an existing one, but you can't update the methods of one that is already instantiated


note that the class definitions are replaced, but any instances of classes you still hold are not going to change


@noisesmith Ok, I think that sounds reasonable. It's interesting. Thanks again

Alex Miller (Clojure team)20:07:49

you can actually do hot reloading via java agents, but it's a much more invasive process


@alexmiller thanks, that does look exactly like what's required

Joshua Suskalo22:07:59

Are there any good websocket client libraries that work for both Clojure and ClojureScript?


I prefered plain Aleph as it provides the channel astraction, whereas Sente replaces channels with events/handlers. For Clojurescript I did it myself with core.async & goog.websocket, but there's probably a good lib for that now

Joshua Suskalo22:07:44

My understanding of that library is that it is a Clojure server and ClojureScript client.


Sente works also on ClojureScript server. There is Macchiatto adapter: Only bad thing on this library and reason I didn't use it on latest project is that it uses some undocumented protocol and I needed to connect microcontrollers to it and since the protocol isn't documented anywhere, I just used ws library ( on the server instead and WebSocket api in the browser ( Sente seems to be nice library though, if you only want to connect devices written with Sente library together (or willing to find out how the protocol works and implement it on other devices).

Joshua Suskalo22:07:33

I'm currently using gniazdo for my library so that I can have a websocket client on the Clojure side, but I'm trying to add ClojureScript support so that users can work on node instead of the JVM.


I see... that's interesting. Not sure if such a client library exists, but maybe someone else knows better, sorry

Joshua Suskalo22:07:34

Yeah I've been looking for a year and never found one, so I guess it doesn't exist. I might be able to write one myself, but it might just be easier to have two different impl namespaces depending on the language being used.

Joshua Suskalo22:07:59

Which using this: I may be able to get a near-identical interface for using it, making the amount which needs to be in each ns very little


@suskeyhose I think that's a good idea, that's probably what I would do to start. The CLJ/CLJS reader macros make it easy to define a single function that can support both clj/cljs with different dependencies... I found this for Node: and this mega thread ... it looks like ws and gniazdo sort of share a similar API too. Regarding wscljs, will js/Websocket work in Node? I was thinking that's a browser only API?

Joshua Suskalo23:07:29

That's a good question. I haven't really dived too deeply into the cljs environment.


This is a much better guide: ... I have found they make it super easy to write some mixed CLJ and CLJS specific code in a single namespace or function. So I think all you would need to do is find the correct library/API for Node websocket client and add a reader conditional for CLJS inside your existing CLJ client function. When you run the app on Node, as long as all other code is Node compatible, it will execute the CLJS specific version of the client function.

Joshua Suskalo23:07:05

I was aware of reader conditionals, but I hadn't ever used them before

Joshua Suskalo23:07:34

but yeah, that sounds great! Thanks for the help!


If you only care about browser cljs, then just use the native APIs


If you need to support both node and web it's mor complicated