degenerate icon indicating copy to clipboard operation
degenerate copied to clipboard

Add audio reactivity

Open casey opened this issue 3 years ago • 0 comments

Good audio-reactive visuals are responsive to the audio on three timescales:

  • micro: Low-level, high-frequency changes, e.g., audio samples.
  • meso: Medium-frequency changes, e.g., beats and bars.
  • macro: Higher-level, low-frequency thematic changes, e.g., beat drops, outro begins, etc.

Micro timescale: We can use the stream of audio samples, each of which is an integer between -1 and 1, that arrive at 48khz. These can be used both directly, and indirectly by passing them through FFI to convert them to the frequency domain. We can then use them to change the size of masks, the amount of rotation, the amount of color rotation, etc.

Meso timescale: Have a manually or automatically incrementing beat counter and change some property according to the counter. For example, for a 4/4 time signature scale = beat % 4.

Macro timescale: Have a manually or automatically incrementing section counter and use an if … else … construct to change the program based on the section.

For manual control, counters can be incremented with a keypress. For automatic control, counters can be incremented at a sequence of timestamps.

How to do smooth transitions between states is an interesting question.

casey avatar May 14 '22 01:05 casey