overtone

Joakim Verona 2024-11-06T08:42:49.984799Z

I only just recently started playing with a midi keyboard and overtone, and it feels like I have some latency. Its subjective and I dont know how to measure it. I just use the out of the box pipewire on fedora 41. Do any of you do anything special to reduce latency in a similar scenario?

Joakim Verona 2024-11-06T08:46:27.456309Z

it feels like i get latency when playing yoshimi with its own virtual keyboard as well, subjectively around 100 ms. So i dont think the problem lies in overtone necessarily, but rather somewhere later in the audio stack

Hukka 2024-11-06T09:17:06.684439Z

I don't really play music via my computer, but I'd check setting up JACK first

Hukka 2024-11-06T09:17:20.528509Z

https://jackaudio.org/

Hukka 2024-11-06T09:19:03.694639Z

Then other options I know include running a RT (realtime) kernel, and getting better hardware (which might mean better keyboard, eliminating usb hubs, better usb controller, eliminating usb altogether by getting a PCI midi board)

Joakim Verona 2024-11-06T09:19:05.177589Z

tnx. in my case im using pipewire to realise the jack interfaces

Joakim Verona 2024-11-06T09:19:23.643879Z

i will see if i can get RT working

Hukka 2024-11-06T09:19:36.527939Z

Pipewire is compatible sure, but I don't know how well it handles latency. In pulseaudio times jack was a must

Joakim Verona 2024-11-06T09:20:20.023939Z

tnx, i will investigate your suggestions

Hukka 2024-11-06T09:24:57.671089Z

Quick googling shows various things to do with pipewire, including skipping software processing by selecting pro audio interfaces, setting ALSA latencies and clock rates, pipewire quantum settings etc. But seems like that within the last year pipewire has become good enough replacement for JACK even for realtime music

Hukka 2024-11-06T09:27:17.510449Z

Ah, and setting some kernel parameters like preempt=full and threadirqs

Joakim Verona 2024-11-06T10:45:54.516549Z

i rebooted and used a wired headest rather than bt, that shaved off a noticeable amount of latency

👍 1
Hukka 2024-11-06T10:46:19.465509Z

Heh, yeah, definitely

Joakim Verona 2024-11-06T10:48:05.327599Z

atm im using casa.squid.midi to interface jack-midi to overtone, and it works well except that the underlying alsa midi seems to be sensitive to which usb port i connect the midi kbd to, kinda weirs

Joakim Verona 2024-11-06T10:48:45.827999Z

i guess in just a brief couple of additional decades we can have a solid linux audio stack 🙂

Hukka 2024-11-06T10:49:04.621769Z

I think normal bluetooth is at least 200ms. 5.4 might bring that down to 100ms, aptX LL is maybe half that

Joakim Verona 2024-11-06T10:49:21.461519Z

ah alright, den that explains a lot

Hukka 2024-11-06T10:50:15.711649Z

It's same with HID devices. Mice, kb and gamepads with their own wireless dongle have much lower latency. Latency just wasn't on their mind when they made Bluetooth…

Joakim Verona 2024-11-06T10:50:19.663119Z

I was told these were good https://aiaiai.audio/headphones/tma-2-studio-wireless-plus but seems kinda overkill for my dabbling hobbyist needs

Hukka 2024-11-06T10:51:43.542799Z

And that requires a 3.5mm plug. Kinda weird. Hard to find mobile devices these days with that, dongles have their own latency, I assume

Hukka 2024-11-06T10:52:57.447609Z

But wired is fine! No messing with audio codecs and wireless protocols. Not likely to move around much anyway then playing an instrument

Joakim Verona 2024-11-06T10:53:14.962379Z

true

Hukka 2024-11-06T10:53:36.224709Z

Or batteries. No wireless headphone is going to last for ten years

Hukka 2024-11-06T10:55:15.084619Z

I really like how my Shure IEMs can be plugged straight from the earplug to either a wired 3.5mm cable, or to a BT pin. Best of both worlds

Joakim Verona 2024-11-06T11:00:08.690809Z

seems nice. I just have a pair of bose qc because i do a lot of audio conferencing and normally i need anc

Hukka 2024-11-06T11:00:47.153199Z

I have Jabra over ears too for ANC and talking on the go

Hukka 2024-11-06T11:01:11.336819Z

On my desk I use Sennheiser over ears with antlion modmic

Joakim Verona 2024-11-06T11:01:38.185749Z

youre fully kitted 🙂

Hukka 2024-11-06T11:02:12.900439Z

Good gear lasts a long time, so can have more

Hukka 2024-11-06T11:03:06.448019Z

Fully kitted, but no time to make music

Hukka 2024-11-06T11:04:00.316139Z

Haven't touched my violin in a year, my dualo got just a bit of fooling around last christmas without learning to play it

Hukka 2024-11-06T11:04:28.215339Z

I mean my exquis. My dualo has been unused for a longer time >_<

Joakim Verona 2024-11-06T11:05:23.596719Z

ah, hex instruments seems nice, i long thought about building an instrument like that

2024-11-06T09:46:09.554579Z

Hi all, any tips on how to fix this ?🧵

2024-11-06T09:46:29.347109Z

i'm on an M1 mac

2024-11-06T09:46:37.894319Z

i installed supercollider via brew

2024-11-06T09:47:10.230569Z

do i have to install something on supercollider to get overtone to work?

2024-11-06T09:48:17.343949Z

it happens both when i start supercollider (the app) manually and without starting it

2024-11-06T09:50:15.763119Z

I'm guessing from the error message, I have to disable device 0 somehow

2024-11-06T09:57:33.016139Z

ok got it to work by going into audio midi setup and selecting 44,100 hz https://scsynth.org/t/input-sampling-rate-does-not-match-the-output/562/4

💯 2
❤️ 2
plexus 2024-11-06T16:05:37.741229Z

There's probably a way to make supercollider run at 48k as well... I see there's a -S <hardware-sample-rate>, that might be it

👏🏽 1
Joakim Verona 2024-11-06T20:54:29.669249Z

kind of a dumb question, but how do i run the development version of overtone in my existing overtone project? id like to try out the unreleased stuff @pfeodrippe did for running sclang code in overtone

Joakim Verona 2024-11-07T18:43:08.587779Z

Im trying this, which doesnt work. What am I doing wrong? ;; // execute first, by itself ;; SynthDef.new("tutorial-PinkNoise", { |out| http://Out.ar(out, http://PinkNoise.ar(0.3)) }).add; ;; // then: ;; x = Synth.new("tutorial-PinkNoise"); ;; y = Synth.new("tutorial-PinkNoise"); ;; x.free; y.free; (http://overtone.sc.sclang/defsynth tutorial-PinkNoise "Some synth." [freq 440, amp 0.5, pan 0.0] [:vars :env] [:raw " { |out| http://Out.ar(out, http://PinkNoise.ar(0.3)) }"]) (tutorial-PinkNoise)

pfeodrippe 2024-11-07T18:50:25.085409Z

See the generated file in the .overtone folder, it will show you the generated .scd file that the SC IDE understands. You should also see an error in the console (hopefully ahahah) Will go back to the work now, but let me know, will check your message later o/

Joakim Verona 2024-11-07T19:37:02.548189Z

tnx!

Joakim Verona 2024-11-07T20:07:40.652139Z

noticed scd files are written to .overtone/sc/ maybe doc somewhere?

pfeodrippe 2024-11-07T22:10:44.367869Z

Yes, we can, wdyt of making a small PR adding it? o/ Let me know, otherwise I can do it. I can guide you if you want and we can merge it ;D

pfeodrippe 2024-11-07T22:11:54.954139Z

Let me know if you were able to see the issue, the sclang/defsynth macro already adds the brackets { }, so maybe you don’t need that?

Joakim Verona 2024-11-07T22:12:54.429049Z

I trial and errored through some iterations looking at a working generated synthdef from your examples, and how my code, using raw, so now i kind of get it

Joakim Verona 2024-11-07T22:13:26.141259Z

;; SynthDef.new("tutorial-PinkNoise", { |out| http://Out.ar(out, http://PinkNoise.ar(0.3)) }).add; ;;here, |out| doesnt work (not sure how its supposed to work) (http://overtone.sc.sclang/defsynth tutorial-PinkNoise "Some synth." [freq 440] [:raw "http://Out.ar(0, http://PinkNoise.ar(0.3))"])

Joakim Verona 2024-11-07T22:13:51.627029Z

as you say, i noticed the{} where added

Joakim Verona 2024-11-07T22:14:27.545119Z

it seems you need the freq arg, even though its never used

Joakim Verona 2024-11-07T22:15:18.140749Z

also i dont understand the sclang |out| syntax, and it doesnt seem to work in raw

Joakim Verona 2024-11-07T22:16:18.396299Z

ill try to make a PR with a slight doc change

1
pfeodrippe 2024-11-07T22:17:39.816289Z

The | | is for args of the { }, https://doc.sccode.org/Classes/SynthDef.html So maybe if you use “out” as an argument to the macro, it could work

pfeodrippe 2024-11-07T22:18:20.433819Z

(sclang/defsynth my-synth [out] …)

Joakim Verona 2024-11-07T22:19:54.024419Z

sclang syntax is really cryptic lol

😅 1
pfeodrippe 2024-11-07T23:32:42.584869Z

Thanks, Joakim, merged :D Appreciate it. Congrats on your first commit there hahahah

Joakim Verona 2024-11-08T07:25:45.098689Z

🙂

pfeodrippe 2024-11-06T20:58:02.859969Z

Not dumb, man, see https://github.com/pfeodrippe/vybe/blob/develop/deps.edn#L18. It’s using directly from git (it uses deps.edn, not leiningen). But yes, we should have GitHub actions push a new version from master automatically to clojars. Not sure if someone is working on it already

Joakim Verona 2024-11-06T20:58:54.262329Z

ah thats nice, tnx

Joakim Verona 2024-11-06T20:59:20.214749Z

i guess some kind of cicd pipeline in github to push to clojars would be nice

Joakim Verona 2024-11-06T20:59:45.538859Z

i mostly use gitlab cicd so im not too familiar with githubs cicd

pfeodrippe 2024-11-06T20:59:58.938659Z

Yes, I use GitHub actions in this vybe project, let me know if you can open an issue about it o/

Joakim Verona 2024-11-06T21:00:51.156359Z

hmm you mean just for suggesting a cicd build to clojars in the overtone project? sure i can do that

pfeodrippe 2024-11-06T21:01:33.285859Z

Yes yes, not sure if we already have an issue about it or if someone is working on it, but it’s good so we can remember ahahaha thanks, Joakim o/

Joakim Verona 2024-11-06T21:02:51.714319Z

https://github.com/overtone/overtone/issues/572

Joakim Verona 2024-11-06T21:03:28.238869Z

seems like overtone development is on fire recently 🙂

🔥 1
pfeodrippe 2024-11-06T21:04:23.086879Z

We already build in https://github.com/overtone/overtone/blob/master/.github/workflows/build.yml (it was some appreciated effort by Ambrose!), so it shouldn’t take too much to send to clojars… in theory

Joakim Verona 2024-11-06T21:05:52.922089Z

cool, its very similar to gitlab cicd

Joakim Verona 2024-11-06T22:32:16.935709Z

im attempting to use the sclang ns, as from the docs: (http://overtone.sc.sclang/defsynth my-synth "Some synth." [freq 440, amp 0.5, pan 0.0] [:vars :env] [:= :env [:http://EnvGen.ar [:Env [0 1 1 0] [0.01 0.1 0.2]] {:doneAction 2}]] [:http://Out.ar 0 [:http://Pan2.ar [:* [:http://Blip.ar :freq] :env :amp] :pan]]) Execution error (ExceptionInfo) at http://overtone.sc.sclang/-synthdef-save! (sclang.clj:303). Error when defining a synthdef, resource not found. Check the stdout, also check that your resources folder is a resource to this Java application. At last, check that SuperCollider is installed, https://supercollider.github.io/downloads

Joakim Verona 2024-11-06T22:32:25.762409Z

i get some exception

pfeodrippe 2024-11-06T22:40:14.486929Z

Can you put the full message in a https://gist.github.com/? Make sure you have supercollider installed and you have “resources” as one of your resource paths

Joakim Verona 2024-11-06T23:02:01.508299Z

hmm how do i achieve "resources" path?

pfeodrippe 2024-11-06T23:05:37.201349Z

You are using deps.edn, correct? If so, check https://github.com/overtone/overtone/blob/master/deps.edn#L1 in line 1, the paths are src and resources

pfeodrippe 2024-11-06T23:06:33.030789Z

But yeah, I can improve that to check for a file if the resource is not found, but for now, let me know if this works o/

Joakim Verona 2024-11-06T23:11:14.694559Z

this was the problem, tnx

pfeodrippe 2024-11-06T23:16:40.375079Z

Nice!!!

Joakim Verona 2024-11-06T23:20:21.264239Z

this is very cool. Is there some way of converting a random sc statement like { http://SinOsc.ar(http://SinOsc.kr([1, 3]).exprange(100, 2e3), 0, 0.2) }.play

pfeodrippe 2024-11-06T23:23:31.487559Z

You can use [:raw “…”] ahahaha the parser is very simple for now, but let me know if there is something you can’t do even with :raw

Joakim Verona 2024-11-06T23:29:25.069469Z

tnx

pfeodrippe 2024-11-06T23:33:06.264529Z

Also, I’m not sure if you can play sounds using the sclang command by default (I guess you have to use the boot flag in the transpiler fn), first, check if you can create it with just Clojure (if you just use normal operators, it should be doable… in theory), if you can’t, create an issue or, if you think it’s simple enough, keep posting messages here o/

pfeodrippe 2024-11-06T23:36:44.110539Z

I have worked on this to be able to use external plugins/sc code without having to replicate a bunch of code in Clojure (time-consuming and error-prone), e.g. https://github.com/SCLOrkHub/SCLOrkSynths or https://github.com/ambisonictoolkit/atk-sc3

Joakim Verona 2024-11-06T23:38:52.913849Z

yes its very cool, im atm not grokking it though, so i doing some trial and error

pfeodrippe 2024-11-06T23:39:15.773079Z

Got it o/ thanks for trying it :D

🙌 1