Code Monkey home page Code Monkey logo

csoundapi_examples's Introduction

How to use the Csound API

Author: Steven Yi [email protected] 2013.10.28

The examples in this directory demonstrate how to use the Csound API. The examples in Python were used for the 2nd International Csound Conference, at the two-part session "How to Use the Csound API". These examples were further developed since then, and have been translated into other languages.

Each language folder should have its own README.md that will explain futher details on how to run the examples. Also, each example file is commented to explain what the example illustrates.

Contributing

If you'd like to contribute changes or translations into other languages, please fork this project and submit pull requests. This is the preferred method for contributions. If you are uncomfortable with the pull request system, you can email Steven with changes.

csoundapi_examples's People

Contributors

daveseidel avatar fggp avatar francesco66 avatar joachimheintz avatar kunstmusik avatar neithanmo avatar renenyffenegger avatar rhenninger avatar rorywalsh avatar vlazzarini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csoundapi_examples's Issues

Issue on Python Tutorial 8,9,10 (CtcsoundAPIExamples.ipynb)

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

Issues with building Java examples

@kunstmusik I'm getting a build error when using the Ant method to build the examples on macOS Monterey (M1 silicon)

[javac] /Users/boonier/GIT/csoundAPI_examples/java/src/csoundapiexamples/Example1.java:18: error: package csnd6 does not exist
[javac] import csnd6.Csound;

Is the build config not finding the required Csound6 libs? The build.xml references the netbeans build config:

<import file="nbproject/build-impl.xml"/> in which I assume the class path is:

javac.classpath=\ ${libs.csnd6.classpath}

I assume this means the config though Netbeans, which I am not using.

I've got the usual symlinks in /Library/Java/Extensions for csnd6.jar and lib_jcsound6.jnilib

Any ideas?

many thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.