Max vs. Web Audio API

Tables

Max vs. Web Audio API

MaxWeb Audio API
objects with "~"AudioNode
patchAudioContext
striped patch cordnode.connect()
cycle~/tri~/saw~/rect~audioCtx.createOscillator()
gain~/*~audioCtx.createGain()
dac~/ezdac~audioCtx.destination
line/line~node.param.linearRampToValueAtTime()

Vocabulary

Self-Study

  1. Play an F major chord using the Web Audio API. Hint: use either a note frequency table, or the note-name-to-MIDI-number code from the Basics of Music Theory topic.
  2. The osc.start() method takes in an argument: a start time in seconds. Rather than using just a number, it is good practice to specify a time via audioCtx.currentTime + second. Using Web Audio API, play a C major scale, starting on middle C, one note per second.

Self-Quiz

  1. Why is there no sound playing?

    const audioCtx = new AudioContext();
    const osc = audioCtx.createOscillator();
    osc.start();