Giter VIP home page Giter VIP logo

musicn.js's Introduction

musicn.js

The code in this repository is the beginnings of a compiler for a MUSIC-V-like language. It is based on a tutorial example given in Max Mathew's 1969 book "The Technology of Computer Music" (MIT Press).

This code was developed to support a talk I gave at the 1st Web Audio Conference at IRCAM in Paris in January 2015.

Notes

This compiler barely does enough to generate the first score in the tutorial given by Mathews in his book, "The technology of computer music". But it is flexible enough to be extended to do more if I, or any of you reading this, have the time and inclination to do so. We wrote a parser for the language using peg.js and it should be straightforward to extend that to support the missing unit generators.

To compile the score and play it arrange for app/index.html to be served on your machine and visit index.html.

To run the unit tests, first install the dependencies

npm install

Then

npm test

To incorporate your changes into the application, they need turning into a bundle with browserify

npm run-script build

musicn.js's People

Contributors

chrislo avatar

Stargazers

Farouk avatar ebigram avatar Hayleigh Thompson avatar Karim Ratib avatar  avatar Chris Hart avatar Michael Anthony avatar Li Song avatar Jamie White avatar Eric Bailey avatar Steven Yi avatar Jason Sigal avatar Jan Monschke avatar Seb Jacobs avatar

Watchers

 avatar Bill Walker avatar James Cloos avatar Michael Anthony avatar Benoit Tigeot avatar

musicn.js's Issues

Rendering only works on Firefox

Currently I rely on copyToChannel(data, 0); on AudioBuffer to play the generated samples from the non-web audio part of the code as an AudioBuffer with the Web Audio API.

That method doesn't seem to work on Chrome, so currently you cannot play the demo score there. That can be fixed by copying the samples sample-by-sample, but it'd be nice to do that as a polyfil so that it just works when Chrome implements copyToChannel

Allow connection of unit generators

Currently the Model.Oscillator writes the generated samples directly to the output buffer of the instrument. It should write it to a named register buffer (B2 for example) to allow other unit generators to read from it, and therefore generators to be connected together.

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.