athenaCL at control rate in CSound ex1 - python error

41 views
Skip to first unread message

Jeffrey Trevino

unread,
Dec 11, 2011, 4:27:57 PM12/11/11
to athenacl
Thanks for answering my question about tpmap - I guess there can't be spaces, because the arguments in a command line argument vector are separated by spaces, and the parameter object and its arguments must be one argument in the argument vector? Is that why?

I'm starting to work through the examples in your paper about using athenaCL parameter objects at the control rate in CSound. I understand the first example, but I can't render it, because I'm getting a python error - maybe you've seen this before?:

trevino2:Csound Jeffrey$ csound pythonAtControlRateEx1.csd
PortMIDI real time MIDI plugin for Csound
PortAudio real-time audio module for Csound
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 5.12 (float samples) May  4 2010
libsndfile-1.0.20
UnifiedCSD:  pythonAtControlRateEx1.csd
STARTING FILE
Creating orchestra
Creating score
orchname:  /var/folders/x1/x1hxXVtn2P8Kck+8ZRfT6U+++TI/-Tmp-//csound-yRBQ5c.orc
scorename: /var/folders/x1/x1hxXVtn2P8Kck+8ZRfT6U+++TI/-Tmp-//csound-LfYORn.sco
rtaudio: PortAudio module enabled ... using callback interface
rtmidi: PortMIDI module enabled
orch compiler:
    instr    100   
Elapsed time at end of orchestra compile: real: 0.059s, CPU: 0.004s
sorting score ...
    ... done
Elapsed time at end of score sort: real: 0.093s, CPU: 0.022s
Csound version 5.12 (float samples) May  4 2010
0dBFS level = 32768.0
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site.py:150: Warning: 'with' will become a reserved keyword in Python 2.6
'import site' failed; use -v for traceback
INIT ERROR in instr 0: pyruni: python exception
    pyruni    "
from athenaCL.libATH.libPmtr import parameter
fq = parameter.factory(["waveSine", "time", 2, 0, 100, 400]) "   
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/Applications/athenaCL-2.0.0a15/athenaCL/libATH/libPmtr/parameter.py", line 11, in <module>
    import os, copy, random
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/os.py", line 758
    bs = b""
           ^
SyntaxError: invalid syntax
header init errors
inactive allocs returned to freespace
end of score.           overall amps:      0.0
       overall samples out of range:        0
2 errors in performance
Elapsed time at end of performance: real: 0.708s, CPU: 0.110s

I'm pretty sure that the code is right - I just copied it from the example in your paper:

<CsoundSynthesizer>
<CsInstruments>
sr    = 44100
ksmps = 100
nchnls = 1
pyinit
pyruni {{
from athenaCL.libATH.libPmtr import parameter
fq = parameter.factory(["waveSine", "time", 2, 0, 100, 400]) }}

instr 100
iStart = p2
iDur = p3
iAmp = ampdbfs(p4)

kPhaseRt    line    iStart, iDur, iStart+iDur
kPhaseEv    line    0, iDur, iDur
kFq    pycall1    "fq", kPhaseEv
aSig    oscili iAmp, kFq, 1
    out    aSig
   
endin
</CsInstruments>
<CsScore>
f1    0 16384 10 1
i100 0 10 -18
</CsScore>
</CsoundSynthesizer>



--
《〠》】〶【〖〠〗〶〛〷〚
Jeff Treviño
PhD Candidate in Music Composition
@ the University of California, San Diego
〖〠〗〶〛〷〚《〠》】〶
Skype: jeffreytrevino
E-mail: jeffrey...@gmail.com
〚《〠》】〶【〖〠〗〶〛〷
9310H Redwood Dr.
La Jolla, CA 92037
USA
〖〠〗〶〛〷〚《〠》】〶【

menno

unread,
Jan 6, 2013, 10:36:44 AM1/6/13
to athe...@googlegroups.com
It means - as i just found out - that PYTHONPATH is not set correctly to where AthenaCL is.
You should tell the Python the location of AthenaCL.

greetings
Menno
Reply all
Reply to author
Forward
0 new messages