Csound Csound-dev Csound-tekno Search About

Trouble with python opcodes + csound api

Date2016-09-05 23:56
FromBen McAllister
SubjectTrouble with python opcodes + csound api
Attachmentsex.csd  ex.py  
Hi List,

I'm having trouble calling the python opcodes from an orc which is run within a python script.  I've attached ex.py and ex.csd to illustrate. If I run 'python ex.py', I get

error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
 line 14:
>>>}} <<<

In reading the manual, I see that the pyinit docs imply this can be done


Any help appreciated. Thanks!
--
Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.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

Date2016-09-06 07:39
FromFrancois PINOT
SubjectRe: Trouble with python opcodes + csound api
Here it runs. Try to execute the csd directly from the csound command to see if there's any problem with the csd on your system...

François

2016-09-06 0:56 GMT+02:00 Ben McAllister <benmca@gmail.com>:
Hi List,

I'm having trouble calling the python opcodes from an orc which is run within a python script.  I've attached ex.py and ex.csd to illustrate. If I run 'python ex.py', I get

error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
 line 14:
>>>}} <<<

In reading the manual, I see that the pyinit docs imply this can be done


Any help appreciated. Thanks!
--
Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.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

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

Date2016-09-06 08:22
FromVictor Lazzarini
SubjectRe: Trouble with python opcodes + csound api
It runs here too. Make sure you the Python opcodes are actually loaded.
========================
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 6 Sep 2016, at 07:39, Francois PINOT  wrote:
> 
> Here it runs. Try to execute the csd directly from the csound command to see if there's any problem with the csd on your system...
> 
> François
> 
> 2016-09-06 0:56 GMT+02:00 Ben McAllister :
> Hi List,
> 
> I'm having trouble calling the python opcodes from an orc which is run within a python script.  I've attached ex.py and ex.csd to illustrate. If I run 'python ex.py', I get
> 
> error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
>  line 14:
> >>>}} <<<
> 
> In reading the manual, I see that the pyinit docs imply this can be done
> 
> http://csound.github.io/docs/manual/indexframes.html 
> 
> Any help appreciated. Thanks!
> -- 
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.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
> 
> 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

Date2016-09-14 04:40
FromBen McAllister
SubjectRe: Trouble with python opcodes + csound api
Thanks for the replies. I managed to run ex.csd without problem, but to Victor's point, I don't think the python opcodes are being loaded when run from inside a python script, but they are being loaded when running a csd.

Here's the complete output from 'python ex.py'.
Bens-MBP-2:python benmca$ python ex.py 
virtual_keyboard real time MIDI plugin for Csound
WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH
(points to rawwaves directory) to use STK opcodes.
0dBFS level = 32768.0
Csound version 6.07 (double samples) Sep  5 2016
libsndfile-1.0.21
WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libjacko.dylib' (-1)
WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libjackTransport.dylib' (-1)
WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libpy.dylib' (-1)
WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/librtjack.dylib' (-1)
UnifiedCSD:  ex.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH
(points to rawwaves directory) to use STK opcodes.
rtaudio: PortAudio module enabled ... 
using callback interface
rtmidi: PortMIDI module enabled

error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
 line 14:
>>>}} <<<
Unexpected untyped word pyruni when expecting a variable
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra
WARNING: Csound not ready for performance: csoundStart() has not been called 

end of score.   overall amps:      0.0
  overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.001s, CPU: 0.001s

Note that 'WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libpy.dylib' (-1)' - this file is present on my system, and permissions look the same as everything else in CsoundLib64.framework


Any help here is appreciated! 

On Tue, Sep 6, 2016 at 12:22 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
It runs here too. Make sure you the Python opcodes are actually loaded.
========================
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 6 Sep 2016, at 07:39, Francois PINOT <fggpinot@gmail.com> wrote:
>
> Here it runs. Try to execute the csd directly from the csound command to see if there's any problem with the csd on your system...
>
> François
>
> 2016-09-06 0:56 GMT+02:00 Ben McAllister <benmca@gmail.com>:
> Hi List,
>
> I'm having trouble calling the python opcodes from an orc which is run within a python script.  I've attached ex.py and ex.csd to illustrate. If I run 'python ex.py', I get
>
> error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
>  line 14:
> >>>}} <<<
>
> In reading the manual, I see that the pyinit docs imply this can be done
>
> http://csound.github.io/docs/manual/indexframes.html
>
> Any help appreciated. Thanks!
> --
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.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
>
> 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



--
Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
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

Date2016-09-14 06:26
FromBen McAllister
SubjectRe: Trouble with python opcodes + csound api
Another detail, found in my system.log - I see this everytime I see the failure to load libpy.dylib:

Sep 13 22:17:32 Bens-MBP-2 python[54036]: WARNING: The Gestalt selector gestaltSystemVersion is returning 10.9.6 instead of 10.11.6. This is not a bug in Gestalt -- it is a documented limitation. Use NSProcessInfo's operatingSystemVersion property to get correct system version number.
Call location:
Sep 13 22:17:32 Bens-MBP-2 python[54036]: 0   CarbonCore                          0x00007fff95d616df ___Gestalt_SystemVersion_block_invoke + 113
Sep 13 22:17:32 Bens-MBP-2 python[54036]: 1   libdispatch.dylib                   0x00007fff9925b40b _dispatch_client_callout + 8
Sep 13 22:17:32 Bens-MBP-2 python[54036]: 2   libdispatch.dylib                   0x00007fff9925b303 dispatch_once_f + 67
Sep 13 22:17:32 Bens-MBP-2 python[54036]: 3   CarbonCore                          0x00007fff95cedfbc _Gestalt_SystemVersion + 987
Sep 13 22:17:32 Bens-MBP-2 python[54036]: 4   CarbonCore                          0x00007fff95ced7d0 Gestalt + 139
Sep 13 22:17:32 Bens-MBP-2 python[54036]: 5   Tk                                  0x000000010aa5c5db TkpOpenDisplay + 655
Sep 13 22:17:32 Bens-MBP-2 python[54036]: 6   Tk                                  0x000000010a9c2b19 TkCreateMainWindow + 1169

Found this link: https://discussions.apple.com/thread/6656667?start=0&tstart=0 and one other within this thread: http://forums.macrumors.com/threads/support-features-on-os-x-10-10-and-later-only.1808386/ - the gist seems to be that the APIs involved in checking OS version numbers have changed and can cause the error I'm seeing.   I'm on 10.11.6, as mentioned in the syslog above.


On Tue, Sep 13, 2016 at 8:40 PM, Ben McAllister <benmca@gmail.com> wrote:
Thanks for the replies. I managed to run ex.csd without problem, but to Victor's point, I don't think the python opcodes are being loaded when run from inside a python script, but they are being loaded when running a csd.

Here's the complete output from 'python ex.py'.
Bens-MBP-2:python benmca$ python ex.py 
virtual_keyboard real time MIDI plugin for Csound
WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH
(points to rawwaves directory) to use STK opcodes.
0dBFS level = 32768.0
Csound version 6.07 (double samples) Sep  5 2016
libsndfile-1.0.21
WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libjacko.dylib' (-1)
WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libjackTransport.dylib' (-1)
WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libpy.dylib' (-1)
WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/librtjack.dylib' (-1)
UnifiedCSD:  ex.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH
(points to rawwaves directory) to use STK opcodes.
rtaudio: PortAudio module enabled ... 
using callback interface
rtmidi: PortMIDI module enabled

error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
 line 14:
>>>}} <<<
Unexpected untyped word pyruni when expecting a variable
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra
WARNING: Csound not ready for performance: csoundStart() has not been called 

end of score.   overall amps:      0.0
  overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.001s, CPU: 0.001s

Note that 'WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libpy.dylib' (-1)' - this file is present on my system, and permissions look the same as everything else in CsoundLib64.framework


Any help here is appreciated! 

On Tue, Sep 6, 2016 at 12:22 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
It runs here too. Make sure you the Python opcodes are actually loaded.
========================
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 6 Sep 2016, at 07:39, Francois PINOT <fggpinot@gmail.com> wrote:
>
> Here it runs. Try to execute the csd directly from the csound command to see if there's any problem with the csd on your system...
>
> François
>
> 2016-09-06 0:56 GMT+02:00 Ben McAllister <benmca@gmail.com>:
> Hi List,
>
> I'm having trouble calling the python opcodes from an orc which is run within a python script.  I've attached ex.py and ex.csd to illustrate. If I run 'python ex.py', I get
>
> error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
>  line 14:
> >>>}} <<<
>
> In reading the manual, I see that the pyinit docs imply this can be done
>
> http://csound.github.io/docs/manual/indexframes.html
>
> Any help appreciated. Thanks!
> --
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.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
>
> 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



--
Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183



--
Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
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

Date2016-09-14 13:23
FromVictor Lazzarini
SubjectRe: Trouble with python opcodes + csound api
Looks like conflicting Python installations perhaps? Are the opcodes linked to the same Python library that you are using for the script?
otool -L might help.
========================
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 14 Sep 2016, at 06:26, Ben McAllister  wrote:
> 
> Another detail, found in my system.log - I see this everytime I see the failure to load libpy.dylib:
> 
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: WARNING: The Gestalt selector gestaltSystemVersion is returning 10.9.6 instead of 10.11.6. This is not a bug in Gestalt -- it is a documented limitation. Use NSProcessInfo's operatingSystemVersion property to get correct system version number.
> 	Call location:
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 0   CarbonCore                          0x00007fff95d616df ___Gestalt_SystemVersion_block_invoke + 113
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 1   libdispatch.dylib                   0x00007fff9925b40b _dispatch_client_callout + 8
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 2   libdispatch.dylib                   0x00007fff9925b303 dispatch_once_f + 67
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 3   CarbonCore                          0x00007fff95cedfbc _Gestalt_SystemVersion + 987
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 4   CarbonCore                          0x00007fff95ced7d0 Gestalt + 139
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 5   Tk                                  0x000000010aa5c5db TkpOpenDisplay + 655
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 6   Tk                                  0x000000010a9c2b19 TkCreateMainWindow + 1169
> 
> Found this link: https://discussions.apple.com/thread/6656667?start=0&tstart=0 and one other within this thread: http://forums.macrumors.com/threads/support-features-on-os-x-10-10-and-later-only.1808386/ - the gist seems to be that the APIs involved in checking OS version numbers have changed and can cause the error I'm seeing.   I'm on 10.11.6, as mentioned in the syslog above.
> 
> 
> On Tue, Sep 13, 2016 at 8:40 PM, Ben McAllister  wrote:
> Thanks for the replies. I managed to run ex.csd without problem, but to Victor's point, I don't think the python opcodes are being loaded when run from inside a python script, but they are being loaded when running a csd.
> 
> Here's the complete output from 'python ex.py'.
> Bens-MBP-2:python benmca$ python ex.py 
> virtual_keyboard real time MIDI plugin for Csound
> WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH
> (points to rawwaves directory) to use STK opcodes.
> 0dBFS level = 32768.0
> Csound version 6.07 (double samples) Sep  5 2016
> libsndfile-1.0.21
> WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libjacko.dylib' (-1)
> WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libjackTransport.dylib' (-1)
> WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libpy.dylib' (-1)
> WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/librtjack.dylib' (-1)
> UnifiedCSD:  ex.csd
> STARTING FILE
> Creating options
> Creating orchestra
> Creating score
> WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH
> (points to rawwaves directory) to use STK opcodes.
> rtaudio: PortAudio module enabled ... 
> using callback interface
> rtmidi: PortMIDI module enabled
> 
> error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
>  line 14:
> >>>}} <<<
> Unexpected untyped word pyruni when expecting a variable
> Parsing failed due to invalid input!
> Stopping on parser failure
> cannot compile orchestra
> WARNING: Csound not ready for performance: csoundStart() has not been called 
> 
> end of score.		   overall amps:      0.0
> 	   overall samples out of range:        0
> 1 errors in performance
> Elapsed time at end of performance: real: 0.001s, CPU: 0.001s
> 
> Note that 'WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libpy.dylib' (-1)' - this file is present on my system, and permissions look the same as everything else in CsoundLib64.framework
> 
> 
> Any help here is appreciated! 
> 
> On Tue, Sep 6, 2016 at 12:22 AM, Victor Lazzarini  wrote:
> It runs here too. Make sure you the Python opcodes are actually loaded.
> ========================
> 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 6 Sep 2016, at 07:39, Francois PINOT  wrote:
> >
> > Here it runs. Try to execute the csd directly from the csound command to see if there's any problem with the csd on your system...
> >
> > François
> >
> > 2016-09-06 0:56 GMT+02:00 Ben McAllister :
> > Hi List,
> >
> > I'm having trouble calling the python opcodes from an orc which is run within a python script.  I've attached ex.py and ex.csd to illustrate. If I run 'python ex.py', I get
> >
> > error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
> >  line 14:
> > >>>}} <<<
> >
> > In reading the manual, I see that the pyinit docs imply this can be done
> >
> > http://csound.github.io/docs/manual/indexframes.html
> >
> > Any help appreciated. Thanks!
> > --
> > Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.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
> >
> > 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
> 
> 
> 
> -- 
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
> 
> 
> 
> -- 
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
> 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

Date2016-09-14 15:44
FromBen McAllister
SubjectRe: Trouble with python opcodes + csound api
Thanks for the answer. I didn't think to check my python -V against the latest release last night, but was on 2.7.9. After upgrading to the latest (2.7.12), this problem cleared up. :/ Thanks again for the help and quick replies.

b

On Wed, Sep 14, 2016 at 5:23 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Looks like conflicting Python installations perhaps? Are the opcodes linked to the same Python library that you are using for the script?
otool -L might help.
========================
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 14 Sep 2016, at 06:26, Ben McAllister <benmca@gmail.com> wrote:
>
> Another detail, found in my system.log - I see this everytime I see the failure to load libpy.dylib:
>
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: WARNING: The Gestalt selector gestaltSystemVersion is returning 10.9.6 instead of 10.11.6. This is not a bug in Gestalt -- it is a documented limitation. Use NSProcessInfo's operatingSystemVersion property to get correct system version number.
>       Call location:
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 0   CarbonCore                          0x00007fff95d616df ___Gestalt_SystemVersion_block_invoke + 113
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 1   libdispatch.dylib                   0x00007fff9925b40b _dispatch_client_callout + 8
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 2   libdispatch.dylib                   0x00007fff9925b303 dispatch_once_f + 67
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 3   CarbonCore                          0x00007fff95cedfbc _Gestalt_SystemVersion + 987
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 4   CarbonCore                          0x00007fff95ced7d0 Gestalt + 139
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 5   Tk                                  0x000000010aa5c5db TkpOpenDisplay + 655
> Sep 13 22:17:32 Bens-MBP-2 python[54036]: 6   Tk                                  0x000000010a9c2b19 TkCreateMainWindow + 1169
>
> Found this link: https://discussions.apple.com/thread/6656667?start=0&tstart=0 and one other within this thread: http://forums.macrumors.com/threads/support-features-on-os-x-10-10-and-later-only.1808386/ - the gist seems to be that the APIs involved in checking OS version numbers have changed and can cause the error I'm seeing.   I'm on 10.11.6, as mentioned in the syslog above.
>
>
> On Tue, Sep 13, 2016 at 8:40 PM, Ben McAllister <benmca@gmail.com> wrote:
> Thanks for the replies. I managed to run ex.csd without problem, but to Victor's point, I don't think the python opcodes are being loaded when run from inside a python script, but they are being loaded when running a csd.
>
> Here's the complete output from 'python ex.py'.
> Bens-MBP-2:python benmca$ python ex.py
> virtual_keyboard real time MIDI plugin for Csound
> WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH
> (points to rawwaves directory) to use STK opcodes.
> 0dBFS level = 32768.0
> Csound version 6.07 (double samples) Sep  5 2016
> libsndfile-1.0.21
> WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libjacko.dylib' (-1)
> WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libjackTransport.dylib' (-1)
> WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libpy.dylib' (-1)
> WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/librtjack.dylib' (-1)
> UnifiedCSD:  ex.csd
> STARTING FILE
> Creating options
> Creating orchestra
> Creating score
> WARNING: STK opcodes not available: define environment variable RAWWAVE_PATH
> (points to rawwaves directory) to use STK opcodes.
> rtaudio: PortAudio module enabled ...
> using callback interface
> rtmidi: PortMIDI module enabled
>
> error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
>  line 14:
> >>>}} <<<
> Unexpected untyped word pyruni when expecting a variable
> Parsing failed due to invalid input!
> Stopping on parser failure
> cannot compile orchestra
> WARNING: Csound not ready for performance: csoundStart() has not been called
>
> end of score.            overall amps:      0.0
>          overall samples out of range:        0
> 1 errors in performance
> Elapsed time at end of performance: real: 0.001s, CPU: 0.001s
>
> Note that 'WARNING: could not open library '/Library/Frameworks/CsoundLib64.framework/Resources/Opcodes64/libpy.dylib' (-1)' - this file is present on my system, and permissions look the same as everything else in CsoundLib64.framework
>
>
> Any help here is appreciated!
>
> On Tue, Sep 6, 2016 at 12:22 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> It runs here too. Make sure you the Python opcodes are actually loaded.
> ========================
> 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 6 Sep 2016, at 07:39, Francois PINOT <fggpinot@gmail.com> wrote:
> >
> > Here it runs. Try to execute the csd directly from the csound command to see if there's any problem with the csd on your system...
> >
> > François
> >
> > 2016-09-06 0:56 GMT+02:00 Ben McAllister <benmca@gmail.com>:
> > Hi List,
> >
> > I'm having trouble calling the python opcodes from an orc which is run within a python script.  I've attached ex.py and ex.csd to illustrate. If I run 'python ex.py', I get
> >
> > error: syntax error, unexpected STRING_TOKEN  (token "}}") from file ex.csd (1)
> >  line 14:
> > >>>}} <<<
> >
> > In reading the manual, I see that the pyinit docs imply this can be done
> >
> > http://csound.github.io/docs/manual/indexframes.html
> >
> > Any help appreciated. Thanks!
> > --
> > Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.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
> >
> > 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
>
>
>
> --
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
>
>
>
> --
> Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
> 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



--
Ben McAllister | listenfaster.com |  @listenfaster | tuktuband.com | c: 206.849.3183
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