overtone

devn 2021-12-09T00:03:38.005400Z

will that solve it? that looks like something that would have been in apple’s java which i think has long been discontinued

devn 2021-12-09T00:04:16.005600Z

https://stackoverflow.com/a/56924321

devn 2021-12-09T00:04:30.006100Z

haven’t tried this, but the “Solution for Java 9 and later” seems promising

devn 2021-12-09T00:18:50.007Z

gonna see if i can run it

devn 2021-12-09T00:22:42.007400Z

@viniciustozzi FWIW, I am on Java 11 and it worked for me.

devn 2021-12-09T00:22:52.007600Z

without needing to do any of the above

Vinicius Vieira Tozzi 2022-02-28T16:15:40.618109Z

Hi thanks for the answer, the issue was that I was using azul JDK and when I switched to openJDK I don’t have that issue anymore. I do have another issue now, when I try to initialize with

(use 'overtone.live)
I get the following error:
SEVERE: Unable to load native libs c and scsynth. Please try an external server with (use 'overtone.core)

Vinicius Vieira Tozzi 2022-02-28T16:15:59.801699Z

I also installed Supercollider via homebrew, so I am not sure why doesnt load the native libs.

Vinicius Vieira Tozzi 2022-02-28T16:16:06.921379Z

Any idea on what could it be? Thanks!

plexus 2022-03-03T09:48:53.566399Z

it's trying to start an embedded supercollider server, not sure what's going wrong with that exactly but it's something that can easily cause issues. The alternative is to start supercollider outside of overtone, and then manually connect to it.

Vinicius Vieira Tozzi 2022-03-09T20:20:53.918479Z

Hi Thanks for the response, I tried running the external server but still I had no success:

--> Booting external SuperCollider server...
--> Connecting to external SuperCollider server: 127.0.0.1:16511
Execution error at overtone.sc.machinery.server.connection/external-connection-runner (connection.clj:167).
Error: unable to connect to externally booted server after 50 attempts.
Make sure that you have Server.local.options.maxLogins set to greater than 1 in startup file (startup.scd).
Or if you're on Windows, make sure that the Windows defender isn't blocking the scsynth.exe

Vinicius Vieira Tozzi 2022-03-09T20:21:33.890699Z

But maybe something is wrong with my Supercollider settings, if I try to Boot Server from Supercollider it gives me the following error:

ERROR: Input sample rate is 16000, but output is 44100. Mismatched sample rates are not supported. To disable input, set the number of input channels to 0.
could not initialize audio.
Server 'localhost' exited with exit code 0.

Vinicius Vieira Tozzi 2022-03-09T20:29:52.112599Z

Ah that’s interesting, it’s somehow related to my bluetooth headphones, if I disable it then Supercollider works just fine, and also overtone works fine

Vinicius Vieira Tozzi 2022-03-09T20:30:03.473219Z

I wonder why, but hey it works! I am really happy, thanks everyone for all the help!

plexus 2022-03-10T06:59:47.151859Z

Hmmm from that error message my guess would be that your BT headphones show up as an audio device with an input channel (your mic) of 16kHz sample rate, but an output sample rate of 44.1kHz (which has been the norm ever since CD), and SC doesn't know how to deal with that. That would also mean your BT mic can't handle frequencies above 8Khz, which sounds entirely plausible

Gerome 2021-12-09T06:05:58.008600Z

Instead of using an older Java Version I'd also recommend using an open source one.

Gerome 2021-12-09T20:45:37.009300Z

I connected my headphones and started overtone but I get this error. How do I set the number of input channels to 0?

Gerome 2021-12-09T20:53:47.009600Z

Ah! I found an older post that has a solution. https://github.com/overtone/overtone/issues/394

Gerome 2021-12-09T21:53:28.011200Z

If I (:use overtone.live)` in calva clj-kondo complains all over the place because of unresolved variables. Did anyone else have this issue?

Vinicius Vieira Tozzi 2022-03-10T18:02:54.101349Z

ah that makes sense. But if I do like that, then it doesnt show as an error anymore, but it shows as a warning : “Unresolved var: ov/boot-external-server [unresolved var]“. That’s the code at the moment:

(ns insane-noises.core
  (:require [overtone.core :as o]))

(o/boot-external-server)

Vinicius Vieira Tozzi 2022-03-10T18:03:13.679499Z

It works anyway, I am just curious about the warning the message

pavlosmelissinos 2022-03-10T18:08:37.032149Z

what IDE/linter are you using?

pavlosmelissinos 2022-03-10T18:12:12.226489Z

the namespace is o in the code but ov in the warning, are you sure you don't have a typo somewhere? seems like the linter can't find that function In any case, this isn't related to overtone, You might have better luck at the channel of your editor/linter

Vinicius Vieira Tozzi 2022-03-10T21:23:22.104599Z

sorry, I typed wrong, it’s actually using just “o” everywhere and it runs just fine

👍 1
Vinicius Vieira Tozzi 2022-03-10T21:23:33.122359Z

I am using Emacs + CIDER + clj-kondo

Vinicius Vieira Tozzi 2022-03-10T21:23:59.592119Z

yeah, it seems overtone is running everything fine, probably some configuration I need to check, anyway thanks for the help!

pavlosmelissinos 2022-03-10T22:31:38.909369Z

That's my setup too but I haven't seen that warning before; maybe you have an old version of #clj-kondo or something? Feel free to ask over there or at #cider, you'll get more/better answers

👍 1
Gerome 2021-12-10T08:14:25.011600Z

That solved it, thanks! I was just following the overtone docs but I guess they're from a time when linting wasn't as common.

👍 2
pavlosmelissinos 2021-12-09T21:58:43.011300Z

Use :require instead of :use (along with :refer, if you have to) :use pollutes the namespace you're using it in, so it's not good practice anyway (+ it confuses linters, as you've already found out)

Vinicius Vieira Tozzi 2022-03-09T21:44:24.061249Z

Hi @gerome.bochmann can you please give me an example on how you did this? for me using require is still causing that the linter shows everything as wrong

Vinicius Vieira Tozzi 2022-03-09T21:44:45.341869Z

I am using :refer :all I am not sure if this is right

Vinicius Vieira Tozzi 2022-03-09T21:44:48.731869Z

(ns insane-noises.core
  (:require [overtone.core :refer :all]))

pavlosmelissinos 2022-03-09T23:36:23.906839Z

:refer :all is practically the same as :use Just do:

(ns insane-noises.core
  (:require [overtone.core :as oc]))
and then write oc/xxx instead of just xxx to call overtone functions Take a look at the docs for a bit more information: https://clojure.org/guides/learn/namespaces#_declaring_namespaces