Skip to content
Kurt Pachinger edited this page Oct 3, 2022 · 19 revisions

Welcome to the vis-audio wiki!

Overview

The user may interact with audio and physics, scoring points or enjoying a screensaver.

MIDI Visualizer

  • Support any standard MIDI file.
  • Initiate a 5-second countdown.
  • Offer playback controls.
  • Check framerate to moderate quality.
  • Check clocks to re-sync audio.
  • Parse notes to add interactive beats.
  • Display music score as a texture.

Web Audio Visualizer

  • Offer playback controls.
  • View spectrum with presets.
  • View bass and treble with noise.

vis

MM

Magenta Music module.

  • button -- upload MIDI file
  • config -- for mm.PianoRollSVGVisualizer
  • dom -- for mm.PianoRollSVGVisualizer
  • mmPlay -- for mm.Player, re-syncs clock, and lights up shield when note.active is note.isDrumBD
  • playback -- audio control from button
  • state -- playback state

WA

WebAudio module.

  • analyser -- THREE.AudioAnalyser uses WA.sound
  • button -- audio control from button
  • help -- returns avg and max from Array
  • noise -- Perlin, FBM makes skybox and ceiling pulse with treble/bass respectively.
  • sound -- THREE.Audio

cfg

Config, used by gui.set and ux.

  • accents -- used by lights and materials

  • axis -- focal majority for visualizer preset

  • bands -- peaks for fpath use power from max

  • delay -- countdown timer for midi playback

  • demo -- alternate presets ux.update, scheduling ux.tween to var.time

  • intensity -- global light value

  • iso -- relative unit, to scale a note

  • loss -- relative unit, to moderate quality. Decreases DPI, and drops frames in midi. Reduces polySynth.maxPolyphony for complex MIDI playback.

  • primary -- used by lights and materials

  • shield -- rotation

  • type -- spectrum variation for visualizer preset

fmesh (power, opts)

Add spectrum bands using specified power. Outputs an InstancedMesh based on vars.PATH.

fnoise (timestamp, frequency, mesh, type)

Visualize bass/treble on vars.environ using WebAudio from WA each render.

fpath (arg, opts)

Creates visualizer PATH coordinates, then outputs fmesh.

fwave (vars, bpf)

Primary source of visualizer updates from WA affecting position and physics.

gui

Dat.GUI utility access to controllers, create, and set.

mat (opts)

Utility to create a THREE.Material, or coerce its type based on quality loss.

midi (file)

  • Called on MM.button, it creates a noteSequence and bins notes (for draw range), with instrument type.
  • Called every render, it updates midiNote and midiBeat from clocks.
  • ...also idle state.

render

Update ux.update, WA, and midi.

stats

--

three

Init function to setup scene, physics, and event listeners.

ux

  • beat -- classify note, then reset and schedule instanced midiBeat userData
  • mouse --
  • pointer -- cursor x/y
  • raycaster -- intersects a beat from midi in ux
  • resize -- throttle canvas
  • tween -- schedules var.time destinations
  • update --
    • sets cfg.loss from resolution and delta. Stops critically slow MIDI playback.
    • raycasts midiBeat
    • rotates shield
    • cycles demo: camera, light, visualizer

var

  • PATH -- generic and specific visualizer preset data
  • camera --
  • cameraCatmull -- below the scene it creates a renderTexture
  • controls --
  • environ -- Group of THREE scene
  • frame --
  • freqBand -- main visualizer InstancedMesh
  • freqPeak -- on-demand physics blocks InstancedMeshes
  • matCatmullL -- line material for bands (debug)
  • matCatmullM -- mesh material for radial oscillator
  • matCatmullT -- texture for flower-pulse-drumpad-things
  • midiBeat -- interactive MIDI notes
  • midiNote -- PlaneGeometry InstancedMesh used by MM to render noteSequence
  • physics -- reference Oimo
  • renderCatmull -- RenderTarget for matCatmullT
  • renderMIDI -- RenderTarget for midiNote
  • renderer --
  • resolution --
  • scene --
  • sceneMIDI -- low-resolution scene for midiNote RenderTarget
  • time -- LOD delta and ux scheduler