Heavy distortion/clipping in Windows
Hello! This might be a long post, so I apologize if it results a bit boring to read. First of all, I want to thank every single person behind ChucK: creators, mantainers and users, the work you guys are doing is invaluable! You all have my respect and admiration. I have posted a couple of answers in this list, since I was part of the Coursera introduction course. Because of (mostry work-related) some things that took most of the little time I had, I (sadly :() left ChucK behind. A couple weeks ago, however, I managed to get the ChucK book and 'regenerate' my interest in the language. I'm facing an odd problem during my journey. Following the examples provided in the book (and also writing my own pieces), sometimes the output sound gets heavily disorted as if the sound levels go far beyond the maximum and there's an extreme clipping sound. So I put a gain behind and set it's level lower of if there's an nRev, I set the mix down, everything resulting in a very quiet sound, in a strong contrast of what I would expect the sound to be. I'm attaching a sample of the distortion produced by playing the Listing 8.9 (Jazz Band) from the book [1]. The code running is unmodified. Set your headphones/speakers low since this can be very uncomfortable. The weirdest part of all this, is that this distortion only occurs when the code is running 'live'. If I use the 'Export' function in miniAudicle, the resulting sound is crystal-clear. I've also used a simple snippet to record the output to a file manually and the same good-sounding result occurs. I tried using another sound interface (as far as I know, the HDMI counts as another audio interface), and an external interface embedded into my Beringher UMA25S MIDI controller with the same results every time. I'm at x64 W7 with a Realtek HD embedded soundcard (it's a mid 2013 laptop). I'm not using any sound-boosting software (I found one that came with my laptop, disabled it and the same result shows). I'm using miniAudicle 1.3.3 (didn't tried the command line version since I guess the results will be the same) with pretty much the default settings: default input/output devices, 44.1KHz sample rate and 128 bytes buffer size (higher latencies doesn't make any difference). Since I don't know how to properly diagnose/solve this problem, I hope some of you can give me some insight to get over this and keep ChucKing :) PS: It seems my email got lost somewhere in time, due to the attachment so I'm replacing it to a direct download link: [1] https://www.dropbox.com/s/spa3r6os1hgrb0i/distortion.mp3?dl=0 -- -Moisés
Hey, Moisés! I'm facing an odd problem during my journey. Following the examples
provided in the book (and also writing my own pieces), sometimes the output sound gets heavily disorted as if the sound levels go far beyond the maximum and there's an extreme clipping sound.
I listened to your recording and I agree that sounds like clipping, yes. That's very strange as we would expect those examples tot not do that (I didn't follow that course myself but assume it's been carefully made). In general clipping is not -in itself- a cause for worry. When we are creating new sounds or working on a piece it is to be expected that we sometimes accidentally clip. We adjust the code and move on. I assume that something about your setup must be different from the setup the author of that example used. That might be comforting to you; I can't see how any of this could indicate that you did something "wrong"... but it is also slightly discomforting because it is so strange.
The weirdest part of all this, is that this distortion only occurs when the code is running 'live'. If I use the 'Export' function in miniAudicle, the resulting sound is crystal-clear. I've also used a simple snippet to record the output to a file manually and the same good-sounding result occurs. I tried using another sound interface (as far as I know, the HDMI counts as another audio interface), and an external interface embedded into my Beringher UMA25S MIDI controller with the same results every time.
Thanks for testing that. I wonder whether the "export" function uses some sort of automatic volume scaling. That would prevent the clipping, but then I'd expect that in those caases the normal (non-clipping) sounds would be softer.
Since I don't know how to properly diagnose/solve this problem, I hope some of you can give me some insight to get over this and keep ChucKing :)
It is indeed odd and might be a bit hard to diagnose. Could you send me the exact .ck file you used to generate the mp3 file you provided? I'd like to run it and see what happens. Yours, Kas.
Hello Kassen, thanks for your help!
The scripts I used are included into the last miniAudicle (and maybe ChucK
itself, I didn't checked) examples folder. You can grab a copy from the
ChucK (mirror?) Github repo [1]. I guess I'll be testing the same scripts
into another Machine/OS to see what happens also.
[1]
https://github.com/ccrma/chuck/blob/master/src/examples/book/digital-artists...
2015-02-17 7:12 GMT-05:00 Kassen
Hey, Moisés!
I'm facing an odd problem during my journey. Following the examples
provided in the book (and also writing my own pieces), sometimes the output sound gets heavily disorted as if the sound levels go far beyond the maximum and there's an extreme clipping sound.
I listened to your recording and I agree that sounds like clipping, yes. That's very strange as we would expect those examples tot not do that (I didn't follow that course myself but assume it's been carefully made).
In general clipping is not -in itself- a cause for worry. When we are creating new sounds or working on a piece it is to be expected that we sometimes accidentally clip. We adjust the code and move on. I assume that something about your setup must be different from the setup the author of that example used. That might be comforting to you; I can't see how any of this could indicate that you did something "wrong"... but it is also slightly discomforting because it is so strange.
The weirdest part of all this, is that this distortion only occurs when the code is running 'live'. If I use the 'Export' function in miniAudicle, the resulting sound is crystal-clear. I've also used a simple snippet to record the output to a file manually and the same good-sounding result occurs. I tried using another sound interface (as far as I know, the HDMI counts as another audio interface), and an external interface embedded into my Beringher UMA25S MIDI controller with the same results every time.
Thanks for testing that. I wonder whether the "export" function uses some sort of automatic volume scaling. That would prevent the clipping, but then I'd expect that in those caases the normal (non-clipping) sounds would be softer.
Since I don't know how to properly diagnose/solve this problem, I hope some of you can give me some insight to get over this and keep ChucKing :)
It is indeed odd and might be a bit hard to diagnose. Could you send me the exact .ck file you used to generate the mp3 file you provided? I'd like to run it and see what happens.
Yours, Kas.
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-- -Moisés
participants (2)
-
Kassen
-
Moisés Gabriel Cachay Tello