Hello Arve, I’ve been using ChucK for quite some time, but also started to get an interest for the Web Audio API. I think I agree that having chuck compile in a browser would give a huge boost for the language! It is very powerful to be able to directly share musical programs through the internet, without the receiver having to install or run external software. I do fear however that there is a strong difference between ChucK and the way that Web Audio API is designed not to mention the difference between C++ and JavaScript. ChucK has a way of expressing time that is fundamentally different from any other programming language I know. Your implementation at first sight seems to me like like quite a thorough port of the complete structure of ChucK, complete with VM etc.. Does that mean that it will be possible to have sample accurate timing in your code execution just like ChucK ? Playing a little bit with JavaScript I’ve noticed that the JavaScript setTimeout clock is very unpredictable and found it to be messy even for a simple drum machine. Of course there are ways of dealing with that by scheduling ahead and using the WebAudio API clock, but that would not work very well with the way ChucK deals with time. But maybe your implementation doesn’t require the clock to be accurate ? I’m very curious to hear what your experience has been! Anyway what surprised me (shocked is maybe a better word, considering the bad reputation of JavaScript) while playing with the Web Audio API, is that JavaScript is quite interesting as an algorithmic composition scripting language, since it is fundamentally a functional language not that unlike Scheme or Lisp (and some powerful algorithmic musical tools have been built in those like: AC toolbox, Niquist and AthenaCL in Python). Here JavaScript could have an advantage above the more traditional way ChucK deals with types and classes. When using ChucK I found that I almost always wanted to add functionalities to the arrays like iterating, choosing, sorting, mapping functions, lambda functions etc… These are also in the LicK library for ChucK, but I haven’t seen many people use that, I guess because it complicates the syntax a bit*. In JavaScript you get those things from the start (or they are very simple to add). Also it’s easy to change behavior of objects like adding methods dynamically to objects, which is very interesting from the point of view of on the fly programming. So summing this up, I think there is definitely a need for a good JavaScript library to facilitate the generation of music with the Web Audio API. ChucK could be a source of inspiration because it has some very good ideas: - the => syntax is kind of cute and works well for uGens. - the native time type and way of dealing with time (.2::second => now) is very powerful. - the fact that chuck allows 1::sample feedback loops is great! - the control rate can be anything you need it to be. - the ability to spork shreds is very handy when dealing with any type of polyphony. but also perhaps: - the timing system might not translate well (or at all) to JavaScript. - JavaScript functional style programming has it’s own advantages that would be perhaps a waste to overlook when simply putting ChucK into JavaScript. Anyway keep me posted about your progress, I will closely watch your Github! Perhaps I can be of help concerning ChucK, because I cannot really help you with coffee script I’m afraid, since I don’t know it very well. Cheers, Casper * although I must admit that I think it can’t be done any better than LicK did. Casper Schipper casper.schipper@gmail.com www.casperschipper.nl +316 52322590 On 27 dec. 2013, at 02:58, chuck-dev-request@lists.cs.princeton.edu wrote:
Hi guys
I've begun work on a JavaScript (well, CoffeeScript) implementation of ChucK, ChucKJS, for which I'm seeking feedback from ChucK developers in particular. Web Audio API is used to produce sound. Very little of the language is implemented so far, I've just today finished end-to-end support (including a VM) for playing back a sine tone for a certain interval of time as in the following program:
SinOsc sin => dac; 2::second => now;
Even though this may seem minor, I'm pretty happy that this is at all possible just from within the browser :) As explained in the project's README, there is a self-contained example (examples/example1.html) which demonstrates the aforementioned sine wave playback capability.
What do you guys think, are anyone else interested in being able to run ChucK programs in the browser? Anyone interested in helping out on ChucKJS (like ChucK it's GPL licensed)?
My motivation for writing ChucKJS is to develop an online development environment for ChucK where one can execute the programs directly in the browser, I figure this will lower the threshold and make the language more fun to work with.
Merry Christmas, Arve
On this topic I wanted to point out a project "inspired by ChucK" in
the authors' words but not an implementation of the actual ChucK
syntax, Charlie Roberts' Gibber
https://github.com/charlieroberts/Gibber
There is a lot of good stuff in there as far as live coding
environment and cool audio APIs. There might also be some useful
stuff under the hood as far as javascript implementation goes.
michael
On Sat, Dec 28, 2013 at 11:02 AM, Casper Schipper
Hello Arve,
I’ve been using ChucK for quite some time, but also started to get an interest for the Web Audio API. I think I agree that having chuck compile in a browser would give a huge boost for the language! It is very powerful to be able to directly share musical programs through the internet, without the receiver having to install or run external software. I do fear however that there is a strong difference between ChucK and the way that Web Audio API is designed not to mention the difference between C++ and JavaScript. ChucK has a way of expressing time that is fundamentally different from any other programming language I know.
Your implementation at first sight seems to me like like quite a thorough port of the complete structure of ChucK, complete with VM etc.. Does that mean that it will be possible to have sample accurate timing in your code execution just like ChucK ? Playing a little bit with JavaScript I’ve noticed that the JavaScript setTimeout clock is very unpredictable and found it to be messy even for a simple drum machine. Of course there are ways of dealing with that by scheduling ahead and using the WebAudio API clock, but that would not work very well with the way ChucK deals with time. But maybe your implementation doesn’t require the clock to be accurate ? I’m very curious to hear what your experience has been!
Anyway what surprised me (shocked is maybe a better word, considering the bad reputation of JavaScript) while playing with the Web Audio API, is that JavaScript is quite interesting as an algorithmic composition scripting language, since it is fundamentally a functional language not that unlike Scheme or Lisp (and some powerful algorithmic musical tools have been built in those like: AC toolbox, Niquist and AthenaCL in Python). Here JavaScript could have an advantage above the more traditional way ChucK deals with types and classes. When using ChucK I found that I almost always wanted to add functionalities to the arrays like iterating, choosing, sorting, mapping functions, lambda functions etc… These are also in the LicK library for ChucK, but I haven’t seen many people use that, I guess because it complicates the syntax a bit*. In JavaScript you get those things from the start (or they are very simple to add). Also it’s easy to change behavior of objects like adding methods dynamically to objects, which is very interesting from the point of view of on the fly programming.
So summing this up, I think there is definitely a need for a good JavaScript library to facilitate the generation of music with the Web Audio API. ChucK could be a source of inspiration because it has some very good ideas: - the => syntax is kind of cute and works well for uGens. - the native time type and way of dealing with time (.2::second => now) is very powerful. - the fact that chuck allows 1::sample feedback loops is great! - the control rate can be anything you need it to be. - the ability to spork shreds is very handy when dealing with any type of polyphony. but also perhaps: - the timing system might not translate well (or at all) to JavaScript. - JavaScript functional style programming has it’s own advantages that would be perhaps a waste to overlook when simply putting ChucK into JavaScript.
Anyway keep me posted about your progress, I will closely watch your Github! Perhaps I can be of help concerning ChucK, because I cannot really help you with coffee script I’m afraid, since I don’t know it very well.
Cheers, Casper
* although I must admit that I think it can’t be done any better than LicK did.
Casper Schipper casper.schipper@gmail.com www.casperschipper.nl +316 52322590
On 27 dec. 2013, at 02:58, chuck-dev-request@lists.cs.princeton.edu wrote:
Hi guys
I've begun work on a JavaScript (well, CoffeeScript) implementation of ChucK, ChucKJS, for which I'm seeking feedback from ChucK developers in particular. Web Audio API is used to produce sound. Very little of the language is implemented so far, I've just today finished end-to-end support (including a VM) for playing back a sine tone for a certain interval of time as in the following program:
SinOsc sin => dac; 2::second => now;
Even though this may seem minor, I'm pretty happy that this is at all possible just from within the browser :) As explained in the project's README, there is a self-contained example (examples/example1.html) which demonstrates the aforementioned sine wave playback capability.
What do you guys think, are anyone else interested in being able to run ChucK programs in the browser? Anyone interested in helping out on ChucKJS (like ChucK it's GPL licensed)?
My motivation for writing ChucKJS is to develop an online development environment for ChucK where one can execute the programs directly in the browser, I figure this will lower the threshold and make the language more fun to work with.
Merry Christmas, Arve
_______________________________________________ chuck-dev mailing list chuck-dev@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
Thanks Michael, this looks very interesting.
Arve
On Sun, Dec 29, 2013 at 2:45 AM, Michael Heuer
On this topic I wanted to point out a project "inspired by ChucK" in the authors' words but not an implementation of the actual ChucK syntax, Charlie Roberts' Gibber
https://github.com/charlieroberts/Gibber
There is a lot of good stuff in there as far as live coding environment and cool audio APIs. There might also be some useful stuff under the hood as far as javascript implementation goes.
michael
Hello Arve,
I’ve been using ChucK for quite some time, but also started to get an interest for the Web Audio API. I think I agree that having chuck compile in a browser would give a huge boost for the language! It is very powerful to be able to directly share musical programs through the internet, without
receiver having to install or run external software. I do fear however
there is a strong difference between ChucK and the way that Web Audio API is designed not to mention the difference between C++ and JavaScript. ChucK has a way of expressing time that is fundamentally different from any other programming language I know.
Your implementation at first sight seems to me like like quite a thorough port of the complete structure of ChucK, complete with VM etc.. Does that mean that it will be possible to have sample accurate timing in your code execution just like ChucK ? Playing a little bit with JavaScript I’ve noticed that the JavaScript setTimeout clock is very unpredictable and found it to be messy even for a simple drum machine. Of course there are ways of dealing with that by scheduling ahead and using the WebAudio API clock, but that would not work very well with the way ChucK deals with time. But maybe your implementation doesn’t require the clock to be accurate ? I’m very curious to hear what your experience has been!
Anyway what surprised me (shocked is maybe a better word, considering the bad reputation of JavaScript) while playing with the Web Audio API, is
JavaScript is quite interesting as an algorithmic composition scripting language, since it is fundamentally a functional language not that unlike Scheme or Lisp (and some powerful algorithmic musical tools have been built in those like: AC toolbox, Niquist and AthenaCL in Python). Here JavaScript could have an advantage above the more traditional way ChucK deals with types and classes. When using ChucK I found that I almost always wanted to add functionalities to the arrays like iterating, choosing, sorting, mapping functions, lambda functions etc… These are also in the LicK library for ChucK, but I haven’t seen many people use that, I guess because it complicates the syntax a bit*. In JavaScript you get those things from
On Sat, Dec 28, 2013 at 11:02 AM, Casper Schipper
wrote: the that that the start (or they are very simple to add). Also it’s easy to change behavior of objects like adding methods dynamically to objects, which is very interesting from the point of view of on the fly programming.
So summing this up, I think there is definitely a need for a good JavaScript library to facilitate the generation of music with the Web Audio API. ChucK could be a source of inspiration because it has some very good ideas: - the => syntax is kind of cute and works well for uGens. - the native time type and way of dealing with time (.2::second => now) is very powerful. - the fact that chuck allows 1::sample feedback loops is great! - the control rate can be anything you need it to be. - the ability to spork shreds is very handy when dealing with any type of polyphony. but also perhaps: - the timing system might not translate well (or at all) to JavaScript. - JavaScript functional style programming has it’s own advantages that would be perhaps a waste to overlook when simply putting ChucK into JavaScript.
Anyway keep me posted about your progress, I will closely watch your Github! Perhaps I can be of help concerning ChucK, because I cannot really help you with coffee script I’m afraid, since I don’t know it very well.
Cheers, Casper
* although I must admit that I think it can’t be done any better than LicK did.
Casper Schipper casper.schipper@gmail.com www.casperschipper.nl +316 52322590
On 27 dec. 2013, at 02:58, chuck-dev-request@lists.cs.princeton.eduwrote:
Hi guys
I've begun work on a JavaScript (well, CoffeeScript) implementation of ChucK, ChucKJS, for which I'm seeking feedback from ChucK developers in particular. Web Audio API is used to produce sound. Very little of the language is implemented so far, I've just today finished end-to-end support (including a VM) for playing back a sine tone for a certain interval of time as in the following program:
SinOsc sin => dac; 2::second => now;
Even though this may seem minor, I'm pretty happy that this is at all possible just from within the browser :) As explained in the project's README, there is a self-contained example (examples/example1.html) which demonstrates the aforementioned sine wave playback capability.
What do you guys think, are anyone else interested in being able to run ChucK programs in the browser? Anyone interested in helping out on ChucKJS (like ChucK it's GPL licensed)?
My motivation for writing ChucKJS is to develop an online development environment for ChucK where one can execute the programs directly in the browser, I figure this will lower the threshold and make the language more fun to work with.
Merry Christmas, Arve
_______________________________________________ chuck-dev mailing list chuck-dev@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
_______________________________________________ chuck-dev mailing list chuck-dev@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
Hi Casper
On Sat, Dec 28, 2013 at 6:02 PM, Casper Schipper
Your implementation at first sight seems to me like like quite a thorough port of the complete structure of ChucK, complete with VM etc.. Does that mean that it will be possible to have sample accurate timing in your code execution just like ChucK ? Playing a little bit with JavaScript I’ve noticed that the JavaScript setTimeout clock is very unpredictable and found it to be messy even for a simple drum machine. Of course there are ways of dealing with that by scheduling ahead and using the WebAudio API clock, but that would not work very well with the way ChucK deals with time. But maybe your implementation doesn’t require the clock to be accurate ? I’m very curious to hear what your experience has been!
Your observation is quite on the money as regards setTimeout. I only made use of it for simplicity during prototyping, and mean to replace it with something better suited to audio scheduling, e.g. the way that WAAClockhttps://github.com/sebpiq/WAAClock does it (via callbacks to a custom audio processing node). I'm not sure if timing will ever be perfect, but hopefully it'll be acceptable.
Anyway what surprised me (shocked is maybe a better word, considering the bad reputation of JavaScript) while playing with the Web Audio API, is that JavaScript is quite interesting as an algorithmic composition scripting language, since it is fundamentally a functional language not that unlike Scheme or Lisp (and some powerful algorithmic musical tools have been built in those like: AC toolbox, Niquist and AthenaCL in Python). Here JavaScript could have an advantage above the more traditional way ChucK deals with types and classes. When using ChucK I found that I almost always wanted to add functionalities to the arrays like iterating, choosing, sorting, mapping functions, lambda functions etc… These are also in the LicK library for ChucK, but I haven’t seen many people use that, I guess because it complicates the syntax a bit*. In JavaScript you get those things from the start (or they are very simple to add). Also it’s easy to change behavior of objects like adding methods dynamically to objects, which is very interesting from the point of view of on the fly programming.
I'm quite fond of functional programming too (although I'm more of an OO guy), which is one of the reasons I prefer CoffeeScript over raw JavaScript, as this language lends itself better to this style of programming, not having to reach for the underscore library all the time. I know very little ChucK as of yet, but my main motivation is to have a low-threshold environment for playing with the language. I'm not trying to implement the perfect in-browser music programming experience :) Best, Arve On 27 dec. 2013, at 02:58, chuck-dev-request@lists.cs.princeton.edu wrote:
Hi guys
I've begun work on a JavaScript (well, CoffeeScript) implementation of ChucK, ChucKJS https://github.com/aknuds1/chuckjs, for which I'm seeking feedback from ChucK developers in particular. Web Audio APIhttps://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html is used to produce sound. Very little of the language is implemented so far, I've just today finished end-to-end support (including a VM) for playing back a sine tone for a certain interval of time as in the following program:
SinOsc sin => dac; 2::second => now;
Even though this may seem minor, I'm pretty happy that this is at all possible just from within the browser :) As explained in the project's README, there is a self-contained example (examples/example1.html) which demonstrates the aforementioned sine wave playback capability.
What do you guys think, are anyone else interested in being able to run ChucK programs in the browser? Anyone interested in helping out on ChucKJShttps://github.com/aknuds1/chuckjs (like ChucK it's GPL licensed)?
My motivation for writing ChucKJS is to develop an online development environment for ChucK where one can execute the programs directly in the browser, I figure this will lower the threshold and make the language more fun to work with.
Merry Christmas, Arve
_______________________________________________ chuck-dev mailing list chuck-dev@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
participants (3)
-
Arve Knudsen
-
Casper Schipper
-
Michael Heuer