[Stk] problems implementing polyphony...

Morgan Packard morgan at morganpackard.com
Mon Sep 17 14:41:18 PDT 2012


Hi Folks,

I downloaded the project in question and tried it on my iPad. Indeed, it
doesn't run very well at all. I modified the callback so it was filling
only 1/10 of every buffer (just so I could get the thing running and try to
profile it). Attached is a screen shot of a profile I made with
instruments. Most of the time is being spent in Hevy:Metl::tick and
FileLoop::tick. I'd think that if there was a bottleneck in one of the stl
classes, it would show up here.

I've experienced MUCH better performance on iOS by using
generator::tick(StkFrames &frames), rather than  generator::tick(), and am
slowly moving all of my code to use the buffer-at-a-time, rather than
sample-at-a-time approach. Hevy:Metl::tick  looks fairly computationally
intense to me on its own, and it's chock full of calls to member objects'
tick methods. Looks to me like it's simply too expensive, especially with
sample-at-a-time calculation.

-m-

On Mon, Sep 17, 2012 at 9:56 AM, Gary Scavone <gary at ccrma.stanford.edu>wrote:

> Hi Patrick,
>
> I think we need to find a profiler that can tell us where the bottleneck
> is with the FM classes.  The tricky issue might be that the problem doesn't
> show up using the simulator (according to Rumi), so we might then then have
> to revert to a trial-and-error approach.  The first think to try would be
> replacing the vectors of pointers with a simple array of pointers (in FM.h).
>
> Regards,
>
> --gary
>
> On 2012-09-17, at 12:35 AM, "Patrick J. Collins" <
> patrick at collinatorstudios.com> wrote:
>
> >> Try Voicer with a simple synth like Simple or Plucked and I think
> you'll see that it works
> >> great.
> >
> > Wow, you are right..  Polyphony works fine in my game as soon as I
> > switched to Simple and Plucked...
> >
> > That is a huge shame because I really, really, really wanted to feature
> > FM synthesis as the "sound" for my app.
> >
> >> Interesting.  HevyMetl is an FM class, which should not burden the CPU
> >> in any way.  There must be something happening in the FM class that
> >> doesn't work well in iOS … perhaps the use of the c++ vector class to
> >> hold the ADSR and FileLoop pointers?
> >
> > Gary, since you don't have an iPad, is there any chance you'd be up for
> > doing some pairing on my system sometime via screen sharing software
> > like TeamViewer to try to get to the bottom of this?
> >
> > Thanks.
> >
> > Patrick J. Collins
> > http://collinatorstudios.com
>
>
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>



-- 
===============
Morgan Packard
cell: (720) 891-0122
aim: mpackardatwork
twitter: @morganpackard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/pipermail/stk/attachments/20120917/421d0bef/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2012-09-17 at 5.20.09 PM.png
Type: image/png
Size: 244649 bytes
Desc: not available
Url : http://ccrma-mail.stanford.edu/pipermail/stk/attachments/20120917/421d0bef/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2012-09-17 at 5.33.05 PM.png
Type: image/png
Size: 330049 bytes
Desc: not available
Url : http://ccrma-mail.stanford.edu/pipermail/stk/attachments/20120917/421d0bef/attachment-0003.png 


More information about the Stk mailing list