[Stk] problem with shakers through voicer

listas at jesusgollonet.com listas at jesusgollonet.com
Mon Sep 27 08:13:33 PDT 2010


Hi!
I'm using the stk with openframewors for the iphone (as others have said,
it is a pleasure to work on audio this way, thanks!).

However, I'm having a problem and I'm not sure if I'm understanding things
right. I'm using the shakers class in response to accelerometer changes.
To have several instances of them for a richer sound, I'm adding them to a
voicer, like this

shaker1 = new Shakers();
shaker2 = new Shakers();
shaker3 = new Shakers();

voicer  = new Voicer ();

voicer -> addInstrument(shaker1, 0);
voicer -> addInstrument(shaker2, 0);
voicer -> addInstrument(shaker3, 0);

and then, when I want a sound I just do

voicer->noteOn(JGBUtils::mtof(note), 128);

my understanding being that voicer will take care of mixing the sounds of
the different shakers if they overlap, and if it has no more voices
available it will steal the oldest one.

But what happens here is that, for shakers with a long sound, I can hear
the complete sound just the first time it is played, and then each
additional time I only hear a short percussive sound, like just the
beginning of the sound.

In other words, in the given example, I hear the shakers correctly the
first 3 times I call noteOn, and then only the beginning (i'm guessing)

Hope this makes sense.
Does anyone see what I'm doing/understanding wrong?

Thanks a lot,
jesús.




More information about the Stk mailing list