Hi, Ah yes, that would work, even if it requires some specialization for each dsp class. Can this be used also for ffuncs? That is, calling an instance method, for example to have multiple dsp instances read different audio samples.
Perhaps it would make sense to add some generic way of initializing values in the future, so that they are computed only in instanceInit()? Like passing an int argc, float *argv to the init() method? Using control inputs would calculate in every compute() cycle, and would not work for some stuff like maximum delay lengths, etc.. Cheers /Jonatan On Fri, Apr 18, 2014 at 5:38 PM, Orlarey Yann <[email protected]> wrote: > Hi Jonatan, > > Le 18/04/2014 16:29, Jonatan Liljedahl a écrit : > > Hmm, no it seems myConst would be used directly inside the compute() > functions, so all instances would still use the same value? > > The architecture system gives you a lot of flexibility. For example you can > modify the root class dsp (from which the class mydsp generated by the faust > compiler inherit) in order to introduce a new field, for example > fMyRandomSeed. In the dsp() constructor you can initialize fMyRandomSeed the > way you need (for example using the system random number generator so that > each instance will have a different value). The faust code can then refer to > fMyRandomSeed using fconstant(int fMyRandomSeed , <math .h >) > > Cheers > > Yann > > > > On Fri, Apr 18, 2014 at 4:25 PM, Jonatan Liljedahl <[email protected]> > wrote: > > Thanks Yann, > So you mean that I would then set this myConst variable before calling > init on each dsp instance? > > On Tue, Apr 15, 2014 at 11:20 AM, Orlarey Yann <[email protected]> wrote: > > Hi Jonatan, > > Le 14/04/2014 14:33, Jonatan Liljedahl a écrit : > > Hi! > > I'm wondering if there's any way to set initialization values per dsp > instance? > Specifically, I'd like to get different random seeds for noise > generator in each instance. Surely, I could generate N noises in each > instance and select different ones, but that would be kind of > wasteful. > > A possibility is to rewrite a noise generator using a seed declared as a > foreign constant > (syntax : fconstant ( int myConst , <math .h >) ) > > Cheers > > Yann > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > Faudiostream-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/faudiostream-users > > > -- > /Jonatan > http://kymatica.com > > > -- /Jonatan http://kymatica.com ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ Faudiostream-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/faudiostream-users
