Csound Csound-dev Csound-tekno Search About

faustcompile foreign local header

Date2015-06-21 07:13
Fromebmtranceboy
Subjectfaustcompile foreign local header
Hi Victor, Hi List,

Suppose I have a C header file /home/joel/cnst.h with the following content:

float getValue (){
	return 0.8;
}

and a CsInstruments section like this:


sr= 44100
ksmps=1
nchnls=1
0dbfs=1

giInst faustcompile{{
   magicValue = ffunction(float getValue(), "####","%%%%");
   process = magicValue;

}},"-vec -lv 1"

instr 1
    iF1, asig faustaudio  giInst
    ksig       downsamp  asig
                 printk        0.5,ksig
endin



What should I put here ("####") (and possibly there ("%%%%")) in order to
compile ?
I've tried "cnst.h", "/home/joel/cnst.h", "./cnst.h" without success. Is it
meant to be relative to where the faust script is compiled ?





--
View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319.html
Sent from the Csound - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-21 09:39
FromVictor Lazzarini
SubjectRe: faustcompile foreign local header
That’s a good question, I don’t know. Does it work with the faust command line compiler?
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 21 Jun 2015, at 07:13, ebmtranceboy  wrote:
> 
> Hi Victor, Hi List,
> 
> Suppose I have a C header file /home/joel/cnst.h with the following content:
> 
> float getValue (){
> 	return 0.8;
> }
> 
> and a CsInstruments section like this:
> 
> 
> sr= 44100
> ksmps=1
> nchnls=1
> 0dbfs=1
> 
> giInst faustcompile{{
>   magicValue = ffunction(float getValue(), "####","%%%%");
>   process = magicValue;
> 
> }},"-vec -lv 1"
> 
> instr 1
>    iF1, asig faustaudio  giInst
>    ksig       downsamp  asig
>                 printk        0.5,ksig
> endin
> 
> 
> 
> What should I put here ("####") (and possibly there ("%%%%")) in order to
> compile ?
> I've tried "cnst.h", "/home/joel/cnst.h", "./cnst.h" without success. Is it
> meant to be relative to where the faust script is compiled ?
> 
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-21 10:39
Fromebmtranceboy
SubjectRe: faustcompile foreign local header
Yes, "cst.h" and the rest work with faust command run from the current
directory. 
I've just tried "../../../home/joel/cnst.h" which is the relative path from
/usr/local/bin/faust without luck either :(



--
View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319p5742321.html
Sent from the Csound - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-21 11:00
FromVictor Lazzarini
SubjectRe: faustcompile foreign local header
Maybe it needs to be in the same directory as the plugin opcode library? I never tried this.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 21 Jun 2015, at 10:39, ebmtranceboy  wrote:
> 
> Yes, "cst.h" and the rest work with faust command run from the current
> directory. 
> I've just tried "../../../home/joel/cnst.h" which is the relative path from
> /usr/local/bin/faust without luck either :(
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319p5742321.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-22 01:58
FromOliver Larkin
SubjectRe: faustcompile foreign local header
AttachmentsNone  None  
If the csound Faust opcode is using faust2 libfaust I'm not sure if foreign functions are supported. at least that is the case with the max msp faustgen~ object.

On Sunday, June 21, 2015, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Maybe it needs to be in the same directory as the plugin opcode library? I never tried this.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 21 Jun 2015, at 10:39, ebmtranceboy <ebmtranceboy@gmail.com> wrote:
>
> Yes, "cst.h" and the rest work with faust command run from the current
> directory.
> I've just tried "../../../home/joel/cnst.h" which is the relative path from
> /usr/local/bin/faust without luck either :(
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319p5742321.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-22 07:55
FromVictor Lazzarini
SubjectRe: faustcompile foreign local header
AttachmentsNone  None  
Yes, it uses faust2, so that is the answer.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 22 Jun 2015, at 01:58, Oliver Larkin <olilarkin@googlemail.com> wrote:

If the csound Faust opcode is using faust2 libfaust I'm not sure if foreign functions are supported. at least that is the case with the max msp faustgen~ object.

On Sunday, June 21, 2015, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Maybe it needs to be in the same directory as the plugin opcode library? I never tried this.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 21 Jun 2015, at 10:39, ebmtranceboy <ebmtranceboy@gmail.com> wrote:
>
> Yes, "cst.h" and the rest work with faust command run from the current
> directory.
> I've just tried "../../../home/joel/cnst.h" which is the relative path from
> /usr/local/bin/faust without luck either :(
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319p5742321.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-22 08:42
Fromebmtranceboy
SubjectRe: faustcompile foreign local header
This code works though (cbrt is the cubic root):




-odac -d



sr= 44100
ksmps=1
nchnls=1
0dbfs=1

giInst faustcompile{{
magicFct =  ffunction(float cbrtf|cbrt|cbrtl (float), ,"");
process = 27:magicFct;

}},"-vec -lv 1"

instr 1
iF1, asig faustaudio giInst
ksig downsamp asig
printk 0.5,ksig
endin




i1 0 2





SECTION 1:
new alloc for instr 1:
SHA KEY GENERATED : 6B357BA4E57585F3E8CADCE1A49B40E62E29E47B
---------------------------
List of file dependencies :
---------------------------
faustop
---------------------------

 i   1 time     0.00002:     3.00000
 i   1 time     0.50000:     3.00000
 i   1 time     1.00000:     3.00000
 i   1 time     1.50000:     3.00000
 i   1 time     2.00000:     3.00000
B  0.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.		   overall amps:  0.00000
	   overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 2.122s, CPU: 0.150s




--
View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319p5742340.html
Sent from the Csound - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-22 09:42
FromVictor Lazzarini
SubjectRe: faustcompile foreign local header
Interesting. Maybe only standard C library headers (that LLVM would have known about?). It might be worth asking these
questions at the faust list.

========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 22 Jun 2015, at 08:42, ebmtranceboy  wrote:
> 
> This code works though (cbrt is the cubic root):
> 
> 
> 
> 
> -odac -d
> 
> 
> 
> sr= 44100
> ksmps=1
> nchnls=1
> 0dbfs=1
> 
> giInst faustcompile{{
> magicFct =  ffunction(float cbrtf|cbrt|cbrtl (float), ,"");
> process = 27:magicFct;
> 
> }},"-vec -lv 1"
> 
> instr 1
> iF1, asig faustaudio giInst
> ksig downsamp asig
> printk 0.5,ksig
> endin
> 
> 
> 
> 
> i1 0 2
> 
> 
> 
> 
> 
> SECTION 1:
> new alloc for instr 1:
> SHA KEY GENERATED : 6B357BA4E57585F3E8CADCE1A49B40E62E29E47B
> ---------------------------
> List of file dependencies :
> ---------------------------
> faustop
> ---------------------------
> 
> i   1 time     0.00002:     3.00000
> i   1 time     0.50000:     3.00000
> i   1 time     1.00000:     3.00000
> i   1 time     1.50000:     3.00000
> i   1 time     2.00000:     3.00000
> B  0.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000
> Score finished in csoundPerform().
> inactive allocs returned to freespace
> end of score.		   overall amps:  0.00000
> 	   overall samples out of range:        0
> 0 errors in performance
> Elapsed time at end of performance: real: 2.122s, CPU: 0.150s
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319p5742340.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors 
> network devices and physical & virtual servers, alerts via email & sms 
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-06-22 15:06
Fromebmtranceboy
SubjectRe: faustcompile foreign local header
Indeed, Stéphane Letz confirms the limitation:

"This is a common limitation of all DSP that uses external functions
(typically written in C/C++ ). The current LLVM backend can simply not use
them because it does not contain the complete needed C/C++ compiler chain."

But the situation may change in a next future:

"We have an experimental "libclang" based backend that does the following
compilation chain : Faust DSP ==> C backend ==> libclang  ==> LLVM IR ==>
JIT ==> executable code, that can handle this kind of use case, and that
will be activated as soon as we find a reliable way to compile "libclang" on
the different platforms."

Thanks



--
View this message in context: http://csound.1045644.n5.nabble.com/faustcompile-foreign-local-header-tp5742319p5742342.html
Sent from the Csound - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here