Csound Csound-dev Csound-tekno Search About

[Cs-dev] Build custom opcode

Date2014-02-21 12:20
FromOeyvind Brandtsegg
Subject[Cs-dev] Build custom opcode
How do I add my own opcode to the makefile now?
I used to know how to do it with the old Scons, but haven't tried it
with cmake yet.
I figure there is something I should do in cmake-gui perhaps?
Assume I have the c file in /Opcodes

-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-02-21 13:36
FromMichael Gogins
SubjectRe: [Cs-dev] Build custom opcode
AttachmentsNone  None  
There is a CMakeLists.txt in the Opcodes directory. That is where you would add it. But if it is a plugin, you don't need a build system at all, a batch file will do, or a simple SCons build system using the Csound library to link with.

Hope this helps,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Feb 21, 2014 at 7:20 AM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
How do I add my own opcode to the makefile now?
I used to know how to do it with the old Scons, but haven't tried it
with cmake yet.
I figure there is something I should do in cmake-gui perhaps?
Assume I have the c file in /Opcodes

--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2014-02-21 13:41
FromVictor Lazzarini
SubjectRe: [Cs-dev] Build custom opcode
Note that a plugin does not need to link with anything (unless it has dependencies of its own). So

gcc -shared myfile.c  -o myplug.  -I -DUSE_DOUBLE

should do the job on linux or windows-mingw

on OSX use -dynamiclib instead of -shared

Victor

On 21 Feb 2014, at 13:36, Michael Gogins  wrote:

> There is a CMakeLists.txt in the Opcodes directory. That is where you would add it. But if it is a plugin, you don't need a build system at all, a batch file will do, or a simple SCons build system using the Csound library to link with.
> 
> Hope this helps,
> Mike
> 
> 
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
> 
> 
> On Fri, Feb 21, 2014 at 7:20 AM, Oeyvind Brandtsegg  wrote:
> How do I add my own opcode to the makefile now?
> I used to know how to do it with the old Scons, but haven't tried it
> with cmake yet.
> I figure there is something I should do in cmake-gui perhaps?
> Assume I have the c file in /Opcodes
> 
> --
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://flyndresang.no/
> http://www.partikkelaudio.com/
> http://soundcloud.com/brandtsegg
> http://soundcloud.com/t-emp
> 
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-02-24 09:20
FromOeyvind Brandtsegg
SubjectRe: [Cs-dev] Build custom opcode
Excellent, thanks.
Now, can I find any guidelines as to what is different when writing
opcodes for csound6, compared to writing for csound5?
I've poked around a bit and can guess some things, but I would feel
more confident with some kind of instructions.
all best
Oeyvind

2014-02-21 14:41 GMT+01:00 Victor Lazzarini :
> Note that a plugin does not need to link with anything (unless it has dependencies of its own). So
>
> gcc -shared myfile.c  -o myplug.  -I -DUSE_DOUBLE
>
> should do the job on linux or windows-mingw
>
> on OSX use -dynamiclib instead of -shared
>
> Victor
>
> On 21 Feb 2014, at 13:36, Michael Gogins  wrote:
>
>> There is a CMakeLists.txt in the Opcodes directory. That is where you would add it. But if it is a plugin, you don't need a build system at all, a batch file will do, or a simple SCons build system using the Csound library to link with.
>>
>> Hope this helps,
>> Mike
>>
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Fri, Feb 21, 2014 at 7:20 AM, Oeyvind Brandtsegg  wrote:
>> How do I add my own opcode to the makefile now?
>> I used to know how to do it with the old Scons, but haven't tried it
>> with cmake yet.
>> I figure there is something I should do in cmake-gui perhaps?
>> Assume I have the c file in /Opcodes
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://flyndresang.no/
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://soundcloud.com/t-emp
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk_______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-02-24 10:21
Fromjpff
SubjectRe: [Cs-dev] Build custom opcode
The information was in the release notes for 6.00

An extract....

The template for arate perf-pass opcodes is:

     int perf_myopcode(CSOUND *csound, MYOPCODE *p)
     {
         uint32_t offset = p->h.insdshead->ksmps_offset;
         uint32_t early  = p->h.insdshead->ksmps_no_end;
         uint32_t nsmps = CS_KSMPS;
         ...
         if (UNLIKELY(offset)) memset(p->res, '\0', offset*sizeof(MYFLT));
         if (UNLIKELY(early))  {
           nsmps -= early;
           memset(&p->res[nsmps], '\0', early*sizeof(MYFLT));
         }
         for (n=offset; nres[n] = ....
         }
         return OK;
     }


Or do you need more?
==John ff


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-02-24 15:30
FromSteven Yi
SubjectRe: [Cs-dev] Build custom opcode
Just brainstorming, we had discussed a little bit about updating the
plugin SDK.  This made me think of a couple of things that might be
nice for the SDK:

* by default, install into the same default locations for OPCODE6DIR64
as the main build does

* have test CSD's that are pre-configured to run the plugin from the
build dir with --sample-accurate, without it, maybe other
configurations



On Mon, Feb 24, 2014 at 5:21 AM, jpff  wrote:
> The information was in the release notes for 6.00
>
> An extract....
>
> The template for arate perf-pass opcodes is:
>
>      int perf_myopcode(CSOUND *csound, MYOPCODE *p)
>      {
>          uint32_t offset = p->h.insdshead->ksmps_offset;
>          uint32_t early  = p->h.insdshead->ksmps_no_end;
>          uint32_t nsmps = CS_KSMPS;
>          ...
>          if (UNLIKELY(offset)) memset(p->res, '\0', offset*sizeof(MYFLT));
>          if (UNLIKELY(early))  {
>            nsmps -= early;
>            memset(&p->res[nsmps], '\0', early*sizeof(MYFLT));
>          }
>          for (n=offset; n              .....
>              p->res[n] = ....
>          }
>          return OK;
>      }
>
>
> Or do you need more?
> ==John ff
>
>
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net