[chuck-users] Tracking down clicks and pops..
enigma.0za at gmail.com
Sat Jun 11 18:30:19 EDT 2011
On Jun 11, 2011, at 5:57 PM, Kassen wrote:
> I guess my first question is in general, what would cause a clicking or popping noise first of all...
> Either discontinuities in the wave-form that you synthesise or CPU load issues. Both are potentially fairly involved subjects.
That makes sense, both discontinuities and that they're fairly involved subjects...
> Some other notes of concern, each note handler thread (of which there are 20) sporks it's own threads to modulate some parameters, so being 20 note handlers + three threads per note handler + a few other threads (such as the midi watcher), I've got almost 90 threads running at one time, could that be part of the issue?
> That sounds like suspect #1 right now, yes. Check your cpu load; on Windows you can use "TaskManager" (found under the ctrl+alt+del menu unless they changed it), on Linux and OSX you can run "top" at your terminal. There are likely other ways too, but I use those.
Top (on my mac) doesn't show an excessive load, the highest loading process is MIDIServer (which I'm assuming is OSX, not ChucK?), and even while playing several notes on and off with pedal and without, the idle% never went below 50% (as in, less than 50% cpu used)... I don't think it's a CPU issue unless the ChucK VM is having troubles on its own apart from the rest of the system
> If that's it we'll have to talk about the structure of the program; that might get complicated but it might be fun too, Then again; in the case of discontinuities (a fancy words for your wave making a "vertical jump") it might get tricky too.
> See how far you can get on your own. If you get stuck you may need to send the most simple version of your code that still has these clicks to the list and we can have a look. Could be that it's something simple, but it could also be that you are asking too much; there is always a limit to the cpu power, it might be at two sines, it might be at two modelled full orchestras but there is some limit where it will click....
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
Hmm thanks for the input and feedback. I don't think it's CPU issues, but I'm not ruling it out. I did manage to make it happen reliably now, or at least I figured out why it was *sometimes* ... I'm not to the point of paring down the program to something appropriate for a mailing list, that's going to be a huge job.
Anyway, some more info (and more questions)
Info: it only happens when a handler which had previously sounded a low frequency is then called to play a significantly higher frequency. If you've got a midi controller, the easiest way to do this is play 20 (the number of handlers I have) notes on the C below middle C, and then jump up to the C above middle C... Until every handler has played at least one note in the new range, it'll pop. It also started when I added the modulation functionality I discussed in a previous thread, "Modulation of parameters 'by hand'"... none of my previous patches before this addition do this, so I want to blame some fault in this section of the program...
Questions: How does chuck handle concurrancy with time and threads? If any one thread advances time, it advances time for the whole VM right? My loop for the modulators advances time by 1::ms or else the program just spins forever - the rest of the program isn't ever reached. Is there a better way to do this? The loop is just a while(true) loop with a 1::ms => now at the end (after setting the parameters) ... but this thread doesn't actually own the osc's, it's a child of that thread. Maybe I'm getting into a bugger here?
Anyway, thanks again!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the chuck-users