[Stk] 100000 noises

gregoire davy aagregaas at yahoo.fr
Fri Jun 30 22:13:40 PDT 2017


Hi list !
I'm Stk beginner and i would like to play a large amount of sounds controlled by a physic engine (Cuda).Like a giant maracas, it shake 100000 particles producing spatialized sound's collisions.For a maximum of 500 particles it sound's ok, but over this number it produce an weird hash or saturated sound..
Here's the  code part concerning tick loop: 
  TickData *data = (TickData *) dataPointer;
             StkFloat shk, tk, vol, pan;
             register StkFloat outs[data->channels],*samples = (StkFloat *) outputBuffer;
 
             for ( unsigned int i=0; i<nBufferFrames; i++ ){
                 for( int h=0;h<data->channels;h++){
                                *samples = 0;
 
                               for( int j=0;j<data_MAX;j++){
                                            shk = (StkFloat) cpu_shkData->shakes[j];
 
                                      if ( shk <= MIN_ENERGY ){
                                             tk = 0.0;
                                      }else{
                                              tk = data->noises[j].tick() ;
 
                                           tk = data->onepoles[j].tick(tk);
                                           tk = data->filters[j].tick(tk);
                                           tk *=   shk;
                                                   shk *= SYS_DECAY;
                                         data->shakes[j] =  shk;

                                               vol = data->volumes[j];
                                               pan = data->pans[j];
                                           if( pan < 0.0f && h==0) {
                                                  vol *= -data->pans[j];         
                                           } else if( pan >= 0.0f && h==1){
                                                  vol *= data->pans[j];
                                           }
                                            tk *= vol;
                                          }
                                             outs[h] = tk;
                                    *samples += outs[h];
                                 }
                                   *samples /= data_MAX;
                                     samples++;
I use a slider to set dynamicly the frequencies range, dispatched on each particles; but there's no harmonic rules. So i probably need a rule to equalize none harmonic's frequencies ?
Thank'sgreg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/stk/attachments/20170701/974481ad/attachment.html>


More information about the Stk mailing list