ctcsound (Python, CsoundVST 6.08, Windows, x64)
Date | 2016-10-07 21:13 |
From | sjakops |
Subject | ctcsound (Python, CsoundVST 6.08, Windows, x64) |
I am having some trouble with ctcsound (using CsoundVST 6.08) - when I try to run the code below I get this message: File "C:\Program Files\Csound6_x64\bin\ctcsound.py", line 813, in performKsmps return libcsound.csoundPerformKsmps(self.cs) WindowsError: exception: access violation reading 0xFFFFFFFFFFFFFFFF Code: import ctcsound import ctypes def foo(csound, channelName, channelValuePtr, channelTypePtr): name = ctcsound.pstring(channelName) valPtr = ctypes.cast(channelValuePtr, ctypes.POINTER(ctcsound.MYFLT)) valPtr[0] = ctcsound.MYFLT(440.0) print("hello", name) c = ctcsound.Csound() c.setOption("-odac") c.compileOrc(""" sr=44100 ksmps=32 nchnls=2 0dbfs=1 instr 1 kfreq invalue "freq" kenv linsegr 0, .05, 1, .05, 0 aout vco2 kenv, kfreq outs aout, aout endin """) c.setInputChannelCallback(foo) c.readScore("i1 0 0.2 \n i1 1 2") c.start() while (c.performKsmps() == 0): pass c.stop() I wonder if there could be a bug, or am I doing something wrong? Best regards, Søren -- View this message in context: http://csound.1045644.n5.nabble.com/ctcsound-Python-CsoundVST-6-08-Windows-x64-tp5751978.html 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 |
Date | 2016-10-07 22:53 |
From | Victor Lazzarini |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Did you try without adding the callback? Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 7 Oct 2016, at 21:13, sjakops |
Date | 2016-10-08 07:52 |
From | Søren Jakobsen |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Yes, it works fine without the callback. Søren On 10/7/16, Victor Lazzarini |
Date | 2016-10-08 09:37 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Here it works fine with the callback: Ubuntu 14.04, and Csound 6.08 built from sources on October 2nd. If you use a prebuilt version of Csound, you have to use the ctcsound.py file distributed with this release instead.Wich ctcsound.py file do you use? Beware that the ctcsound.py from the sources or from my github repo are continuously updated to reflect the last changes in the sources. 2016-10-07 22:13 GMT+02:00 sjakops <sorenkj@gmail.com>: I am having some trouble with ctcsound (using CsoundVST 6.08) - when I try to |
Date | 2016-10-08 09:43 |
From | Victor Lazzarini |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
I can confirm this on OSX. Setting the callback makes it segfault on performance. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 8 Oct 2016, at 07:53, Søren Jakobsen |
Date | 2016-10-08 10:03 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
I just pulled again the sources and rebuilt Csound: it still works fine here. François2016-10-08 10:43 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: I can confirm this on OSX. Setting the callback makes it segfault on performance. |
Date | 2016-10-08 10:14 |
From | Victor Lazzarini |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
I am running from the latest sources too. It’s puzzling that it does not work here then. I tried using the debugger, but it fails on loading the csound library, so I can’t use it. > On 8 Oct 2016, at 10:03, Francois PINOT |
Date | 2016-10-08 10:17 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
I'll try it this afternoon on a Windows seven system... François2016-10-08 11:14 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: I am running from the latest sources too. It’s puzzling that it does not work here |
Date | 2016-10-08 10:32 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Could you try it commenting out the first three lines in the foo function? François2016-10-08 11:14 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: I am running from the latest sources too. It’s puzzling that it does not work here |
Date | 2016-10-08 11:10 |
From | Søren Jakobsen |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
If I comment out the first three line of foo (and leave a print statement) I get the same error. I also tried replacing with the latest ctcsound.py (am using the prebuilt CsoundVst) and I get this message: Traceback (most recent call last): File "d:\test.py", line 1, in |
Date | 2016-10-08 11:14 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Ok this means that you have to use the ctcsound.py shipped with the prebuilt Csound VST. Can you try your example commenting out the first and the fourth line of foo and leaving the second and third line uncommented? François2016-10-08 12:10 GMT+02:00 Søren Jakobsen <sorenkj@gmail.com>: If I comment out the first three line of foo (and leave a print |
Date | 2016-10-08 11:25 |
From | Victor Lazzarini |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
On OSX, I commented out all lines and added a pass, but it had the same result
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2016-10-08 11:29 |
From | Søren Jakobsen |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
When commenting out only the first and fourth line of foo I still get the same error (sometimes a different address is reported). I wonder if it could also be an issue with my installation of numpy.. (to install numpy on my x64 I downloaded the zip from here https://pypi.python.org/pypi/numpy and ran 'python setup.py install'). On 10/8/16, Francois PINOT |
Date | 2016-10-08 11:35 |
From | Victor Lazzarini |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Try commenting out the whole thing and adding a pass statement. If the error is still there, then it is the same as I a getting here Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 8 Oct 2016, at 11:29, Søren Jakobsen |
Date | 2016-10-08 12:24 |
From | Victor Lazzarini |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
yes, I commented everything out and added a ‘pass’. Same result. > On 8 Oct 2016, at 10:32, Francois PINOT |
Date | 2016-10-08 12:26 |
From | Søren Jakobsen |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Yes, same error if I comment out everything and pass. Søren On 10/8/16, Victor Lazzarini |
Date | 2016-10-08 14:50 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
I installed Csound 6.07 and Python 3.5 (from Anaconda) on a brand new Virtual Machine with Windows seven and I get the same error. So it seems it has been there for a while. However, on my Ubuntu box, it's running fine with Python 2.7 and Python 3.5. Weird...2016-10-08 13:26 GMT+02:00 Søren Jakobsen <sorenkj@gmail.com>: Yes, same error if I comment out everything and pass. |
Date | 2016-10-08 19:13 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
I think I got it. Victor, could you download ctcsound.py from my github repo (https://raw.githubusercontent.com/fggp/ctcsound/master/ctcsound.py) and retry to run Søren's example importing this version of ctcsound.py? François2016-10-08 13:24 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: yes, I commented everything out and added a ‘pass’. Same result. |
Date | 2016-10-08 23:09 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
It is a garbage collector problem: ctypes doesn't keep references to CFUNCTYPE object and so the user has to make sure that its python code keeps a reference to the callback functions as long as they are used by the C code. It seems that the Python garbage collector is more aggressive on Windows and OSX than on Linux. I've committed the corrections on my github repo and in the Csound sources. Søren, if you want to use it with your prebuilt release of Csound you shoud comment out lines 230 and 977 in this new version of ctcsound.py, because the function outputFormat was added later.2016-10-08 20:13 GMT+02:00 Francois PINOT <fggpinot@gmail.com>:
|
Date | 2016-10-10 09:10 |
From | Søren Jakobsen |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Great, thanks a lot! Søren On 10/8/16, Francois PINOT |
Date | 2016-10-10 10:05 |
From | Francois PINOT |
Subject | Re: ctcsound (Python, CsoundVST 6.08, Windows, x64) |
Thank you for testing. François2016-10-10 10:10 GMT+02:00 Søren Jakobsen <sorenkj@gmail.com>: Great, thanks a lot! |