Examples
This page contains links to programming examples for Computer Audio and Music Programming — Spring Quarter 2016 at the University of California, Irvine. The examples focus on techniques of digital audio sound synthesis and processing using the Web Audio API Links to an external site. or Max, or in a few cases Java or C. The examples were written to be used by students of UCI, and are made available on the WWW for all interested programmers and instructors. If you use the text or examples provided here, please give due credit to the author, Christopher Dobrian.
Each link below will lead to a post containing an example program and explanatory text. New examples are added after each class session.
Example 1: The simplest way to play a tone in Web Audio
Example 2: The simplest way to play a tone in Max
Example 3: Mix two sounds equally in Max
Example 4: Turn a tone on and off in a Web page
Example 5: Play a sound in a Web page without JavaScript
Example 6: Use JavaScript to create and control an Audio element
Example 7: The simplest way to play a sound file in the Web Audio API
Example 8: Buffer and play a sound in the Web Audio API
Example 9: Open a sound file and play it in Max
Example 10: Using presentation mode in Max
Example 11: Trigger sound cues with the mouse or from the computer keyboard in Max
Example 12: Getting a sound sample from RAM in Max
Example 13: Playing a sound sample from RAM in Max
Example 14: Vibrato by means of frequency modulation in Web Auido API
Example 15: Frequency modulation in Max
Example 16: Did you know?: Initializing the user interface in Max
Example 17: Synthesizing classic waveforms
Example 18: The harmonic series in Max
Example 19: Pitch and loudness conversions in Max
Example 20: Frequency glissando vs. pitch glissando in Max
Example 21: Simple demonstration of the transport object in Max
Example 22: Other basic functionality of the transport object
Example 23: The translate object updates its output when the tempo changes
Example 24: Tempo-relative timing for MSP LFO control
Example 25: Event timing based on the transport
Example 26: Recurring timed events in HTML5
Example 27: Scheduling timed notes in HTML5
Example 28: Scheduling audio events in Web Audio API
Example 29: Arrays and data structures in Max
Example 30: Print MIDI bytes in Max
Example 31: Parse MIDI notes in Max
Example 32: Parse all MIDI messages in Max
Example 33: MIDI objects for receiving different MIDI messages in Max
Example 34: A very simple MIDI synthesizer in Max
Example 35: Voice-stealing for a monophonic synthesizer in Max
Example 36: A fixed ADSR envelope in Max
Example 37: ADSR envelope of arbitrary duration in Max
Example 38: ADSR envelope subpatch in Max
Example 39: Applying MIDI velocity to ADSR in Max
Example 40: Detuning oscillators in Max
Example 41: Implement MIDI pitchbend in a synthesizer in Max
Example 42: Apply mod wheel in a synthesizer in Max
Example 43: Managing samples in Max
Example 44: Sampling synthesizer in Max
Example 45: ...
This page was last modified on April 30, 2016
by Christopher Dobrian
dobrian@uci.edu