Although the RAPID-MIX API can be used in many applications, sound and music is one of the major development areas for many in the RAPID-MIX consortium. Many users of the API will have their own methods of working with sound. For those who don’t, this page documents some basic concepts. There are many resources for sound in RAPID-MIX including:

  • WavesJS — a UI and audio library to develop web audio applications (JavaScript)
  • Maximilian (included in the C++ API) — an audio synthesis and signal processing library written in C++.
  • MaxiLib — a JavaScript port of Maximilian that runs in your browser
  • FreeSound — a collaborative database of Creative Commons Licensed sounds. Browse, download and share sounds.

Basic examples CodeCircle

The examples below are implemented using MaxiLib in CodeCircle. Click the purple “>>” icon to hide the source code. The intent is to show some ideas about how to generate audio. Although specific implementations might differ, the general concepts should apply in many different domains.  The MaxiLib methods in JavaScript are very similar to Maximilian in C++, or ofxMaxim in openFrameworks.

The two main areas discussed are:

Synthesis

Synthesis is the process of generating sound from elementary components: basic, mathematical waveforms that can be combined to generate rich timbres. The most first component is the sine wave.

Sine wave

Sine waves are waveforms with a shape like this:
sine wave

RAPID-MIX API includes the Maximilian Audio Library in C++, known as MaxiLib in JavaScript. The example below plays a very basic audio signal: the sine wave. Click the orange button to toggle sound on and off.

Beating sine waves

This example plays two sine waves with similar frequencies and adds them together. Because the waves interfere, we hear this as beating. Adjust the frequency of the second sine to hear either two distinct tones, roughness or beating, or vibrato. Click the orange button to toggle sound on and off.

Amplitude Modulation

Unlike the last example, this example is multiplying two sine waves. It sounds similar at first, but if you move the slider you will here the affects of amplitude modulation.

Frequency Modulation

Other wave forms

common wave forms

Pulse Width Modulation

Samples

Hello, Brother

Here’s the most used sample in the history of using samples, being used by MaxiLib in CodeCircle. The sample was loaded using CodeCircle’s files interface, which you can see by clicking on the gear icon in the code pane, then clicking files.