pauliamgiant/sounds-of-scala

Audio Graph

Opened this issue · 0 comments

Overview

The core goal of this project is to implement a library for describing audio graphs in Scala, and compiling them to Web Audio to run in the browser. An audio graph is a directed graph where vertices are sound sources (oscillators, samples, and so on), transformations such as effects and panning, and sound sinks such as headphones. See the Web Audio description of the audio graph for more.

Extensions would allow interactivity, such as controlling sounds from keyboard and mouse events, and changing the graph while it is running.

Some basic Scala knowledge is required, and some basic digital audio and Web Audio API knowledge would be helpful but not essential.

Applications

Creating synthesizers is a straightforward application of this project. Synthesisers are electronic instruments created by combining components including oscillators, amplifiers, and filters to name a few. These components are all available from the Web Audio API as Nodes.

Audio graphs can also be used to mix together several instruments to produce the overall sound for a musical piece.

Many other applications are possible. In fact, almost all musical applications can be seen as instances of an audio graph.

Examples

Here is a simple synthesizer built using the Web Audio API. We should be able to achieve the equivalent when this project is complete.

Max is audio software that is built around visualizing and manipulating an audio graph.

Implementation Pathway

  • Write Scala.js facade types for Audio Node and its implementations, and related types such as AudioParam. This makes the Web Audio API accessible from Scala.
  • Create a higher-level API that uses the facade types to present a more idiomatic interface in Scala.