Re: [Bluemusic-users] Python instrument and global variables in orchestra
Brought to you by:
kunstmusik
From: Steven Y. <ste...@gm...> - 2009-01-19 18:59:17
|
Hi Olivier, Have you tried using the "global instrument" tab in the python instrument editor? That code should be copied to the global area when generating a CSD. So you should be able to use: gk_<INSTR_ID>_myvar init 0 and in your code, use gk_<INSTR_ID>_myvar and doing so will make sure that the variable names are unique per instrument, regardless of if you make multiple copies of that instrument. There should also be no issues with order of initialization, as that code should be generated at the top of the CSD before and instrument definitions. (If you do need to ensure that code is generated at very very top of global area, you can use a ";[pre] {" block.) Let me know if that is what you are talking about, otherwise could you post an example .blue file that illustrates the problem? Thanks! steven On Mon, Jan 19, 2009 at 11:17 AM, obaudouin <oli...@pe...> wrote: > > Hi! > > I need that a Python instrument initializes global variables in the global > orchestra. Currently, I copy by hand the "gkxxx init 0..." lines produced > with the python instrument into the global orchestra before removing them > from the instrument, and it is not very elegant! > > Thanks a lot for Blue, > > Olivier. > -- > View this message in context: http://www.nabble.com/Python-instrument-and-global-variables-in-orchestra-tp21546201p21546201.html > Sent from the Csound - Blue - User mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Bluemusic-users mailing list > Blu...@li... > https://lists.sourceforge.net/lists/listinfo/bluemusic-users > |