I get the following errors while running the CtcsoundAPIExamples.ipynb file:
My Setup:
- Python 3.7
- Jupyter 1.0.0
- Numpy 1.16.1
- ctsound 0.0.3
ERROR LOG:
ValueError Traceback (most recent call last)
~/Code/csound_python/venv/lib/python3.7/site-packages/numpy/core/_internal.py in _dtype_from_pep3118(spec)
597 stream = _Stream(spec)
--> 598 dtype, align = __dtype_from_pep3118(stream, is_subdtype=False)
599 return dtype
~/Code/csound_python/venv/lib/python3.7/site-packages/numpy/core/_internal.py in __dtype_from_pep3118(stream, is_subdtype)
674 else:
--> 675 raise ValueError("Unknown PEP 3118 data type specifier %r" % stream.s)
676
ValueError: Unknown PEP 3118 data type specifier 'P'
The above exception was the direct cause of the following exception:
ValueError Traceback (most recent call last)
in
68
69 # Create a set of ChannelUpdaters
---> 70 channels = [ChannelUpdater("amp", RandomLine(.4, .2)),
71 ChannelUpdater("freq", RandomLine(400, 80)),
72 ChannelUpdater("resonance", RandomLine(0.4, .3))]
in init(self, channelName, updater)
30 def init(self, channelName, updater):
31 self.updater = updater
---> 32 self.channel = createChannel(channelName)
33
34 def update(self):
in createChannel(channelName)
24 def createChannel(channelName):
25 chn, _ = c.channelPtr(channelName,
---> 26 ctcsound.CSOUND_CONTROL_CHANNEL | ctcsound.CSOUND_INPUT_CHANNEL)
27 return chn
28
~/Code/csound_python/venv/lib/python3.7/site-packages/ctcsound.py in channelPtr(self, name, type_)
1592 arrayType = np.ctypeslib.ndpointer(MYFLT, 1, (length,), 'C_CONTIGUOUS')
1593 p = cast(ptr, arrayType)
-> 1594 return np.ctypeslib.as_array(p), err
1595 elif ret == CSOUND_MEMORY:
1596 err = 'Not enough memory for allocating channel'
~/Code/csound_python/venv/lib/python3.7/site-packages/numpy/ctypeslib.py in as_array(obj, shape)
517 obj = ctypes.cast(obj, p_arr_type).contents
518
--> 519 return array(obj, copy=False)
520
521
ValueError: '<P' is not a valid PEP 3118 buffer format string