A JavaScript edition of Ambient 1: Music for Airports 2/1 by Brian Eno, as built in the JavaScript Systems Music guide.
Uses instrument samples from the Sonatina Symphonic Orchestra. You can get more of them by downloading the ZIP from their site.
Also uses an impulse response sample from AirWindows.
This project setup differs from the one in the article in the following:
- The canvas visualization is included as well, not just the music.
- Sample buffers are cached in memory instead of fetching them anew each time.
- Babel is used for ES2015 to ES5 compilation instead of running ES2015 natively in the browser.
npm install
npm run start
This installs a live local server as well as a Babel compiler watcher. Changes in src
are picked up automatically.
To build the project, just invoke npm run build
. Everything you need will be in the dist
folder:
index.html
to host the applicationmusicforairport.js
, the compiled source code of the app.musicforairports.min.js
, a minified version of the source code.Samples
samples used to play the music and to generate the convolution reverb.
If you want to embed the player on an existing website, take a look at index.html
. There are three key parts you need to take from there and add to your page:
- A
<canvas>
element with idmusic-for-airports
. - The whatwg-fetch polyfill and the Web Audio API shim libraries for cross-browser compatibility.
- The
musicforairports.js
ormusicforairports.min.js
script tag.
ISC License
Copyright (c) 2016, Tero Parviainen
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.