[Stk] Plucked instrument issue on iOS

Gary Scavone gary at ccrma.Stanford.EDU
Sat Mar 9 07:55:05 PST 2013


Hi Hector,

My main interest is whether this is a C++ code problem inherent to the STK class or an implementation problem with iOS.  Perhaps you can run some tests with your code using C++ in OS-X to see if you have the same problem.

When you say the "delay" parameter is always the same, that would imply no change in sounding frequency. 

--gary

On 2013-03-08, at 10:50 AM, Hector Urtubia <urtubia at mrbook.org> wrote:

> Hi Gary,
> Thanks for the response. I'm changing the frequency like this:
> 
> plucked->noteOn(freq, 1.0);
> 
> Which internally on Plucked.cpp does:
> 
> this->setFrequency( frequency );
> this->pluck( amplitude );
> 
> 
> I understand that the length of the delay line controls the frequency, so I've printed out the parameter to  "delayLine_.setDelay(delay);" in the setFrequency method of Plucked.cpp and the parameter is always the same, even when the instrument is out of tune.
> 
> Another interesting bit of information is that this issue would not happen on an iPhone 4, but it is prominent on an iPhone 5. Any clues?
> 
> Thanks,
> 
> 
> Hector
> 
> 
> On Fri, Mar 8, 2013 at 6:16 AM, Gary Scavone <gary at ccrma.stanford.edu> wrote:
> Hi Hector,
> 
> If the note is out of tune, then there must be a problem with the delay line length.  That is, it should not matter whether, or in what way, the delay line is filled with noise (though if the delay line is not filled with noise, it may not produce any sound because it won't have much energy left inside).  This code is fairly old and we haven't noticed any problems over the years, so perhaps you are using it (updating the control parameters) in some way that was not expected.  How are you changing the plucked note number or frequency?
> 
> Regards,
> 
> --gary
> 
> On 2013-03-06, at 4:38 PM, Hector Urtubia <urtubia at mrbook.org> wrote:
> 
> > Hi All,
> > I'm having issues with the Plucked instrument on iOS where sometimes notes get completely out of tune.
> > I took a look at the Sitar instrument, which uses a similar algorithm and doesn't show the same issue and I isolated the problem to the following lines on the "pluck" method of Plucked:
> >
> >   for ( unsigned long i=0; i<delayLine_.getDelay(); i++ )
> >     // Fill delay with noise additively with current contents.
> >     delayLine_.tick( 0.6 * delayLine_.lastOut() + pickFilter_.tick( noise_.tick() ) );
> >
> >
> > If I don't fill the delay buffer after changing the frequency, then the notes stay in tune, but then I have to modify the tick method where the timbre of the instrument is not the same at all.
> > Any ideas?
> > Regards,
> >
> > Hector
> > _______________________________________________
> > 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