Open markus-wa opened 4 years ago
Thanks for the PR! I would like to try to get setup on Win10 to try this out. Might take me some time as I have a few higher priority things going on, but I will give this a try when I can. Thanks!
No worries @rogerallen, with the holidays and all going on I was already expecting it would take some time. For now I'm good just using a locally installed snapshot π.
I'm also not sure if this is a performance issue / bottleneck since I'm getting stuttery output / low FPS. It could be that the throughput / delay that reading from the external server is causing it - but at least it's an improvement over not working at all.
Regarding my performance issues - I've been playing around a bit more and decreasing WAVE-BUF-SIZE
from 4096 to 1024 quadrupled my FPS (at the cost of the waveform/FFT detail). That made a whole lot of sense when I noticed that we always re-read a full buffer - one buffer seems to be around 50 ms of audio with my sampling rate etc (x2 for FFT + WAVE -> 100 ms -> 10 FPS).
I think I will look into finding a good sampling rate + WAVE-BUF-SIZE
combo for my purposes π.
Another idea would be to have a 'rolling' buffer which is updated in a separate thread so we don't need to block the rendering thread to read data from SC. If you think that's a good idea I might give it a shot to implement it (if it's not too difficult for a newbie like me, anyway).
But maybe we should move that to a separate issue.
Now that you mention it, I think I recall trying an external server in the past & ran into the same performance issues. I wonder if they are something that cannot be fixed? Likely the better answer is to use shadertone with an internal server only and get your issue https://github.com/overtone/overtone/issues/447 fixed?
Unfortunately overtone/overtone#447 is not looking like an easy fix from the little investigation I did - but if it can be fixed it would be great of course. I also saw in some places that it's actually generally recommended to use the external server, even on other platforms https://github.com/overtone/overtone/issues/315#issuecomment-315530489 (I also had trouble running the internal one on Linux, actually).
As it stands now the workaround with reduced buffer size is enough for me. If we cannot fix it completely, maybe a variable buffer size would be another solution.
Do you think we should merge this as is @rogerallen ?
It should at least be an improvement over the current situation of not working at all, even if using the external server will be slow by default.
Thanks for keeping on this. I've been meaning to get a Win64 system setup to test this, but haven't made the time yet. I really wish overtone setup on either Windows or Linux was as straightforward as the Mac...I need to set aside a day to read up & get it working and while I will do this as soon as I can, it is not at the top of my priority list, sorry. This weekend it is taxes!
No worries, otherwise I might give you another ping here in a month or so π
heyya!
First off, very cool project!
So I was trying to run the example from https://github.com/rogerallen/sot on Windows 64 bit which requires an external server for overtone but it seems like this isn't supported by shadertone right now.
gives:
This change fixes that by adding and using a new function
buffer-data-read
which will usebuffer-data
orbuffer-read
depending onserver/internal-server?
.This is the first time of using Clojure, Overtone and Shadertone, so I hope I did everything right π . I was also not exactly sure on the naming of the function. LMK if you'd prefer some other name.
Happy holidays βοΈ!