Can not connect to an external SuperCollider audio server from Overtone - clojure

I am a Clojure beginner, and I am trying to play with Overtone. But I am having trouble starting Overtone and connecting it with an external SuperCollider server.
I am following the tutorial from Overtone documentation: Connecting scsynth. Since I am on Windows 10 64bit I can not use the Internal SuperCollider server. So I installed SuperCollider and made sure the audio server is running at 127.0.0.1:57110.
Now when I try to load Overtone environment on lein relp and I get nil in return.
user=>(use 'overtone.core)
nil
So if the Overtone environment is loaded sucessfully, now we are supposed to connect with an external SuperCollider server. We can do this in two ways. Starting the external server from within Overtone, or connect to an existing running server.
To start an external server I tried the following command, but I get unresolved symbol error.
user=> (boot-external-server)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: boot-external-server in this context, compiling:(C:\Users\<user>\AppData\Local\Temp\form-init401744747046363104.clj:1:1)
So I tried to connect to an existing server running on port 57110 but I get similar unresolved symbol error,
user=> (connect-external-server 57110)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: connect-external-server in this context, compiling:(C:\Users\<user>\AppData\Local\Temp\form-init401744747046363104.clj:1:1)
user=> (connect-external-server)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: connect-external-server in this context, compiling:(C:\Users\<user>\AppData\Local\Temp\form-init401744747046363104.clj:1:1)
Am I supposed to get nil when I run (use 'overtone.core)? My assumption is, all these symbols are unresolved because Overtone namespace is not loaded yet.
How do I solve this problem to start Overtone on my system?

Instead of (use 'overtone.core) I used (ns user (:require [overtone.core :refer :all])) and that solved the issue. Now I can call (boot-external-server) and (connect-external-server) without unresolved symbol error.

Related

trying to make a setup for using google's speech to text api using cpp

Hi from github I have cloned this module https://github.com/davehorton/drachtio-freeswitch-modules/tree/master/modules/mod_google_transcribe
Module created with ansible script is loading but I don't want to use that ansible script
So, by checking some documents installed grpc ,protobuf and googleapis packages.
I am able to make the module but it is not loading in the fs_console
021-01-08 12:55:44.823176 [CRIT] switch_loadable_module.c:1785 Error Loading module /usr/local/freeswitch/mod/mod_google_transcribe.so**/usr/local/freeswitch/mod/mod_google_transcribe.so: undefined symbol: _ZTVN6google5cloud6speech2v16Speech4StubE**
getting this error
can anyone please help me

Launch cljs nREPL connected to lein project template

I have created a ClojureScript project using:
lein new re-frame my-project
I've then opened it in IntelliJ using Cursive. In the terminal after typing lein dev, it prompts me with the message:
shadow-cljs - HTTP server available at http://localhost:8280
shadow-cljs - server version: 2.8.52 running at http://localhost:9630
shadow-cljs - nREPL server started on port 8777
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (203 files, 1 compiled, 0 warnings, 3.65s)
I can open the server using the link which directs me to a REPL, but not the nREPL connected to the browser. Following their documentation I type shadow-cljs clj-repl in to another terminal, which opens a REPL but not one that is connected to my browser or project. If I type (js/alert "hi m8") in to the REPL it responds:
Syntax error compiling at (REPL:2:1).
No such namespace: js
My question is, is how do I use the nREPL it says has started and preferably how do I access it in the integrated REPL in IntelliJ?
Thanks.
Update
Have got it working as below but if anyone knows how to get it working here in Cursive / IntelliJ:
That would be super.
The nREPL connection will always start out in Clojure mode. You can switch it to use CLJS by calling (shadow.cljs.devtools.api/repl :app) and return to Clojure mode via :cljs/quit.
You should however be connecting to a "Clojure REPL" -> "Remote" and then "localhost" with port 8777. This is configured as the default in the re-frame template via shadow-cljs.edn :nrepl {:port 8777}.
The screenshot you posted looks like you connected to the random port lein created. This will also work but requires additional configuration for the nREPL middleware.
I figured it. You have to use shadow-cljs cljs-repl app in another terminal.

Shinyapp.io cannot load rgdal package

I have a shiny app that is working locally, that loads several packages, including rgdal, which is installed locally on my MacOS. When I deploy it on shinyapp.io server it seems like the server cannot find the rgdal installation. I have seen that other people have similar problems with rgdal but I cannot seem to find a way to fix it.
I have tried to reinstall the rgdal package from the terminal but also this does not work.
The error I get when I deploy on the server is:
Error in value[3L] : package or namespace load failed for ‘rgdal’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/opt/R/3.5.0/lib/R/library/rgdal/libs/rgdal.so': /opt/R/3.5.0/lib/R/library/rgdal/libs/rgdal.so: undefined symbol: _ZN10OGRFeature11SetGeometryEP11OGRGeometry Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted
How can I install the rgdal package in /opt/R/3.5.0/lib/R/library/rgdal/libs/? My understanding is that this should solve the issue as the server is looking in that folder for the installation.
From within Shinyapps.io , under the app's advanced settings, I unchecked the "Package Cache" and then redeployed. Then it worked. This solution was suggested by the rstudio support team.

How to compile namespace in remote REPL

I have a problem compiling .clj files which reside in a project where I run the nREPL server process:
I've created a new project using lein new xxx.
In the project folder I started up an nREPL by lein repl.
In another terminal window I started a client lein repl :connect localhost:12345/repl.
I created a simple namespace file and saved it inside the project in the appropriate location:
(ns remote.one)
(def foo 42)
Now on the client terminal I called this function
(compile 'remote.one)
I've got the below exception:
CompilerException java.lang.ClassNotFoundException: remote.one, compiling:(C:\Users\xxx\AppData\Local\Temp\form-init2429492334116477513.clj:1:1)
Now I would have expected the compile call to be executed in the server not on the client. Can it be done at all?
Thanks
I just tried it and it worked for me. What happened the first time I tried it was that I missed a step: setting the current directory as the project's. I see that this step is also missing from your description, maybe that's the reason it doesn't work in your case.
Create a new project using lein new remote.
Change the current directory cd remote.
Start the nREPL server from the project folder with lein repl :headless (which I realize now is also different from your description).
Open a new console and start the nREPL client lein repl :connect localhost:port/repl in ~/..
Create the file for the ns in ~/remote/src/remote/one.clj.
From the client evaluate (compile 'remote.one).
(Using Leiningen 2.3.4 on Java 1.7.0 Java HotSpot(TM) 64-Bit Server VM and Clojure 1.5.1).

:repl-options dont reflect in the ritz nrepl client in emacs

I am using the :repl-options key in my project.clj to load default options when I start repl using lein2 repl.
I have added ritz plugins to my project.clj and ~/.lein, and once I start the repl using -
a) lein2 repl
and then connect to it using
b) M-x nrepl RET Host: localhost RET Port: 5332 (Port number on which nrepl started in the first step)
The ns that I load using :repl-options are avalaible in the repl that starts using lein2 repl, however they are not avalaible in the client started using M-x nrepl.
Any ideas on how do I get them in the client started by M-x nrepl too ?
Frankly I think that it is best to ask Leiningen related questions on its mailing list. I had an issue with Leiningen recently and Phil Hagelberg, developer of the tool, responded almost instantly.
You could also ask about https://stackoverflow.com/questions/12493003/unmateched-delimiter-exception-but-still-able-to-run-code. I have similar issues with Lein2 (only in Cygwin), so maybe it will result in a bug report.