Git Product home page Git Product logo

aknuds1 / chuck Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ccrma/chuck

16.0 11.0 5.0 54.5 MB

ChucK Music Programming Language

Home Page: http://chuck.stanford.edu/

License: GNU General Public License v2.0

ChucK 5.56% JavaScript 2.70% CoffeeScript 0.22% HTML 0.07% CSS 0.01% Perl 0.02% C++ 61.52% C 28.84% Arduino 0.01% Makefile 0.10% Ragel in Ruby Host 0.08% Objective-C++ 0.31% Python 0.03% Lex 0.14% Yacc 0.33% Groovy 0.06%

chuck's Introduction

ChucK Build Status

Strongly-timed, Concurrent, and On-the-fly Music Programming Language

Welcome to ChucK!

what is it? : ChucK is a programming language for real-time sound synthesis and music creation. It is open-source and freely available on MacOS X, Windows, and Linux. ChucK presents a unique time-based, concurrent programming model that's precise and expressive (we call this strongly-timed), dynamic control rates, and the ability to add and modify code on-the-fly. In addition, ChucK supports MIDI, OpenSoundControl, HID device, and multi-channel audio. It's fun and easy to learn, and offers composers, researchers, and performers a powerful programming tool for building and experimenting with complex audio synthesis/analysis programs, and real-time interactive music.

For more information, including documentation, research publications, and community resources, please check out the ChucK website: http://chuck.stanford.edu/

JavaScript

ChucK has a JavaScript port, generated by the conversion tool Emscripten. The JavaScript version consists of a single file, chuck.js, which is generated by the make target 'emscripten'.

This library requires Web Audio API to function, so be sure to combine it with a compliant browser. We have a test HTML page to demonstrate chuck.js, src/emscripten/chuck.html; just open this in a Web Audio enabled browser, and you should hear a short sine tone.

BUILDING

If you wish to build for debugging, make sure you export the environment variable CHUCK_DEBUG equal to 1 (export CHUCK_DEBUG=1) before building. This will disable optimization and enable debug symbols. It will also make the the JavaScript version of ChucK easier to work with, due to not being optimized.

JavaScript

To build the JavaScript port of ChucK, you should use the Gradle build tool. Since a wrapper is included with ChucK, you'll only need to make sure the Java runtime (JRE) is installed first. Then, you must install Emscripten and make sure it's activated in your shell by sourcing the Emscripten SDK. On OS X I accomplish this with the following command: pushd ~/Applications/emsdk_portable/ && source ./emsdk_env.sh && popd. Now, from the root directory run ./gradlew emscripten. This will generate a JavaScript library with the help of Emscripten: 'build/js/chuck.js'.

JavaScript Demos

To build the JavaScript demo HTML pages, first make sure you have NPM installed. Also, install grunt (npm install -g grunt-cli) if you don't have it. Then, enter the js directory, and if you haven't done so already, run npm install to install the JavaScript dependencies.

To build the demo pages, in js/examples/, enter the js/ directory and execute grunt. This'll build a number of standalone HTML pages in the js/examples/ directory, each of which you can open to see/hear a certain demo of ChucK.

It is recommended to launch the demo pages via a Web server, this is actually required if chuck.js has been built with optimizations, for technical reasons. If you've got Python installed, you can start a Web server as simple as this: python -m SimpleHTTPServer.

chuck's People

Contributors

aknuds1 avatar brulo avatar gewang avatar markcerqueira avatar spencersalazar avatar

Stargazers

 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

chuck's Issues

Extract tasks in build.gradle into plugin

To make Gradle build script more declarative/easier to read, move task implementations into plugin. Also consider moving Emscripten logic into a subproject of its own.

Implement Emscripten JavaScript library for Web Audio

We need an Emscripten JS library, so that chuck.js may interact with Web Audio. Work has started on said library, webaudio.js, but it only consists of stub functions as of yet.

The purpose of the library is to be called by the digiio_webaudio backend in ChucK, in order to interact with Web Audio API.

Segmentation fault

When chuck.js is built with SAFE_HEAP and running the basic/whole example, a segmentation fault is detected.

segmentation fault loading 1 bytes from address 0
chuck.js:219564 Uncaught abort() at Error
    at jsStackTrace (http://localhost:8000/examples/basic/chuck.js:1049:13)
    at stackTrace (http://localhost:8000/examples/basic/chuck.js:1066:22)
    at abort (http://localhost:8000/examples/basic/chuck.js:219564:25)
    at SAFE_HEAP_LOAD (http://localhost:8000/examples/basic/chuck.js:429:87)
    at _strlen (http://localhost:8000/examples/basic/chuck.js:206345:43)
    at _executeCode (http://localhost:8000/examples/basic/chuck.js:86798:86)
    at asm._executeCode (http://localhost:8000/examples/basic/chuck.js:217514:26)
    at Object.ccallFunc [as ccall] (http://localhost:8000/examples/basic/chuck.js:534:20)
    at HTMLInputElement.<anonymous> (http://localhost:8000/examples/basic/whole.html:1:808)
    at HTMLInputElement.jQuery.event.dispatch (http://localhost:8000/examples/js/jquery-1.10.2.js:5095:9)

Extend demo HTML pages with console

The demo HTML pages should be extended with a console UI element to be able to see console output from ChucK programs. Modify the default layout (js/pages/templates/default_layout.dot.html) when implementing.

Fix user-defined functions

Fix programs defining functions and calling said functions. See for example examples/basic/chirp.html.

Research audio buffer copying under Emscripten

Research how audio is copied to/from Web Audio buffers in Emscripten libraries for SDL and OpenAL. Hopefully it could be done more efficiently than our current approach (i.e., creating new buffers for sending to ChucK).

Switch to audio workers

Replace ScriptProcessorNode with Audio Workers, once the latter is implemented in major browsers. This should lead to much better audio performance, since audio processing will take place in the background rather than the GUI thread.

Wrong local depth gets emitted for method calls

When calling methods on objects, in some cases the wrong local depth (too great) gets emitted. Need to figure out what is causing this.

The below program is an example, the method call in question is s.freq:

SinOsc s => ADSR e => dac;
440.0 => s.freq;

Make it possible to build both native and Emscripten targets with gradle

Currently, the Emscripten SDK has to be loaded in order to build Emscripten targets with gradle. The downside to this is that the native toolchain is then overridden, so that you effectively can't build native targets at the same time (until you unload the Emscripten SDK).

We should maybe auto-load the Emscripten SDK into the environment only for the Emscripten build tasks in gradle, so that the build in general is kept unaffected.

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.