This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-19
Channels
- # aleph (1)
- # announcements (3)
- # aws (1)
- # beginners (95)
- # calva (15)
- # clojars (4)
- # clojure (84)
- # clojure-android (3)
- # clojure-austin (1)
- # clojure-chicago (1)
- # clojure-dev (66)
- # clojure-europe (3)
- # clojure-italy (15)
- # clojure-nl (13)
- # clojure-uk (33)
- # clojuredesign-podcast (9)
- # clojurescript (6)
- # cursive (68)
- # data-science (4)
- # datavis (1)
- # datomic (13)
- # emacs (4)
- # fulcro (2)
- # jobs (4)
- # jobs-discuss (89)
- # luminus (23)
- # nrepl (6)
- # off-topic (2)
- # onyx (2)
- # pathom (4)
- # pedestal (11)
- # re-frame (9)
- # reagent (8)
- # reitit (5)
- # shadow-cljs (131)
- # spacemacs (13)
- # sql (8)
- # vim (8)
- # xtdb (7)
- # yada (4)
anyone have experience using Clojure to control MIDI instruments? (or know of libraries that support this?)
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
nvm, this might work https://github.com/overtone/overtone/wiki/MIDI
There’s also https://github.com/kunstmusik/pink/blob/master/src/main/pink/io/midi.clj
if you don’t want to pull in supercollider etc
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 : https://docs.oracle.com/javase/tutorial/sound/overview-MIDI.html
@U051H1KL1 that's very cool, i'll take a look at pink
I'm trying to deploy a snapshot build via Maven to Clojars. Here's the relevant bits in the pom.xml: https://github.com/drichelson/LX/blob/ee25e27f98c6e7783d4167620e41aa5fefbcbc2c/LX/pom.xml#L102 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] BUILD FAILURE
[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]
http://clojars.org help page says to come here..
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 ?
@U13RRNF2M credentials are correct. I have tried it with a bad password and it fails earlier with a 401.
thanks for the tip. Any ideas on more docs/help on this matter? the http://clojars.org site is pretty sparse
not much to to by but there'(s this https://github.com/clojars/clojars-web/wiki/Pushing
the error message I get back is not really helpful, so it’s hard to figure out what to change
were you using maven? I’m wondering if an example would help.. otherwise I’m not sure clojars is a good fit
ooh are you able to share your pom.xml/commands?
del pom.xml
copy start-pom.xml pom.xml
IF [%1]==[] GOTO NO_BUMP
clojure -A:release %1
:NO_BUMP
clojure -A:garamond
call mvn deploy
git push --tags
the whole process can be seen on this other repository of mine : https://github.com/cark/cark.behavior-tree
I’m not a clojure person so i may get lost here
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
thanks
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
https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L31-L35
I have weird problem. I am trying to create a project with lein new droid
but it does not find com.android.support:multidex:aar:1.0.0
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" ?
you could try setting this dep by hand https://mvnrepository.com/artifact/com.android.support/multidex/1.0.2
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
reloading java classes is hacky at best, sadly
here's a small java class I made to control a clojure process with jsvc https://github.com/noisesmith/clj-jsvc-adapter/blob/master/src/java/org/noisesmith/Cljsvc.java
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: https://github.com/ztellman/virgil ... 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
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
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
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: https://github.com/ptaoussanis/sente/blob/master/src/taoensso/sente/server_adapters/macchiato.cljs 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 (https://www.npmjs.com/package/ws) on the server instead and WebSocket api in the browser (https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API). 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).
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
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.
Which using this: https://github.com/nilenso/wscljs 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: https://www.npmjs.com/package/ws and this mega thread https://stackoverflow.com/questions/16392260/which-websocket-library-to-use-with-node-js ... 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?
That's a good question. I haven't really dived too deeply into the cljs environment.
Are you aware of these reader conditionals? https://clojure.org/reference/reader#_reader_conditionals
This is a much better guide: https://clojure.org/guides/reader_conditionals ... 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.
I was aware of reader conditionals, but I hadn't ever used them before
but yeah, that sounds great! Thanks for the help!