[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[fluid-dev] Multiple simultaneous synths ?

From: Peter Billam
Subject: [fluid-dev] Multiple simultaneous synths ?
Date: Wed, 22 Apr 2015 14:43 +1000


new_fluid_synth() returns a fluid_synth_t*, presumably so that
the process can run multiple simultaneous synths presumably with
different settings.  But how common are multiple synths in practice ?

  Background:  I'm maintaining a Lua module:
  in which the C returns the fluid_synth_t* back into Lua (as an integer,
  currently) so that the app can run multiple synths.  This has some
  drawbacks, including being a security weakness, also if the size of
  int is different from (especially less than!) the size of pointer.
  There are a number of solutions, but the simplest is to allow just
  one synth at once and keep its fluid_synth_t* in a static C variable.
  ( I could also keep a C-array of synths; or return the fluid_synth_t*
    as 'userdata' PiL p.194 and associated 'metatable' PiL p.197,
    which is the classy solution, but not so simple... )

Regards,  Peter Billam

http://www.pjb.com.au      address@hidden     (03) 6278 9410
"Follow the charge, not the particle."  --  Richard Feynman
 from The Theory of Positrons, Physical Review, 1949

reply via email to

[Prev in Thread] Current Thread [Next in Thread]