Le 22 oct. 2013 à 16:02, LFSaw <lf...@lfsaw.de> a écrit : > Hello, > > thanks for answering :) > > On 22.10.2013, at 15:55, Stéphane Letz <l...@grame.fr> wrote: > >> >> Le 17 oct. 2013 à 15:31, LFSaw <lf...@lfsaw.de> 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 >> > > >
Nos sure to understand : if you compile your JPverbRaw.dsp in C++ with Faust, you will se the following generated code, where internal Faust DSP delay lines are part of the generated class (as fields..) class mydsp : public dsp { private: float fRec1[2]; float fRec0[2]; float fRec3[2]; float fRec118[2]; float fVec40[16384]; float fRec2[2]; float fRec4[2]; float fRec117[2]; float fVec39[16384]; float fRec6[2]; ……. So do you mean you would like to be able to use SuperCollider RT memory allocator or to "handle" (in some meaner…) those internal Faust C++ generated object delay lines ? 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 Faudiostream-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-users