Re: [yoshimi-user] memory allocation in RT context?

  • From: Will Godfrey <willgodfrey@xxxxxxxxxxxxxxx>
  • To: yoshimi-user@xxxxxxxxxxxxxxxxxxxxx
  • Date: Sun, 22 Jun 2014 20:21:35 +0100

On Sun, 22 Jun 2014 18:37:33 +0100
Dan Mills <dan.mills.00@xxxxxxxxx> wrote:

Hi all,
I was just poking around in src/Misc/Part.cpp to figure out how the
whole thing hung together and much to my surprise saw things like :

partnote[pos].kititem[0].adnote =
new ADnote(kit[0].adpars, ctl, notebasefreq, vel,
portamento, note, false ); // not silent

(Line 520ish).

This is IMHO all sorts of broken from a realtime software perspective.

Would it not be better to have a statically allocated pool of notes
corresponding to whatever degree of polyphony we have configured and
then just play pointer games here rather then calling new which is
quite capable of blocking?

Regards, Dan.

I agree it's far from ideal, but the whole thing is rather confusing. If the
part is running in kit mode there can be 1 to 16 'lines' in the kit.

So, for a single note you would have to allow for 16x ADsynth +16x SUBsynth, and
the real killer 16xPADsynth, which creates a perfectly looping sample. These
can all be genuinely quite different, and not even run the same frequency.

I don't know how much difference polyphony makes to the amount of memory
required for (presumably) copies of the data / data pointers, but it can also be
set from between 1 and 100.

Whether anyone has a processor that could actually work such a monster patch is
another matter! :)

--
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.


Other related posts: