Csound Csound-dev Csound-tekno Search About

[Csnd] Calling a Faust compiled opcode

Date2018-11-28 17:58
FromMaston
Subject[Csnd] Calling a Faust compiled opcode
Dear Sirs, I am trying to load a statically compiled lib generated by the online Faust compiler (https://faust.grame.fr/onlinecompiler/) into CSound. I wrote this very simple Faust program: inputGain = hslider("Gain",0.5,0.0,1,0.001); process = _*inputGain,_*inputGain; I compiled it for the "Csound OSX" architecture, obtaining the file "mygain.dylib" (I am using a Mac). I tried to load the library: --opcode-lib=mygain.dylib and then I tried to call the imported opcode: instr 1 kGain chnget "gain" ain1 inch 1 ain2 inch 2 a1, a2 mygain ain1, ain2, kGain outs a1, a2 endin But it is not recognized. By the way, I have no clue of the correct order of the input/output parameters and even if "mygain" is the right opcode name (but I do not know where I can find this information). The following code using the faustgen opcode is working: instr 1 kGain chnget "gain" ain1 inch 1 idsp,a1 faustgen {{ gain = hslider("vol",1,0,1,0.01); process = (_ * gain); }}, ain1 faustctl idsp, "vol", kGain out a1 endin But I would prefer to use a statically compiled lib. Thank you and best regards Massimiliano

Sent from the Csound - General mailing list archive at Nabble.com.
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2018-11-28 19:04
FromVictor Lazzarini
SubjectRe: [Csnd] Calling a Faust compiled opcode
Try using

--opcode-lib:./mygain.dylib

The ./ is important

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

On 28 Nov 2018, at 18:08, Maston <tonelli.conservatorio@GMAIL.COM> wrote:

Dear Sirs, I am trying to load a statically compiled lib generated by the online Faust compiler (https://faust.grame.fr/onlinecompiler/) into CSound. I wrote this very simple Faust program: inputGain = hslider("Gain",0.5,0.0,1,0.001); process = _*inputGain,_*inputGain; I compiled it for the "Csound OSX" architecture, obtaining the file "mygain.dylib" (I am using a Mac). I tried to load the library: --opcode-lib=mygain.dylib and then I tried to call the imported opcode: instr 1 kGain chnget "gain" ain1 inch 1 ain2 inch 2 a1, a2 mygain ain1, ain2, kGain outs a1, a2 endin But it is not recognized. By the way, I have no clue of the correct order of the input/output parameters and even if "mygain" is the right opcode name (but I do not know where I can find this information). The following code using the faustgen opcode is working: instr 1 kGain chnget "gain" ain1 inch 1 idsp,a1 faustgen {{ gain = hslider("vol",1,0,1,0.01); process = (_ * gain); }}, ain1 faustctl idsp, "vol", kGain out a1 endin But I would prefer to use a statically compiled lib. Thank you and best regards Massimiliano

Sent from the Csound - General mailing list archive at Nabble.com.
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2018-11-29 08:32
FromMaston
SubjectRe: [Csnd] Calling a Faust compiled opcode
Thank you for the reply. I tried your suggestion but I am still having  
error: syntax error, unexpected T_IDENT, expecting T_OPCODE or T_FUNCTION or
',' or '['  (token "mygain") from file....
I don't know if it is relevant, but I am using cabbage.

Best regards
Massimiliano



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 08:58
FromVictor Lazzarini
SubjectRe: [Csnd] Calling a Faust compiled opcode
You need to see if the opcode lib was loaded. There should be a message in the console to that effect.

Make sure the lib is in the same directory as the CSD.

Rory Walsh might also have some tips regarding cabbage.

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

> On 29 Nov 2018, at 08:33, Maston  wrote:
> 
> Thank you for the reply. I tried your suggestion but I am still having  
> error: syntax error, unexpected T_IDENT, expecting T_OPCODE or T_FUNCTION or
> ',' or '['  (token "mygain") from file....
> I don't know if it is relevant, but I am using cabbage.
> 
> Best regards
> Massimiliano
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 09:04
FromMaston
SubjectRe: [Csnd] Calling a Faust compiled opcode
Thanks! No message that the lib was loaded appears. Yes the dylib is in the
same folder. Il try to ask Mr. Walsh too.

Best regards
Massimiliano



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 09:51
FromVictor Lazzarini
SubjectRe: [Csnd] Calling a Faust compiled opcode
You should have something like this:

--Csound version 6.13 beta (double samples) Nov 27 2018
[commit: 0294f9d4fd930c219f6d5c67c128f8fb25229d07]
libsndfile-1.0.28
UnifiedCSD:  optest.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
Creating score
Loading command-line libraries:
  ./optest.dylib

If you want to post the dylib here, I can try it in my computer.
========================
Prof. 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 29 Nov 2018, at 09:04, Maston  wrote:
> 
> Thanks! No message that the lib was loaded appears. Yes the dylib is in the
> same folder. Il try to ask Mr. Walsh too.
> 
> Best regards
> Massimiliano
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 10:04
FromMaston
SubjectRe: [Csnd] Calling a Faust compiled opcode
Here are the files! Thank you so much.

testcall.zip   



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 10:21
FromVictor Lazzarini
SubjectRe: [Csnd] Calling a Faust compiled opcode
It looks like the faust online compiler is not producing a good dylib on OSX. I compiled your code here and it seems
to work. But I had to modify faust2csound for it work.

I have informed the Faust devs.
========================
Prof. 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 29 Nov 2018, at 10:04, Maston  wrote:
> 
> Here are the files! Thank you so much.
> 
> testcall.zip   
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 10:26
FromMaston
SubjectRe: [Csnd] Calling a Faust compiled opcode
Great! Thank you so much for your feedback.

All the best
Massimiliano



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 11:31
FromVictor Lazzarini
SubjectRe: [Csnd] Calling a Faust compiled opcode
The Faust people have updated the online compiler, please try it again and let us know.
========================
Prof. 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 29 Nov 2018, at 10:26, Maston  wrote:
> 
> Great! Thank you so much for your feedback.
> 
> All the best
> Massimiliano
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 12:13
FromMaston
SubjectRe: [Csnd] Calling a Faust compiled opcode
Thank you so much!

Unfortunately, it is still not working. I'll try to use the lib outside
cabbage to see if it will work...
faustcall.zip
  



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-11-29 12:20
FromVictor Lazzarini
SubjectRe: [Csnd] Calling a Faust compiled opcode
I checked this and it still not fixed. I told them.
========================
Prof. 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 29 Nov 2018, at 12:13, Maston  wrote:
> 
> Thank you so much!
> 
> Unfortunately, it is still not working. I'll try to use the lib outside
> cabbage to see if it will work...
> faustcall.zip
>   
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here