[Stk] Pops and Crackling on Windows

Perry Cook prc at cs.princeton.edu
Wed Sep 11 10:21:58 PDT 2013


Hey Ted,

The TX81 was my inspiration for the FM class to begin with!

Note that all of the strange waveforms are in the rawwaves directory.
And the algorithms I coded up are some of those of the TX81Z.
I think I even did a little work on making things align for setting
some of the modulation, envelope, etc parameters (but not sure 
anymore, since it's been 20 years!! since I first coded those up).  

Please do let us know when you get done with your emulator.  
I'd love to use it.

PRC


On Sep 11, 2013, at 7:20 AM, Ted Stockwell wrote:

> That's a great explanation, thanks for sharing.
> 
> From: Tom Gideon <tegideon at gmail.com>
> To: Ted Stockwell <emorning at yahoo.com> 
> Cc: "stk at ccrma.stanford.edu" <stk at ccrma.stanford.edu>; Perry Cook <prc at cs.princeton.edu> 
> Sent: Wednesday, September 11, 2013 4:19 AM
> Subject: Re: [Stk] Pops and Crackling on Windows
> 
> Hi Ted,
>     My approach to finding the problem was the former. (I am an amateur programmer, my background is in mathematics.) I am currently developing a generalization of the STK FM instruments, a modest attempt at building a TX81Z emulator. In this process I observed the same pops and crackling. When looking at the waveforms in Audacity I saw, immediately, that the problem was with a note envelope's onset and release. I then debugged the code using 'oStream_ << "print something here";' placed at key points. That brought me to the Voicer class. I then noticed that an instantiation of a Voicer object required an initial value for decay, it seemed a reasonable guess to augment that value to a value noted elsewhere when I had used grep to find "Voicer(".
>     I would like to share my work on the TX81Z emulator as soon as I get it working in the best way for all to use.
> Cheers
> Tom
> 
> 
> 
> 
> On Tue, Sep 10, 2013 at 9:33 PM, Ted Stockwell <emorning at yahoo.com> wrote:
> Thanks very much!
> 
> I haven't spent much time looking at the STK code since I'm currently reading Real Sound Synthesis (and this is a side project for me).
> I'm curious though how you diagnosed this issue.
> Was it just a matter of becoming more familiar with the code and making an intelligent guess as to what might make a difference?
> Or was there a specific tool you used?
> I'm guessing that a debugger is not going to be much help :-).
> 
> From: Tom Gideon <tegideon at gmail.com>
> To: Ted Stockwell <emorning at yahoo.com> 
> Cc: Perry Cook <prc at cs.princeton.edu>; "stk at ccrma.stanford.edu" <stk at ccrma.stanford.edu> 
> Sent: Tuesday, September 10, 2013 6:52 PM
> 
> Subject: Re: [Stk] Pops and Crackling on Windows
> 
> Hi
>     I'm new to this mailing list and STK. I think I have found the problem with regard to "Pops and Crackling ..." In the file "demo.cpp" there is a line that reads
> 
>   data.voicer = (Voicer *) new Voicer( 0.0 );
> 
> I changed the 0.0 to 0.2 and the pops and crackling disappered. The pops and crackling seemed to be the result of the release time not being activated and the waveform had a "discontinuity" at the end of each note, and this seemed, sometimes, to carry over to the beginning of the next note.
> I hope this helps.
> Tom Gideon
> 
> ...
> 
> 
> On Fri, Aug 30, 2013 at 10:18 PM, Ted Stockwell <emorning at yahoo.com> wrote:
> Thanks very much for the hints, I will try all of them.
> Actually, I did see a couple of messages about exceeding +/- 1.0....
> 
> From: Perry Cook <prc at CS.Princeton.EDU>
> To: Ted Stockwell <emorning at yahoo.com> 
> Cc: "stk at ccrma.stanford.edu" <stk at ccrma.Stanford.EDU> 
> Sent: Friday, August 30, 2013 5:41 PM
> Subject: Re: [Stk] Pops and Crackling on Windows
> 
> Hey Ted,
> 
> I'm doing some STK on RPi already!  It works quite well if you
> pay attention to how much computation you're asking for at
> any given time.
> 
> Since it happens the same way at the same instant, it could
> be clipping for some reason.  The CPU spiking might be 
> something inside STK checking for exceeding of +/- 1.0.
> 
> I'd try changing the gain (downward) just a bit.  This could 
> be done in a variety of places, including right in the main 
> program.  Find a nice place where the Instrument.tick() method
> is being called, and multiply that times your test gain hack.
> 
> Something like:  dac.tick(myRev.tick(0.5*myInstrument.tick())));
> where you add in that 0.5.  
> 
> Another thing to try would be to run the demo with the GUI
> and see if things click any.  Wish I could help more.  
> 
> PRC
> 
> On Aug 30, 2013, at 2:59 PM, Ted Stockwell wrote:
> 
> > Hi All,
> > 
> > I'm a programmer that is totally new to sound synthesis and STK.
> > I've built the demo project on Windows XP, I'm playing with it, and I have some questions... 
> > 
> > When I play a SKINI file in realtime I hear a lot of pops and crackling/buzzes at specific times in the sequence (demo Clarinet -or -if scores/bookert.ski).
> > The pops and crackling always happens at the same points in the sequence.
> > I've noticed that my CPU usage tops out when the crackling starts (BTW, I have 3.4 Ghz Pentium 4 CPU).
> > If I generate a .wav file instead and play the .wav file then I don't hear any crackling (demo Clarinet -if scores/bookert.ski -ow clarinet.wav) .
> > I figure the issue must be related to the realtime synthesis of the sound (but I suppose it could be the actual playing of the sound).
> > 
> > I've tried increasing RT_BUFFER_SIZE from 512 to 4096 but that made no difference.
> > Can anybody suggest a remedy?
> > My ultimate goal is too use STK on a Raspberry Pi so I'll need to understand/solve this issue in order to be comfortable moving forward.
> > 
> > Thanks in advance,
> > 
> > -ted stockwell
> > 
> > 
> > PS: I've ordered a copy of Real Sound Synthesis for Interactive Applications but I haven't received it yet, so I don't understand how any of this stuff works :-).
> > 
> > _______________________________________________
> > Stk mailing list
> > Stk at ccrma.stanford.edu
> > http://ccrma-mail.stanford.edu/mailman/listinfo/stk
> 
> 
> 
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk




More information about the Stk mailing list