csounddart 0.0.4 copy "csounddart: ^0.0.4" to clipboard
csounddart: ^0.0.4 copied to clipboard

outdated

Dart unified interface to Csound API for Web, Desktop and Mobile. It allows to use Csound audio synthesis engine, with a simple and unified API.

csounddart #

An Dart interface to Csound API. The intention of this project is to provide an unified API for creating applications with Flutter and Csound - whatever the target is (Linux, MacOS, Windows, Web, Android, iOS... and probably Fushia in the future). It is currently under development. It has been tested on Linux, and should work easily on Windows and MacOS (with a few path resolution work). The web version is likely to be working soon. Mobile versions aren't working yet.

On desktop platforms, it assumes Csound is already installed on your computer.

Getting Started #

//Create the Csound object
Csound _cs = Csound();
// Compiles Csound CSD text and gets the return value
int res = await _cs.compileCsdText(_myCsdText);

// Reads a piece of score
int res = await _cs.readScore(_myScore);

// Compiles from path
int res = await _cs.compileCsd(_myCsd);

// Compiles Orchestra
int res = await _cs.compileOrc(_orchestra);

// threaded performance
_cs.perform();

// set a channel value
_cs.setControlChannel("channelName", (double)value);

// set a callback. The passed method will be called at every k-pass.
_cs.setControlChannelCallback("channelName",
    (double v) {
        // do something with callback
    }
);

// retrieves a control channel value
double channel = _cs.getControlChannel("channemName");

// Gets values from Csound
int ksmps = await _cs.getKsmps();
int nchnls = await _cs.getNchnls();
int sr = await _cs.getSr();
int dbfs = await _cs.get0dbfs();

// Stops Csound and resets it
_cs.stop();

Platforms : to do #

Linux #

  • All done

Windows #

  • Needs to resolve paths (almost done)

MacOS #

  • Path resolution
  • Bundle audio_utilities library with the plugin
  • Make sure CsoundLib64 is loaded correctly

Web #

  • The project is working in a Flutter application, if the user adds CsoundObj.js and CsoundDart.js as scripts in the index.html file. Though, dynamic loading those files from the plugin still doesn't work.

Android #

  • All experiments drove me to Selinux policy issues "avc-denial". Still trying to figure out.
  • Probably needs to provide Csound's binary for ARM with the plugin, which might cause a problem since Flutter plugins can't be to big (100 MB max).

iOS #

  • Not even tried yet.
9
likes
0
pub points
17%
popularity

Publisher

unverified uploader

Dart unified interface to Csound API for Web, Desktop and Mobile. It allows to use Csound audio synthesis engine, with a simple and unified API.

Repository

License

unknown (LICENSE)

Dependencies

ffi, flutter, flutter_web_plugins, js, path

More

Packages that depend on csounddart