Csound Csound-dev Csound-tekno Search About

[Cs-dev] plugins

Date2010-07-22 06:41
Frommatt ingalls
Subject[Cs-dev] plugins
im looking at:
http://www.csounds.com/manual/html/csound5extending.html

under the "Adding a Plugin Unit Generator" section it says you have to change the SConstruct file and re-build Csound.

but i don't see any mention that alternatively you could not do that 
and instead just pass this commandline flag:
--opcode-lib=mypluginopcode.dylib



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 09:21
FromAndres Cabrera
SubjectRe: [Cs-dev] plugins
Hi Matt,

I read that page as saying that to build the plugin opcode, you can do
it by modifying SConstruct and rebuilding Csound. I think it doesn't
imply that you need to rebuild Csound for it to allow your plugin to
work, it says that plugins are loaded dynamically. But this makes me
wonder, is there a better way currently to build plugin opcodes?

I've added some clarification text at the start explaining that plugin
opcodes are looked for in OPCODEDIR and that you can force loading of
plugin opcodes using the flag you mention.

I've now also added the flag to the command line flags list. I didn't
know it existed!

Cheers,
Andrés

On Thu, Jul 22, 2010 at 6:41 AM, matt ingalls  wrote:
>
> im looking at:
> http://www.csounds.com/manual/html/csound5extending.html
>
> under the "Adding a Plugin Unit Generator" section it says you have to change the SConstruct file and re-build Csound.
>
> but i don't see any mention that alternatively you could not do that
> and instead just pass this commandline flag:
> --opcode-lib=mypluginopcode.dylib
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>



-- 


Andrés

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.s

Date2010-07-22 09:36
FromVictor Lazzarini
SubjectRe: [Cs-dev] plugins
No, you don't need SConstruct, just the headers. A single gcc command  
can build an opcode. Using SConstruct might just a convenience (or not).
In the case of OSX you don't even need the sources, as the headers are  
in the framework.

On 22 Jul 2010, at 06:41, matt ingalls wrote:
> im looking at:
> http://www.csounds.com/manual/html/csound5extending.html
>
> under the "Adding a Plugin Unit Generator" section it says you have  
> to change the SConstruct file and re-build Csound.

This is unrelated: one thing is building the opcode, the other is  
loading it. You can load it by dropping it into the OPCODEDIR  or use  
the command-line option you just mentioned.

> but i don't see any mention that alternatively you could not do that
> and instead just pass this commandline flag:
> --opcode-lib=mypluginopcode.dylib
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 12:29
Fromandy fillebrown
SubjectRe: [Cs-dev] plugins
Hi Andres,

Is it possible that using the --opcode-lib flag the 3 "bad" plugins on
Windows that cause issues with QuteCsound could be worked around
without requiring the user to remove them manually?  The OPCODEDIR
would need to be searched to make a list of all available plugins,
then all the opcodes found (other than the 3 bad ones) could be loaded
using the --opcode-lib flag.  Csound would then have to ignore the
OPCODEDIR so it would only use the plugins passed in with the
--opcode-lib flag.

What do you think?  Is it worth a shot or is it too clumsy?  It would
make a large command-line, that's for sure.  Maybe too large.  I don't
know.

It may be easier to figure out what is wrong with those 3 plugins and
fix them if possible.  I'll investigate that first and get back to
you.

Cheers,
~ andy.f



On Thu, Jul 22, 2010 at 4:21 AM, Andres Cabrera  wrote:
>
> I've now also added the flag to the command line flags list. I didn't
> know it existed!
>
> Cheers,
> Andrés
>
> On Thu, Jul 22, 2010 at 6:41 AM, matt ingalls  wrote:
>>
>> im looking at:
>> http://www.csounds.com/manual/html/csound5extending.html
>>
>> under the "Adding a Plugin Unit Generator" section it says you have to change the SConstruct file and re-build Csound.
>>
>> but i don't see any mention that alternatively you could not do that
>> and instead just pass this commandline flag:
>> --opcode-lib=mypluginopcode.dylib

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 12:54
FromVictor Lazzarini
SubjectRe: [Cs-dev] plugins
On OSX (floats):

gcc -O3 -dynamiclib -o plugin.dylib  plugin.c  -I/Library/Frameworks/ 
CsoundLib.framework/Headers

On OSX (doubles):

gcc -O3 -dynamiclib -o plugin.dylib  plugin.c  -DUSE_DOUBLE  -I/ 
Library/Frameworks/CsoundLib64.framework/Headers


On Linux

gcc -O3 -shared -o plugin.so  plugin.c    -I

On Windows

gcc -O3 -shared -o plugin.dll  plugin.c    -I

[you'll also need sndfile.h, the libsndfile header in a standard  
location]

Victor

On 22 Jul 2010, at 09:21, Andres Cabrera wrote:
>  But this makes me
> wonder, is there a better way currently to build plugin opcodes?


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 18:04
Frommatt ingalls
SubjectRe: [Cs-dev] plugins
thanks andrés- 

victor's post explains things more thouroughly..
but
the real problem is the manual "adding a plugin..." section really makes it look like 
the only option is to:
1-3) compile your plugin
4) change sconstruct
5) recompile csound

which i think instead should be:
1-3) compile your plugin
4) install plugin, which can be one of these:
  a) put anywhere and pass --opcode-lib=path-to-my-plugin-opcode.dylib commandline flag
  b) place in OPCODEDIR
  
and i guess you could have a 
   c) change sconstruct and recompile csound -- but i dont think this is advisable unless you plan to add your opcode to canonical sources, otherwise you will have to do some merging everytime you update from cvs.

-m@

On Jul 22, 2010, at 1:21 AM, Andres Cabrera wrote:

> Hi Matt,
> 
> I read that page as saying that to build the plugin opcode, you can do
> it by modifying SConstruct and rebuilding Csound. I think it doesn't
> imply that you need to rebuild Csound for it to allow your plugin to
> work, it says that plugins are loaded dynamically. But this makes me
> wonder, is there a better way currently to build plugin opcodes?
> 
> I've added some clarification text at the start explaining that plugin
> opcodes are looked for in OPCODEDIR and that you can force loading of
> plugin opcodes using the flag you mention.
> 
> I've now also added the flag to the command line flags list. I didn't
> know it existed!
> 
> Cheers,
> Andrés
> 
> On Thu, Jul 22, 2010 at 6:41 AM, matt ingalls  wrote:
>> 
>> im looking at:
>> http://www.csounds.com/manual/html/csound5extending.html
>> 
>> under the "Adding a Plugin Unit Generator" section it says you have to change the SConstruct file and re-build Csound.
>> 
>> but i don't see any mention that alternatively you could not do that
>> and instead just pass this commandline flag:
>> --opcode-lib=mypluginopcode.dylib
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
> 
> 
> 
> -- 
> 
> 
> Andrés
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 18:11
FromJacob Joaquin
SubjectRe: [Cs-dev] plugins
On Thu, Jul 22, 2010 at 10:04 AM, matt ingalls  wrote:
> the real problem is the manual "adding a plugin..." section really makes it look like
> the only option is to:
> 1-3) compile your plugin
> 4) change sconstruct
> 5) recompile csound

That's precisely how I read it, and is the reason why I've put off
writing plugins for Csound for so long. Know that I know this isn't
the case, I'll be writing some plugins in the near future.

Best,
Jake
-- 
The Csound Blog - http://csound.noisepages.com/
Slipmat - http://slipmat.noisepages.com/

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 19:43
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Cs-dev] plugins
AttachmentsNone  None  None  None  

Date2010-07-22 21:37
FromMichael Gogins
SubjectRe: [Cs-dev] plugins
I will supplement the manual to show the use of a single compiler
command line. This question has come up several times.

Regards,
Mike

On Thu, Jul 22, 2010 at 2:43 PM,   wrote:
> The whole point of plugins is... plug-in: not having to recompile or even
> have the Csound sources. In fact you only need the headers, not even linking
> to CsoundLib is needed.
>
> The SConstruct thing is misleading. It is supposed to be a convenience to
> use it, but given that it's only about one short gcc command-line, it's
> hardly worth it. Note also that Steven has produced an SDK for plugins,
> which could be used alternatively.
>
> Victor
>
> ----- Original Message -----
> From: Jacob Joaquin 
> Date: Thursday, July 22, 2010 6:12 pm
> Subject: Re: [Cs-dev] plugins
> To: Developer discussions 
>
>> On Thu, Jul 22, 2010 at 10:04 AM, matt ingalls
>>  wrote:
>> > the real problem is the manual "adding a plugin..." section
>> really makes it look like
>> > the only option is to:
>> > 1-3) compile your plugin
>> > 4) change sconstruct
>> > 5) recompile csound
>>
>> That's precisely how I read it, and is the reason why I've put off
>> writing plugins for Csound for so long. Know that I know this isn't
>> the case, I'll be writing some plugins in the near future.
>>
>> Best,
>> Jake
>> --
>> The Csound Blog - http://csound.noisepages.com/
>> Slipmat - http://slipmat.noisepages.com/
>>
>> -----------------------------------------------------------------
>> -------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> National University of Ireland, Maynooth
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 21:40
Frommatt ingalls
SubjectRe: [Cs-dev] plugins
ok here's an actual question about opcode plugins
( ive been away from this too long )

isn't  there was way to register a "destructor" function?

i see that the Auxch has its own garbage cleanup, which i am using.
but i need to make some system calls to cleanup 

thanks,
m

On Jul 22, 2010, at 11:43 AM, Victor.Lazzarini@nuim.ie wrote:

> The whole point of plugins is... plug-in: not having to recompile or even have the Csound sources. In fact you only need the headers, not even linking to CsoundLib is needed.
> 
> The SConstruct thing is misleading. It is supposed to be a convenience to use it, but given that it's only about one short gcc command-line, it's hardly worth it. Note also that Steven has produced an SDK for plugins, which could be used alternatively.
> 
> Victor
> 
> ----- Original Message -----
> From: Jacob Joaquin 
> Date: Thursday, July 22, 2010 6:12 pm
> Subject: Re: [Cs-dev] plugins
> To: Developer discussions 
> 
> > On Thu, Jul 22, 2010 at 10:04 AM, matt ingalls 
> >  wrote:
> > > the real problem is the manual "adding a plugin..." section 
> > really makes it look like
> > > the only option is to:
> > > 1-3) compile your plugin
> > > 4) change sconstruct
> > > 5) recompile csound
> > 
> > That's precisely how I read it, and is the reason why I've put off
> > writing plugins for Csound for so long. Know that I know this isn't
> > the case, I'll be writing some plugins in the near future.
> > 
> > Best,
> > Jake
> > -- 
> > The Csound Blog - http://csound.noisepages.com/
> > Slipmat - http://slipmat.noisepages.com/
> > 
> > -----------------------------------------------------------------
> > -------------
> > This SF.net email is sponsored by Sprint
> > What will you do first with EVO, the first 4G phone?
> > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> National University of Ireland, Maynooth
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 22:15
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Cs-dev] plugins
AttachmentsNone  

Date2010-07-22 22:23
Frommatt ingalls
SubjectRe: [Cs-dev] plugins
thanks!

On Jul 22, 2010, at 2:15 PM, Victor.Lazzarini@nuim.ie wrote:

> yes, you can register a destructor callback, like this:
> 
> csound->RegisterDeinitCallback(csound, opcode_data, deinit_callback);
> 
> 
> with the callback taking the usual opcode function form:
> 
> int deinit_callback(CSOUND *csound, void *p);
> 
> 
> Victor
> ----- Original Message -----
> From: matt ingalls 
> Date: Thursday, July 22, 2010 9:40 pm
> Subject: Re: [Cs-dev] plugins
> To: Developer discussions 
> 
>> ok here's an actual question about opcode plugins
>> ( ive been away from this too long )
>> 
>> isn't  there was way to register a "destructor" function?
>> 
>> i see that the Auxch has its own garbage cleanup, which i am using.
>> but i need to make some system calls to cleanup 
>> 
>> thanks,
>> m
>> 
>> On Jul 22, 2010, at 11:43 AM, Victor.Lazzarini@nuim.ie wrote:
>> 
>>> The whole point of plugins is... plug-in: not having to 
>> recompile or even have the Csound sources. In fact you only need 
>> the headers, not even linking to CsoundLib is needed.
>>> 
>>> The SConstruct thing is misleading. It is supposed to be a 
>> convenience to use it, but given that it's only about one short 
>> gcc command-line, it's hardly worth it. Note also that Steven 
>> has produced an SDK for plugins, which could be used alternatively.
>>> 
>>> Victor
>>> 
>>> ----- Original Message -----
>>> From: Jacob Joaquin 
>>> Date: Thursday, July 22, 2010 6:12 pm
>>> Subject: Re: [Cs-dev] plugins
>>> To: Developer discussions 
>>> 
>>>> On Thu, Jul 22, 2010 at 10:04 AM, matt ingalls 
>>>>  wrote:
>>>>> the real problem is the manual "adding a plugin..." 
>> section 
>>>> really makes it look like
>>>>> the only option is to:
>>>>> 1-3) compile your plugin
>>>>> 4) change sconstruct
>>>>> 5) recompile csound
>>>> 
>>>> That's precisely how I read it, and is the reason why I've 
>> put off
>>>> writing plugins for Csound for so long. Know that I know 
>> this isn't
>>>> the case, I'll be writing some plugins in the near future.
>>>> 
>>>> Best,
>>>> Jake
>>>> -- 
>>>> The Csound Blog - http://csound.noisepages.com/
>>>> Slipmat - http://slipmat.noisepages.com/
>>>> 
>>>> -------------------------------------------------------------
>> ----
>>>> -------------
>>>> This SF.net email is sponsored by Sprint
>>>> What will you do first with EVO, the first 4G phone?
>>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>>> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
>>> National University of Ireland, Maynooth
>>> ---------------------------------------------------------------
>> ---------------
>>> This SF.net email is sponsored by Sprint
>>> What will you do first with EVO, the first 4G phone?
>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-
>> first_______________________________________________> Csound-
>> devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> 
>> -----------------------------------------------------------------
>> -------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
> National University of Ireland, Maynooth
> 
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net