[Csnd] problem with python opcodes
Date | 2020-11-02 21:15 |
From | Stefan Thomas |
Subject | [Csnd] problem with python opcodes |
Dear communty, I have a problem with pyrun and pyruni opcodes. The following patch is more or less the same as https://csound.com/docs/manual/pyrun.html When I run the patch I get an error messages:
Does someone know, how I can get that patch running? Here is the patch: <CsoundSynthesizer> <CsOptions> -odac -m0d </CsOptions> ; ============================================== <CsInstruments> sr = 44100 ;ksmps = 100 nchnls = 1 0dbfs = 1 pyinit pyruni "import random" instr 1 ; This message is stored in the main namespace ; and is the same for every instance pyruni "message = 'a global random number: %f' % random.random()" pyrun "print message" ; This message is stored in the private namespace ; and is different for different instances pylruni "message = 'a private random number: %f' % random.random()" pylrun "print message" endin </CsInstruments> ; ============================================== <CsScore> i1 0 0.1 </CsScore> </CsoundSynthesizer> |
Date | 2020-11-02 21:20 |
From | Tarmo Johannes |
Subject | Re: [Csnd] problem with python opcodes |
Hi! Is your Csound built with Python support? Can you see any python opcodes when you run csound -z ? tarmo Kontakt Stefan Thomas (<kontrapunktstefan@gmail.com>) kirjutas kuupäeval E, 2. november 2020 kell 23:15:
|
Date | 2020-11-02 21:36 |
From | Stefan Thomas |
Subject | Re: [Csnd] problem with python opcodes |
Dear Tarmo, thanks for Your reply. You are right, csound is installed without python opcodes. How can I do this? Stefan Am Mo., 2. Nov. 2020 um 22:20 Uhr schrieb Tarmo Johannes <trmjhnns@gmail.com>:
|
Date | 2020-11-03 07:17 |
From | Tarmo Johannes |
Subject | Re: [Csnd] problem with python opcodes |
Attachments | None None |
Date | 2020-11-03 07:47 |
From | Francois PINOT |
Subject | Re: [Csnd] problem with python opcodes |
Hello, Actually the Python opcodes in the Csound sources are obsolete because they're intended to be used with Python 2.x which is no longer supported since January 1st, 2020. I did a Python3 port of these opcodes here: https://github.com/csound/plugins. You can clone this repo in your system and build the Python opcodes from this plugin repository. Regards François Le mar. 3 nov. 2020 à 08:17, Tarmo Johannes <trmjhnns@gmail.com> a écrit :
|
Date | 2020-11-03 11:48 |
From | Peter Burgess |
Subject | Re: [Csnd] problem with python opcodes |
That's awesome! I've hoped for python 3 support in Csound for ages. Python 3 already existed when I started learning Python years back, so it felt like devolution when I tried to use python in Csound recently On Tue, 3 Nov 2020, 07:48 Francois PINOT, <fggpinot@gmail.com> wrote:
|
Date | 2020-11-03 13:29 |
From | Stefan Thomas |
Subject | Re: [Csnd] problem with python opcodes |
Thanks, I will try it out, as soon as possible! Am Di., 3. Nov. 2020 um 08:17 Uhr schrieb Tarmo Johannes <trmjhnns@gmail.com>:
|
Date | 2020-11-03 13:30 |
From | Stefan Thomas |
Subject | Re: [Csnd] problem with python opcodes |
Oh, this seems really interesting. I also prefer python3! Am Di., 3. Nov. 2020 um 08:48 Uhr schrieb Francois PINOT <fggpinot@gmail.com>:
|
Date | 2020-11-05 16:58 |
From | Richard van Bemmelen |
Subject | Re: [Csnd] problem with python opcodes |
I followed the build instructions, but after that csound still had no Python opcodes... Op di 3 nov. 2020 om 08:48 schreef Francois PINOT <fggpinot@gmail.com>:
|
Date | 2020-11-05 17:07 |
From | Francois PINOT |
Subject | Re: [Csnd] problem with python opcodes |
After the build you have to copy libpy.so into the Csound plugins repository. If you built the plugins from the root of the plugin dir then a sudo make install should do it. François Le jeu. 5 nov. 2020 à 17:58, Richard van Bemmelen <zappfinger@gmail.com> a écrit :
|
Date | 2020-11-05 17:19 |
From | Richard van Bemmelen |
Subject | Re: [Csnd] problem with python opcodes |
What Csound plugins repository do you mean? Richard Op do 5 nov. 2020 om 18:07 schreef Francois PINOT <fggpinot@gmail.com>:
|
Date | 2020-11-06 07:37 |
From | Francois PINOT |
Subject | Re: [Csnd] problem with python opcodes |
The directory pointed by the OPCODE6DIR64 environment variable. On Debian/Ubuntu systems it's /usr/local/lib/csound/plugins64-6.0. It's the location where the install script copies the plugin libs. Regards François Le jeu. 5 nov. 2020 à 18:19, Richard van Bemmelen <zappfinger@gmail.com> a écrit :
|
Date | 2020-11-06 09:55 |
From | Richard van Bemmelen |
Subject | Re: [Csnd] problem with python opcodes |
Apperently I had this error: Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "3") -- PYTHONLIBS_FOUND="FALSE", so disabling BUILD_PYTHON_OPCODES -- BUILD_PYTHON_OPCODES is disabled. Any idea? Op vr 6 nov. 2020 om 08:37 schreef Francois PINOT <fggpinot@gmail.com>:
|
Date | 2020-11-06 10:33 |
From | Richard van Bemmelen |
Subject | Re: [Csnd] problem with python opcodes |
Ok, i had to execute: sudo apt get python3-dev and then run the build again.... Richard Op vr 6 nov. 2020 om 10:55 schreef Richard van Bemmelen <zappfinger@gmail.com>:
|
Date | 2020-11-06 13:55 |
From | ljc |
Subject | Re: [Csnd] problem with python opcodes |
el Tue, 3 Nov 2020 08:47:39 +0100 Francois PINOT |
Date | 2020-11-06 15:00 |
From | Francois PINOT |
Subject | Re: [Csnd] problem with python opcodes |
Until recently (January 1st 2020) Python 2.7 was still in use on many systems. Now it is officially deprecated. It is planned to have the plugin opcodes separated from the core Csound source in Csound 7. So the plugin repo was a test with the py opcodes and a few other plugins. It is planned to have Python 3 support in Csound 7. So actually you can use Python 3 with ctcsound to have access to the Csound API and you can build the py opcodes from the plugin repo if you need to use them with Python3. François Le ven. 6 nov. 2020 à 14:55, ljc <ljc@internet.com.uy> a écrit : el Tue, 3 Nov 2020 08:47:39 +0100 |
Date | 2020-11-08 17:03 |
From | Stefan Thomas |
Subject | Re: [Csnd] problem with python opcodes |
Dear François, can I build these opcodes after the installation of csound? Am Di., 3. Nov. 2020 um 08:48 Uhr schrieb Francois PINOT <fggpinot@gmail.com>:
|
Date | 2020-11-08 17:09 |
From | Francois PINOT |
Subject | Re: [Csnd] problem with python opcodes |
Yes, the build of the plugin produces a dynamic library which can be installed afterwards into the Csound plugins directory. When starting Csound, it detects all the plugins found in that directory. François Le dim. 8 nov. 2020 à 18:03, Stefan Thomas <kontrapunktstefan@gmail.com> a écrit :
|
Date | 2020-11-08 17:20 |
From | Stefan Thomas |
Subject | Re: [Csnd] problem with python opcodes |
Dear François, thanks, I was able to install it and the py-opcodes seem to be working fine, after a first glimpse. All the best, Stefan Am So., 8. Nov. 2020 um 18:09 Uhr schrieb Francois PINOT <fggpinot@gmail.com>:
|