Coder Social home page Coder Social logo

gogins / csound-cxx-opcodes Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 736 KB

The "cxx" opcodes enable C++ code to be compiled and run in Csound orchestras.

License: GNU Lesser General Public License v2.1

C++ 74.48% C 9.17% CMake 15.16% Shell 1.20%
computer-music csound

csound-cxx-opcodes's People

Contributors

gogins avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

csound-cxx-opcodes's Issues

Prepare for release

  • Clarify what is happening in clang_hello.csd.
  • Make the README.md crystal clear.
  • Make clang_example.csd crystal clear, self-contained, spectacular, and foolproof. Strings, i-rates, k-rates, and a-rates should all be returned by clang_invoke. It has to make music of some degree of interest.
  • Make it build with CMake. Not happening so far... not bothering for now.
  • Make it pass valgrind. There are some errors before Csound starts performing, but none after that. There are leaks, but none of them seem to be directly from the source code for the opcodes; they are either in valgrind itself or in the LLVM infrastructure.
  • Make it build a Debian package. Not necessary. Just the binary and README.md are enough.
  • Write an article for Computer Music Journal about this. Submitted.
  • Add license text.
  • Upload compiled plugin.
  • Build on macOS.
  • Put in csound-plugins. Not doing.

Build on macOS

  • Install llvm@13.
  • Deal with caveats:
To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have llvm first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
  • Update macOS build script.
  • Test.

CMJ article about the Clang opcodes

For submission to the arXiv and Computer Music Journal. Outstanding tasks:

  • Redo diagram of Clang/LLVM.
  • Clarify structure of ORC in the back end.
  • New diagram for ORC?
  • Root references for Csound, Clang/LLVM, ORC, SuperCollider, Faust, the Faust opcodes.
  • Add DOI to all references wherever possible.
  • Outline of code for clang_hello.csd.
  • Better way to cite Web resources.
  • Suggest how code could be re-used in SuperCollider and Pure Data.
  • Get example working musically.
  • Compare execution times for the Faust guitar.
  • Clarify submission guidelines/sharing:

Manuscripts are received with the understanding that they represent original material and are not being considered elsewhere for print or digital publication. Six months after being published in the Computer Music Journal, the articles may be posted online, subject to restrictions stated at LINK TBA.

I think this means I can share my code and examples but not the article. I can clarify that with the editor.

The article should refer to examples only via GitHub and thus should be submitted before the examples are finished.

Multithreaded compiler for Clang opcodes

Currently the Clang opcodes function very well but there is a potential future issue with Csound startup being delayed by compilation of embedded C++ code. I anticipate problems after about 2 to 4 thousand lines of C++ source code.

Making the JIT compiler multithreaded is the only simple way I know of to address this. I will try that.

Speed up csound->InputMessage

When there are more than a hundred thousand lines in the message this gets way too slow. It's definitely slower than I think it should be, my computer should be able to handle millions of lines. This affects the use of the Clang opcodes which can generate large scores that have to go in this way.

I will profile/debug this with a custom C++ program.

Shared libraries that are linked by embedded code, are not bound at run time.

This is caused by the behavior of the linking loader. Explicitly calling dlopen or the equivalent for dependent dynamic link libraries, before loading the compiled module, resolves this issue.

  • Add a parameter to cxx_compile that will contain a list of dynamic link libraries to load in global scop, before loading the compiled module.
  • Update the documentation to reflect this.
  • Test with a composition of mine.

prefix release titles with version number?

Addong a title overrides the version title element in the /releases.atom feed making it not possible to parse the version number from it. I'd like to request that the release title is prefixed by the release version number, then I could aggregate releases to https://libreav.org

Tutorial videos

Make one or two short videos explaining to how to install and use the Clang opcodes. Should use a nifty but simple example.

Performance benchmarks

Benchmark, with statistical confidence tests, the performance of the following implementations of the Faust physically modeled guitar:

  • faust compile to Csound architecture (plugin opcode).
  • faustcompile opcode to faustdsp opcode
  • faust compile to C++ and then use clang_compile and clang_invoke.

Re-implement using standard compiler commands

The LLVM people were no use in resolving the macOS bug so I have had enough of them. I will produce another version of these opcodes that use standard c/c++ toolchains to compile a temporary C++ file and load the resulting dynamic link library into Csound, finding and invoking functions as with the clang opcodes.

  • Port clang_opcodes to cxx_opcodes.
  • Build cxx_opcodes.
  • Run simple example.
  • Run real-world example.
  • Document.
  • Source release.

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.