Hello,

thanks for answering :)

On 22.10.2013, at 15:55, Stéphane Letz <[email protected]> wrote:

> 
> Le 17 oct. 2013 à 15:31, LFSaw <[email protected]> a écrit :
> 
>> Hello folks,
>> 
>> 
>> when working with bigger chunks of memory in SuperCollider, it is advised to 
>> use buffers (non-rt allocated memory) in favour to r/t allocated arrays.
> 
> How are those r/t allocated arrays allocated ? What kind of API?

Described e.g. here:
        http://supercolliderbook.net/danstowellch25.pdf
        25.5.8 Accessing a Buffer

thing is that they are essentially float arrays of a specified length. in order 
to deal efficiently with (a bunch of) delay lines, this would mean to assume a 
pointer to a buffer with enough space handed over by scsynth, memory management 
then has to be done by hand...
This would be useful e.g. for reverb implementations such as JPverb [1] where 
lots of delay lines are instantiated.

[1] 
https://github.com/supercollider/sc3-plugins/blob/master/source/DEINDUGens/faust_src/JPverbRaw.dsp

> 
>> Is it possible to tell Faust to generate such a thing when compiling 
>> SuperCollider UGens?
> 
> As a see in the Faust distribution SuperCollider architecture file, the Faust 
> generated object is allocated as a field of a derived Unit object, so I guess 
> it will then obey the memory allocation rules used be the defined "Faust" 
> class  when an instance of it will be allocated?


yepp, I guess so... 
However, for reasons described above, it would be better (not run into 
glitches) to provide a way to do external memory allocation.

> 
> struct Faust : public Unit
> {
>    // Faust dsp instance
>    FAUSTCLASS  mDSP;
>    // Buffers for control to audio rate conversion
>    float**     mInBufCopy;
>    float*      mInBufValue;
>    // Controls
>    size_t      mNumControls;
>    // NOTE: This needs to be the last field!
>    //
>    // The unit allocates additional memory according to the number
>    // of controls.
>    Control     mControls[0];
> 
>    int getNumAudioInputs() { return mDSP.getNumInputs(); }
> };
> 
> Stéphane
> 




------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to